diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2005-09-09 16:10:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 17:03:47 -0400 |
commit | 8254798199332966e2ab647380c990193af7e854 (patch) | |
tree | ad4a9721a872fbdec0be107f35684864a1a94053 /fs/fuse/dir.c | |
parent | b36c31ba95f0fe0a03c727300d9c4c54438a5636 (diff) |
[PATCH] FUSE: add fsync operation for directories
This patch adds a new FSYNCDIR request, which is sent when fsync is called
on directories. This operation is available in libfuse 2.3-pre1 or
greater.
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 9b43fd46aaad..73792d65b6cf 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -617,6 +617,12 @@ static int fuse_dir_release(struct inode *inode, struct file *file) | |||
617 | return fuse_release_common(inode, file, 1); | 617 | return fuse_release_common(inode, file, 1); |
618 | } | 618 | } |
619 | 619 | ||
620 | static int fuse_dir_fsync(struct file *file, struct dentry *de, int datasync) | ||
621 | { | ||
622 | /* nfsd can call this with no file */ | ||
623 | return file ? fuse_fsync_common(file, de, datasync, 1) : 0; | ||
624 | } | ||
625 | |||
620 | static unsigned iattr_to_fattr(struct iattr *iattr, struct fuse_attr *fattr) | 626 | static unsigned iattr_to_fattr(struct iattr *iattr, struct fuse_attr *fattr) |
621 | { | 627 | { |
622 | unsigned ivalid = iattr->ia_valid; | 628 | unsigned ivalid = iattr->ia_valid; |
@@ -934,6 +940,7 @@ static struct file_operations fuse_dir_operations = { | |||
934 | .readdir = fuse_readdir, | 940 | .readdir = fuse_readdir, |
935 | .open = fuse_dir_open, | 941 | .open = fuse_dir_open, |
936 | .release = fuse_dir_release, | 942 | .release = fuse_dir_release, |
943 | .fsync = fuse_dir_fsync, | ||
937 | }; | 944 | }; |
938 | 945 | ||
939 | static struct inode_operations fuse_common_inode_operations = { | 946 | static struct inode_operations fuse_common_inode_operations = { |