Use the new vop_stdpathconf() instead of rolling our own.
authorMatthew Dillon <dillon@dragonflybsd.org>
Sun, 28 Sep 2008 05:04:22 +0000 (05:04 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sun, 28 Sep 2008 05:04:22 +0000 (05:04 +0000)
sys/vfs/hammer/hammer_vnops.c
sys/vfs/ufs/ufs_vnops.c

index 27a1eb5..93c922a 100644 (file)
@@ -31,7 +31,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * 
- * $DragonFly: src/sys/vfs/hammer/hammer_vnops.c,v 1.99 2008/09/23 22:28:56 dillon Exp $
+ * $DragonFly: src/sys/vfs/hammer/hammer_vnops.c,v 1.100 2008/09/28 05:04:21 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -66,7 +66,6 @@ static int hammer_vop_nlink(struct vop_nlink_args *);
 static int hammer_vop_nmkdir(struct vop_nmkdir_args *);
 static int hammer_vop_nmknod(struct vop_nmknod_args *);
 static int hammer_vop_open(struct vop_open_args *);
-static int hammer_vop_pathconf(struct vop_pathconf_args *);
 static int hammer_vop_print(struct vop_print_args *);
 static int hammer_vop_readdir(struct vop_readdir_args *);
 static int hammer_vop_readlink(struct vop_readlink_args *);
@@ -109,7 +108,7 @@ struct vop_ops hammer_vnode_vops = {
        .vop_nmkdir =           hammer_vop_nmkdir,
        .vop_nmknod =           hammer_vop_nmknod,
        .vop_open =             hammer_vop_open,
-       .vop_pathconf =         hammer_vop_pathconf,
+       .vop_pathconf =         vop_stdpathconf,
        .vop_print =            hammer_vop_print,
        .vop_readdir =          hammer_vop_readdir,
        .vop_readlink =         hammer_vop_readlink,
@@ -725,6 +724,7 @@ hammer_vop_getattr(struct vop_getattr_args *ap)
        } else {
                vap->va_bytes = (ip->ino_data.size + 15) & ~15;
        }
+
        vap->va_type = hammer_get_vnode_type(ip->ino_data.obj_type);
        vap->va_filerev = 0;    /* XXX */
        /* mtime uniquely identifies any adjustments made to the file XXX */
@@ -1198,16 +1198,6 @@ hammer_vop_open(struct vop_open_args *ap)
        return(vop_stdopen(ap));
 }
 
-/*
- * hammer_vop_pathconf { vp, name, retval }
- */
-static
-int
-hammer_vop_pathconf(struct vop_pathconf_args *ap)
-{
-       return EOPNOTSUPP;
-}
-
 /*
  * hammer_vop_print { vp }
  */
index 7b70e03..b73b016 100644 (file)
@@ -37,7 +37,7 @@
  *
  *     @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95
  * $FreeBSD: src/sys/ufs/ufs/ufs_vnops.c,v 1.131.2.8 2003/01/02 17:26:19 bde Exp $
- * $DragonFly: src/sys/vfs/ufs/ufs_vnops.c,v 1.66 2008/06/26 18:53:14 dillon Exp $
+ * $DragonFly: src/sys/vfs/ufs/ufs_vnops.c,v 1.67 2008/09/28 05:04:22 dillon Exp $
  */
 
 #include "opt_quota.h"
@@ -93,7 +93,6 @@ static int ufs_mkdir (struct vop_old_mkdir_args *);
 static int ufs_mknod (struct vop_old_mknod_args *);
 static int ufs_mmap (struct vop_mmap_args *);
 static int ufs_open (struct vop_open_args *);
-static int ufs_pathconf (struct vop_pathconf_args *);
 static int ufs_print (struct vop_print_args *);
 static int ufs_readdir (struct vop_readdir_args *);
 static int ufs_readlink (struct vop_readlink_args *);
@@ -2033,40 +2032,6 @@ ufsfifo_kqfilter(struct vop_kqfilter_args *ap)
        return (error);
 }
 
-/*
- * Return POSIX pathconf information applicable to ufs filesystems.
- *
- * ufs_pathconf(struct vnode *a_vp, int a_name, int *a_retval)
- */
-static
-int
-ufs_pathconf(struct vop_pathconf_args *ap)
-{
-       switch (ap->a_name) {
-       case _PC_LINK_MAX:
-               *ap->a_retval = LINK_MAX;
-               return (0);
-       case _PC_NAME_MAX:
-               *ap->a_retval = NAME_MAX;
-               return (0);
-       case _PC_PATH_MAX:
-               *ap->a_retval = PATH_MAX;
-               return (0);
-       case _PC_PIPE_BUF:
-               *ap->a_retval = PIPE_BUF;
-               return (0);
-       case _PC_CHOWN_RESTRICTED:
-               *ap->a_retval = 1;
-               return (0);
-       case _PC_NO_TRUNC:
-               *ap->a_retval = 1;
-               return (0);
-       default:
-               return (EINVAL);
-       }
-       /* NOTREACHED */
-}
-
 /*
  * Advisory record locking support
  *
@@ -2387,11 +2352,11 @@ static struct vop_ops ufs_vnode_vops = {
        .vop_getattr =          ufs_getattr,
        .vop_inactive =         ufs_inactive,
        .vop_old_link =         ufs_link,
-       .vop_old_mkdir =                ufs_mkdir,
-       .vop_old_mknod =                ufs_mknod,
+       .vop_old_mkdir =        ufs_mkdir,
+       .vop_old_mknod =        ufs_mknod,
        .vop_mmap =             ufs_mmap,
        .vop_open =             ufs_open,
-       .vop_pathconf =         ufs_pathconf,
+       .vop_pathconf =         vop_stdpathconf,
        .vop_poll =             vop_stdpoll,
        .vop_kqfilter =         ufs_kqfilter,
        .vop_print =            ufs_print,