Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jun 2011 09:32:17 GMT
From:      Ilya Putsikau <ilya@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 194955 for review
Message-ID:  <201106190932.p5J9WHwb070343@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@194955?ac=10

Change 194955 by ilya@ilya_triton2011 on 2011/06/19 09:31:44

	Enable commented sysctls
	Fix fuse_device_clone rename
	Add missing isbzero function

Affected files ...

.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse.h#7 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_file.c#3 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.c#8 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_ipc.c#4 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_main.c#5 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.c#3 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.h#5 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vnops.c#14 edit

Differences ...

==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse.h#7 (text+ko) ====

@@ -225,10 +225,6 @@
 void fprettyprint(struct fuse_iov *fiov, size_t dlen);
 #endif
 
-#if _DEBUG || _DEBUG2G || _DEBUG3G || defined(INVARIANTS) || FUSELIB_CONFORM_BIOREAD
-int isbzero(void *buf, size_t len);
-#endif
-
 #if _DEBUG || _DEBUG2G || _DEBUG3G
 #include <sys/kdb.h>
 

==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_file.c#3 (text+ko) ====

@@ -29,6 +29,10 @@
 #include "fuse_ipc.h"
 #include "fuse_node.h"
 
+static uint64_t fuse_fh_upcall_count = 0;
+SYSCTL_QUAD(_vfs_fuse, OID_AUTO, fh_upcall_count, CTLFLAG_RD,
+            &fuse_fh_upcall_count, 0, "");
+
 int
 fuse_filehandle_get(struct vnode *vp, struct thread *td, struct ucred *cred, fufh_type_t fufh_type)
 {

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

@@ -39,9 +39,11 @@
 #include "fuse_ipc.h"
 #include "fuse_node.h"
 #include "fuse_file.h"
-// #include "fuse_nodehash.h"
 #include "fuse_param.h"
-// #include "fuse_sysctl.h"
+
+#ifdef ZERO_PAD_INCOMPLETE_BUFS
+static int isbzero(void *buf, size_t len);
+#endif
 
 /* access */
 
@@ -358,7 +360,7 @@
             break;
         }
 
-#if FUSELIB_CONFORM_BIOREAD
+#ifdef ZERO_PAD_INCOMPLETE_BUFS
         if (isbzero(buf, FUSE_NAME_OFFSET)) {
             err = -1;
             break;
@@ -711,3 +713,19 @@
     fuse_insert_callback(fdi.tick, fuse_internal_init_callback);
     fuse_insert_message(fdi.tick);
 }
+
+#ifdef ZERO_PAD_INCOMPLETE_BUFS
+static int
+isbzero(void *buf, size_t len)
+{
+    int i;
+
+    for (i = 0; i < len; i++)
+    {
+        if (((char *)buf)[i])
+            return (0);
+    }
+
+    return (1);
+}
+#endif

==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_ipc.c#4 (text+ko) ====

@@ -52,9 +52,9 @@
 SYSCTL_NODE(_vfs, OID_AUTO, fuse, CTLFLAG_RW, 0, "FUSE tunables");
 SYSCTL_STRING(_vfs_fuse, OID_AUTO, fuse4bsd_version, CTLFLAG_RD,
               FUSE4BSD_VERSION, 0, "fuse4bsd version");
-static int maxfreetickets = 1024;
-SYSCTL_INT(_vfs_fuse, OID_AUTO, maxfreetickets, CTLFLAG_RW,
-            &maxfreetickets, 0, "limit for number of free tickets kept");
+static int fuse_max_freetickets = 1024;
+SYSCTL_INT(_vfs_fuse, OID_AUTO, max_freetickets, CTLFLAG_RW,
+            &fuse_max_freetickets, 0, "limit for number of free tickets kept");
 static long fuse_iov_permanent_bufsize = 1 << 19;
 SYSCTL_LONG(_vfs_fuse, OID_AUTO, iov_permanent_bufsize, CTLFLAG_RW,
             &fuse_iov_permanent_bufsize, 0,
@@ -121,10 +121,6 @@
     fiov_adjust(fiov, 0);
 }
 
-/* <== fuse_iov methods */
-
-/* fuse_ticket methods ==> */
-
 /*
  * Tickets are carriers of communication with a fuse daemon.
  * Tickets have a unique id, which should be kept unique
@@ -150,7 +146,6 @@
  *     cache)
  */
 
