diff options
author | Sage Weil <sage@newdream.net> | 2011-07-26 14:27:59 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2011-07-26 14:27:59 -0400 |
commit | 9bae113a085b790de384bf86f09e15b42a65a985 (patch) | |
tree | 44d42141bf2d61a3098cedb381ec775cded8ac89 /fs | |
parent | acda76578813ef893004ecad0e5ad2bb6039e5f7 (diff) |
ceph: only link open operations to directory unsafe list if O_CREAT|O_TRUNC
We only need to put these on the directory unsafe list if they have
side effects that fsync(2) should flush out.
Reviewed-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 9b667e9abf4c..e0115eb4e9ba 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -194,7 +194,8 @@ int ceph_open(struct inode *inode, struct file *file) | |||
194 | req->r_inode = inode; | 194 | req->r_inode = inode; |
195 | ihold(inode); | 195 | ihold(inode); |
196 | req->r_num_caps = 1; | 196 | req->r_num_caps = 1; |
197 | err = ceph_mdsc_do_request(mdsc, parent_inode, req); | 197 | err = ceph_mdsc_do_request(mdsc, (flags & (O_CREAT|O_TRUNC)) ? |
198 | parent_inode : NULL, req); | ||
198 | if (!err) | 199 | if (!err) |
199 | err = ceph_init_file(inode, file, req->r_fmode); | 200 | err = ceph_init_file(inode, file, req->r_fmode); |
200 | ceph_mdsc_put_request(req); | 201 | ceph_mdsc_put_request(req); |