Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libperfuse - delete an obsoelte comment about inactive



details:   https://anonhg.NetBSD.org/src/rev/dbe04434970d
branches:  trunk
changeset: 757924:dbe04434970d
user:      manu <manu%NetBSD.org@localhost>
date:      Mon Oct 04 03:56:24 2010 +0000

description:
- delete an obsoelte comment about inactive
- remove a test for getattr return field that was never filled
- correctly send filehandle and filehandle flags for getaattr

diffstat:

 lib/libperfuse/ops.c |  30 ++++++++++++++----------------
 1 files changed, 14 insertions(+), 16 deletions(-)

diffs (73 lines):

diff -r a3660697a562 -r dbe04434970d lib/libperfuse/ops.c
--- a/lib/libperfuse/ops.c      Sun Oct 03 22:06:43 2010 +0000
+++ b/lib/libperfuse/ops.c      Mon Oct 04 03:56:24 2010 +0000
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.19 2010/10/03 05:46:47 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.20 2010/10/04 03:56:24 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -1192,10 +1192,7 @@
 
        /*
         * Do not open twice, and do not reopen for reading
-        * if we already have write handle. Just ask for
-        * inactive, in case the node was open by a create
-        * operation (we are not allowed to call puffs_setback
-        * at create time, puffs interface forbids it)
+        * if we already have write handle.
         */
        if (((mode & FREAD) && (pnd->pnd_flags & PND_RFH)) ||
            ((mode & FREAD) && (pnd->pnd_flags & PND_WFH)) ||
@@ -1319,7 +1316,12 @@
                fgi = GET_INPAYLOAD(ps, pm, fuse_getattr_in);
                fgi->getattr_flags = 0; 
                fgi->dummy = 0;
-               fgi->fh = perfuse_get_fh(opc, FREAD);
+               fgi->fh = 0;
+
+               if (PERFUSE_NODE_DATA(opc)->pnd_flags & PND_OPEN) {
+                       fgi->fh = perfuse_get_fh(opc, FREAD);
+                       fgi->getattr_flags |= FUSE_GETATTR_FH; 
+               }
 
 #ifdef PERFUSE_DEBUG
                if (perfuse_diagflags & PDF_FH)
@@ -1335,12 +1337,6 @@
 
                fao = GET_OUTPAYLOAD(ps, pm, fuse_attr_out);
 
-#ifdef PERFUSE_DEBUG
-               if (!(fao->attr_valid & (FUSE_FATTR_SIZE|FUSE_FATTR_MODE|
-                                        FUSE_FATTR_UID|FUSE_FATTR_GID)))
-                       DERRX(EX_SOFTWARE, "%s: fao->attr_valid = 0x%"PRId64"",
-                             __func__, fao->attr_valid);
-#endif
                error = puffs_access(VREG, fao->attr.mode, fao->attr.uid,
                                     fao->attr.gid, (mode_t)mode, pcr); 
 
@@ -1392,10 +1388,12 @@
        fgi = GET_INPAYLOAD(ps, pm, fuse_getattr_in);
        fgi->getattr_flags = 0; 
        fgi->dummy = 0;
-       fgi->fh = perfuse_get_fh(opc, FREAD);
-
-       if (PERFUSE_NODE_DATA(opc)->pnd_flags & PND_OPEN)
+       fgi->fh = 0;
+
+       if (PERFUSE_NODE_DATA(opc)->pnd_flags & PND_OPEN) {
+               fgi->fh = perfuse_get_fh(opc, FREAD);
                fgi->getattr_flags |= FUSE_GETATTR_FH;
+       }
 
        if ((error = xchg_msg(pu, opc, pm, sizeof(*fao), wait_reply)) != 0)
                goto out;
@@ -2760,7 +2758,7 @@
                        pm = ps->ps_new_msg(pu, opc, FUSE_GETATTR, 
                                            sizeof(*fgi), NULL);
                        fgi = GET_INPAYLOAD(ps, pm, fuse_getattr_in);
-                       fgi->getattr_flags = 0; 
+                       fgi->getattr_flags = FUSE_GETATTR_FH; 
                        fgi->dummy = 0;
                        fgi->fh = perfuse_get_fh(opc, FWRITE);
 



Home | Main Index | Thread Index | Old Index