-
 static struct fuse_ticket *
 fticket_alloc(struct fuse_data *data)
 {
@@ -488,8 +483,8 @@
 
     mtx_lock(&tick->tk_data->ticket_mtx);
 
-    if (maxfreetickets >= 0 &&
-        maxfreetickets <= tick->tk_data->freeticket_counter) {
+    if (fuse_max_freetickets >= 0 &&
+        fuse_max_freetickets <= tick->tk_data->freeticket_counter) {
         die = 1;
     } else {
         mtx_unlock(&tick->tk_data->ticket_mtx);
@@ -753,12 +748,6 @@
     ihead->gid = cred->cr_rgid;
 }
 
-/********************
- *
- * >>> Callback handlers
- *
- ********************/
-
 /*
  * fuse_standard_handler just pulls indata and wakes up pretender.
  * Doesn't try to interpret data, that's left for the pretender.

==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_main.c#5 (text+ko) ====

@@ -31,7 +31,7 @@
 #endif
 
 
-extern void fusedev_clone(void *arg, struct ucred *cred, char *name,
+extern void fuse_device_clone(void *arg, struct ucred *cred, char *name,
                           int namelen, struct cdev **dev);
 
 extern struct vfsops fuse_vfsops;
@@ -86,7 +86,7 @@
 #ifdef USE_FUSE_LOCK
 		mtx_init(&fuse_mtx, "fuse_mtx", NULL, MTX_DEF);
 #endif
-		eh_tag = EVENTHANDLER_REGISTER(dev_clone, fusedev_clone, 0,
+		eh_tag = EVENTHANDLER_REGISTER(dev_clone, fuse_device_clone, 0,
 		                               1000);
 		if (eh_tag == NULL) {
 			clone_cleanup(&fuseclones);

==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.c#3 (text+ko) ====

@@ -34,6 +34,8 @@
 #include <sys/priv.h>
 #include <security/mac/mac_framework.h>
 
+MALLOC_DEFINE(M_FUSEVN, "fuse_vnode", "fuse vnode private data");
+
 static void
 fuse_vnode_init(struct vnode *vp, struct fuse_vnode_data *fvdat,
     uint64_t nodeid, enum vtype vtyp)

==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.h#5 (text+ko) ====

@@ -68,8 +68,6 @@
     }
 }
 
-MALLOC_DECLARE(M_FUSEVN);
-
 struct get_filehandle_param {
     enum fuse_opcode opcode;
     uint8_t          do_gc:1;

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

@@ -105,8 +105,13 @@
 	.vop_unlock        = fuse_vnop_unlock,
 };
 
-MALLOC_DEFINE(M_FUSEVN, "fuse_vnode", "fuse vnode private data");
-MALLOC_DEFINE(M_FUSEFH, "fuse_filehandles", "buffer for fuse filehandles");
+static uint64_t fuse_lookup_cache_hits = 0;
+SYSCTL_QUAD(_vfs_fuse, OID_AUTO, lookup_cache_hits, CTLFLAG_RD,
+            &fuse_lookup_cache_hits, 0, "");
+
+static uint64_t fuse_lookup_cache_misses  = 0;
+SYSCTL_QUAD(_vfs_fuse, OID_AUTO, lookup_cache_misses, CTLFLAG_RD,
+            &fuse_lookup_cache_misses, 0, "");
 
 int fuse_pbuf_freecnt = -1;
 
@@ -650,15 +655,11 @@
         switch (err) {
 
         case -1: /* positive match */
-#ifdef XXXIP
             fuse_lookup_cache_hits++;
-#endif
             return 0;
 
         case 0: /* no match in cache */
-#ifdef XXXIP
             fuse_lookup_cache_misses++;
-#endif
             break;
 
         case ENOENT: /* negative match */
@@ -1240,13 +1241,12 @@
         return EBADF;
     }
 
-#ifdef XXXIP
+
     /* Sanity check the uio data. */
-    if ((uio_iovcnt(uio) > 1) ||
+    if ( /* XXXIP (uio_iovcnt(uio) > 1) || */
         (uio_resid(uio) < (int)sizeof(struct dirent))) {
         return (EINVAL);
     }
-#endif
 
     fvdat = VTOFUD(vp);
 
@@ -1363,7 +1363,6 @@
     }
 
     cache_purge(vp);
-    /* XXXIP TODO */
     vfs_hash_remove(vp);
     vnode_destroy_vobject(vp);
     fuse_vnode_destroy(vp);
@@ -1620,7 +1619,7 @@
 
     facp.facc_flags &= ~FACCESS_XQUERIES;
 
-    if (err && ! (fsai->valid & ~(FATTR_ATIME | FATTR_MTIME)) &&
+    if (err && !(fsai->valid & ~(FATTR_ATIME | FATTR_MTIME)) &&
         vap->va_vaflags & VA_UTIMES_NULL) {
         err = fuse_internal_access(vp, VWRITE, cred, td, &facp);
     }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106190932.p5J9WHwb070343>