hurdextras-commit
[Top][All Lists]
Advanced

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

Changes to libfuse/netfs.c


From: Stefan Siegl
Subject: Changes to libfuse/netfs.c
Date: Fri, 09 Dec 2005 10:28:24 -0500

Index: libfuse/netfs.c
diff -u libfuse/netfs.c:1.38 libfuse/netfs.c:1.39
--- libfuse/netfs.c:1.38        Fri Dec  9 14:58:30 2005
+++ libfuse/netfs.c     Fri Dec  9 15:28:24 2005
@@ -382,6 +382,9 @@
   if (!err && (flags & O_EXEC))
     err = fshelp_access (&node->nn_stat, S_IEXEC, user);
 
+  /* store provided flags for later open/read/write/release operation call */
+  node->nn->info.flags = flags;
+
  out:
   FUNC_EPILOGUE(err);
 }
@@ -1033,9 +1036,26 @@
 
   node->nn->info.writepage = 0; /* cannot distinct on the Hurd :( */
 
+  if(fuse_ops && fuse_ops->open)
+    if((err = fuse_ops->open(node->nn->path, &node->nn->info)))
+      goto out;
+
   int sz = fuse_ops ? 
     (fuse_ops->write(node->nn->path, data, *len, offset, &node->nn->info)) : 
     (fuse_ops_compat->write(node->nn->path, data, *len, offset));
+
+  /* FIXME: open, flush and release handling probably should be changed
+   * completely, I mean, we probably should do fuse_ops->open in 
+   * the netfs_check_open_permissions function and leave it open
+   * until the node is destroyed.
+   *
+   * This way we wouldn't be able to report any errors back.
+   */
+  if(sz >= 0 && fuse_ops && fuse_ops->flush)
+    err = fuse_ops->flush(node->nn->path, &node->nn->info);
+
+  if(fuse_ops && fuse_ops->open && fuse_ops->release)
+    fuse_ops->release(node->nn->path, &node->nn->info);
      
   if(sz < 0)
     err = -sz;
@@ -1111,10 +1131,26 @@
       goto out;
     }
 
+  if(fuse_ops && fuse_ops->open)
+    if((err = fuse_ops->open(node->nn->path, &node->nn->info)))
+      goto out;
 
   int sz = fuse_ops ? 
     (fuse_ops->read(node->nn->path, data, *len, offset, &node->nn->info)) : 
     (fuse_ops_compat->read(node->nn->path, data, *len, offset));
+
+  /* FIXME: open, flush and release handling probably should be changed
+   * completely, I mean, we probably should do fuse_ops->open in 
+   * the netfs_check_open_permissions function and leave it open
+   * until the node is destroyed.
+   *
+   * This way we wouldn't be able to report any errors back.
+   */
+  if(sz >= 0 && fuse_ops && fuse_ops->flush)
+    err = fuse_ops->flush(node->nn->path, &node->nn->info);
+
+  if(fuse_ops && fuse_ops->open && fuse_ops->release)
+    fuse_ops->release(node->nn->path, &node->nn->info);
 
   if(sz < 0)
     err = -sz;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]