PERFORCE change 194957 for review

Ilya Putsikau ilya at FreeBSD.org
Sun Jun 19 09:35:35 UTC 2011


http://p4web.freebsd.org/@@194957?ac=10

Change 194957 by ilya at ilya_triton2011 on 2011/06/19 09:35:01

	Create vobject. Fix typo in fuse_io_dispatch
	While faking vfs_getattr(), changed to return a non-zero block size. (macfuse rev 63)
	Use cnp->cn_thread and cnp->cn_cred when available

Affected files ...

.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.c#10 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_io.c#9 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vfsops.c#13 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vnops.c#16 edit

Differences ...

==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.c#10 (text+ko) ====

@@ -393,7 +393,7 @@
     debug_printf("dvp=%p, cnp=%p, op=%d\n", vp, cnp, op);
 
     fdisp_init(&fdi, cnp->cn_namelen + 1);
-    fdisp_make_vp(&fdi, op, dvp, curthread, NULL);
+    fdisp_make_vp(&fdi, op, dvp, cnp->cn_thread, cnp->cn_cred);
 
     memcpy(fdi.indata, cnp->cn_nameptr, cnp->cn_namelen);
     ((char *)fdi.indata)[cnp->cn_namelen] = '\0';
@@ -478,7 +478,7 @@
 
     fdip->iosize = bufsize + cnp->cn_namelen + 1;
 
-    fdisp_make(fdip, op, mp, dnid, curthread, NULL);
+    fdisp_make(fdip, op, mp, dnid, cnp->cn_thread, cnp->cn_cred);
     memcpy(fdip->indata, buf, bufsize);
     memcpy((char *)fdip->indata + bufsize, cnp->cn_nameptr, cnp->cn_namelen);
     ((char *)fdip->indata)[bufsize + cnp->cn_namelen] = '\0';
@@ -512,7 +512,7 @@
     err = fuse_vnode_get(mp, feo->nodeid, dvp, vpp, cnp,
 	vtyp, 0);
     if (err) {
-        fuse_internal_forget_send(mp, curthread, NULL, feo->nodeid, 1, fdip);
+        fuse_internal_forget_send(mp, cnp->cn_thread, cnp->cn_cred, feo->nodeid, 1, fdip);
         return err;
     }
 

==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_io.c#9 (text+ko) ====

@@ -112,7 +112,7 @@
 
     err = fuse_io_filehandle_get(vp, (uio->uio_rw == UIO_READ),
         cred, &fufh);
-    if (!err)
+    if (err)
         return (err);
 
     bzero(&fioda, sizeof(fioda));

==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vfsops.c#13 (text+ko) ====

@@ -21,6 +21,7 @@
 #include <sys/fcntl.h>
 
 #include "fuse.h"
+#include "fuse_param.h"
 #include "fuse_node.h"
 #include "fuse_ipc.h"
 #include "fuse_internal.h"
@@ -394,7 +395,7 @@
     sbp->f_files   = 0;
     sbp->f_ffree   = 0;
     sbp->f_namemax = 0;
-    sbp->f_bsize   = 0;
+    sbp->f_bsize   = FUSE_DEFAULT_BLOCKSIZE;
 
     return (0);
 }

==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vnops.c#16 (text+ko) ====

@@ -1169,6 +1169,11 @@
     }
 
 ok:
+    if (vnode_vtype(vp) == VREG) {
+        /* XXXIP prevent getattr, by using cached node size */
+        vnode_create_vobject(vp, 0, td);
+    }
+
     {
         /*
          * Doing this here because when a vnode goes inactive, no-cache and


More information about the p4-projects mailing list