svn commit: r326988 - head/sys/fs/fuse

John Baldwin jhb at FreeBSD.org
Tue Dec 19 19:09:08 UTC 2017


Author: jhb
Date: Tue Dec 19 19:09:06 2017
New Revision: 326988
URL: https://svnweb.freebsd.org/changeset/base/326988

Log:
  Add a custom VOP_PATHCONF method for fuse.
  
  This method handles _PC_FILESIZEBITS, _PC_SYMLINK_MAX, and _PC_NO_TRUNC.
  For other values it defers to vop_stdpathconf().
  
  MFC after:	1 month
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/fs/fuse/fuse_vnops.c

Modified: head/sys/fs/fuse/fuse_vnops.c
==============================================================================
--- head/sys/fs/fuse/fuse_vnops.c	Tue Dec 19 19:07:24 2017	(r326987)
+++ head/sys/fs/fuse/fuse_vnops.c	Tue Dec 19 19:09:06 2017	(r326988)
@@ -126,6 +126,7 @@ static vop_lookup_t fuse_vnop_lookup;
 static vop_mkdir_t fuse_vnop_mkdir;
 static vop_mknod_t fuse_vnop_mknod;
 static vop_open_t fuse_vnop_open;
+static vop_pathconf_t fuse_vnop_pathconf;
 static vop_read_t fuse_vnop_read;
 static vop_readdir_t fuse_vnop_readdir;
 static vop_readlink_t fuse_vnop_readlink;
@@ -158,7 +159,7 @@ struct vop_vector fuse_vnops = {
 	.vop_mkdir = fuse_vnop_mkdir,
 	.vop_mknod = fuse_vnop_mknod,
 	.vop_open = fuse_vnop_open,
-	.vop_pathconf = vop_stdpathconf,
+	.vop_pathconf = fuse_vnop_pathconf,
 	.vop_read = fuse_vnop_read,
 	.vop_readdir = fuse_vnop_readdir,
 	.vop_readlink = fuse_vnop_readlink,
@@ -1173,6 +1174,25 @@ fuse_vnop_open(struct vop_open_args *ap)
 	error = fuse_filehandle_open(vp, fufh_type, NULL, td, cred);
 
 	return error;
+}
+
+static int
+fuse_vnop_pathconf(struct vop_pathconf_args *ap)
+{
+
+	switch (ap->a_name) {
+	case _PC_FILESIZEBITS:
+		*ap->a_retval = 64;
+		return (0);
+	case _PC_SYMLINK_MAX:
+		*ap->a_retval = MAXPATHLEN;
+		return (0);
+	case _PC_NO_TRUNC:
+		*ap->a_retval = 1;
+		return (0);
+	default:
+		return (vop_stdpathconf(ap));
+	}
 }
 
 /*


More information about the svn-src-head mailing list