diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2007-10-18 06:07:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 17:37:31 -0400 |
commit | 6ff958edbf39c014eb06b65ad25b736be08c4e63 (patch) | |
tree | f87af1ae11b321cfa38c25378229f25942797385 /fs/fuse/dir.c | |
parent | 17637cbaba592076c221dc045ca78422b4af6290 (diff) |
fuse: add atomic open+truncate support
This patch allows fuse filesystems to implement open(..., O_TRUNC) as a single
request, instead of separate truncate and open requests.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 537d38bee13c..052327bd6c9d 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -1083,6 +1083,9 @@ static int fuse_do_setattr(struct dentry *entry, struct iattr *attr, | |||
1083 | return err; | 1083 | return err; |
1084 | } | 1084 | } |
1085 | 1085 | ||
1086 | if ((attr->ia_valid & ATTR_OPEN) && fc->atomic_o_trunc) | ||
1087 | return 0; | ||
1088 | |||
1086 | if (attr->ia_valid & ATTR_SIZE) { | 1089 | if (attr->ia_valid & ATTR_SIZE) { |
1087 | unsigned long limit; | 1090 | unsigned long limit; |
1088 | if (IS_SWAPFILE(inode)) | 1091 | if (IS_SWAPFILE(inode)) |