[Tux3] Userspace : Changes to tux3fuse

Amey Magar amey.magar at gmail.com
Sun Jan 25 15:12:39 PST 2009


Removed sync_super from all functions. Now sync_super is called only at umount.

diff -r 58e077f83dc1 user/tux3fuse.c
--- a/user/tux3fuse.c	Sat Jan 24 15:04:49 2009 -0800
+++ b/user/tux3fuse.c	Mon Jan 26 04:23:31 2009 +0530
@@ -225,9 +225,6 @@
 	}
 
 	tuxsync(inode);
-	if ((errno = -sync_super(sb)))
-		goto eek;
-
 	fuse_reply_write(req, written);
 	return;
 eek:
@@ -364,8 +361,6 @@
 		goto eek;
 	if ((errno = -tux_delete_entry(buffer, entry)))
 		goto eek;
-	if ((errno = -sync_super(sb)))
- 		goto eek;
 
 	fuse_reply_err(req, 0);
 	return;
@@ -463,7 +458,6 @@
 		printf("save_inode error\n");
 
 	tuxsync(inode);
-	sync_super(sb);
 
 	struct stat stbuf;
 	_tux3_getattr(inode, &stbuf);
@@ -547,11 +541,7 @@
 	if (ino != FUSE_ROOT_ID) {
 		struct inode *inode = (struct inode *)(unsigned long)fi->fh;
 		tuxclose(inode);
-		if ((errno = -sync_super(sb))) {
-			fuse_reply_err(req, errno);
-			return;
-		}
-	}
+ 	}
 	fuse_reply_err(req, 0);
 }
 
@@ -573,10 +563,9 @@
 	}
 
 	int err = set_xattr(inode, name, strlen(name), value, size, flags);
-	if (!err) {
+	if (!err) 
 		tuxsync(inode);
-		sync_super(sb);
-	}
+		
 	fuse_reply_err(req, -err);
 
 	if (ino != FUSE_ROOT_ID)
@@ -703,8 +692,7 @@
 
 	char *mountpoint;
 	int foreground;
-	int err = -1;
-
+	
 	if (argc < 3)
 		error("usage: %s <volname> <mountpoint>", argv[0]);
 
@@ -724,8 +712,11 @@
 				{
 					fuse_session_add_chan(fs, fc);
 					fuse_daemonize(foreground);
-					err = fuse_session_loop(fs);
-					fuse_remove_signal_handlers(fs);
+					if ((errno = -fuse_session_loop(fs)))
+					        goto eek;
+					if ((errno = -sync_super(sb)))
+					        goto eek;
+	                                fuse_remove_signal_handlers(fs);
 					fuse_session_remove_chan(fc);
 				}
 
@@ -737,5 +728,7 @@
 	}
 
 	fuse_opt_free_args(&args);
-	return err ? 1 : 0;
+ eek:
+	warn("Eek! %s", strerror(errno));
+	return !errno;
 }	

Regards,
Amey Magar
Chinmay Kamat
Gaurav Tungatkar
Kushal Dalmia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tux3fuse_changes.diff
Type: text/x-patch
Size: 1807 bytes
Desc: not available
URL: <http://phunq.net/pipermail/tux3/attachments/20090126/47c2a893/attachment.bin>
-------------- next part --------------
_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://mailman.tux3.org/cgi-bin/mailman/listinfo/tux3


More information about the Tux3 mailing list