diff options
author | Sage Weil <sage@newdream.net> | 2011-07-26 14:26:07 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2011-07-26 14:26:07 -0400 |
commit | 4918b6d140c4822201ebbe2f070875332aff337b (patch) | |
tree | 0327a0a68acd2f8209893b4770ba3c9d9264041c /fs/ceph/ioctl.c | |
parent | 252c6728de604d6a897d85e212996811d5c8c46c (diff) |
ceph: add F_SYNC file flag to force sync (non-O_DIRECT) io
This allows us to force IO through the sync path which you normally only
get when multiple clients are reading/writing to the same file or by
mounting with -o sync. Among other things, this lets test programs verify
correctness with a single mount.
Reviewed-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/ioctl.c')
-rw-r--r-- | fs/ceph/ioctl.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index ef0b5f48e13a..a757a5680578 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c | |||
@@ -231,6 +231,14 @@ static long ceph_ioctl_lazyio(struct file *file) | |||
231 | return 0; | 231 | return 0; |
232 | } | 232 | } |
233 | 233 | ||
234 | static long ceph_ioctl_syncio(struct file *file) | ||
235 | { | ||
236 | struct ceph_file_info *fi = file->private_data; | ||
237 | |||
238 | fi->flags |= CEPH_F_SYNC; | ||
239 | return 0; | ||
240 | } | ||
241 | |||
234 | long ceph_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 242 | long ceph_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
235 | { | 243 | { |
236 | dout("ioctl file %p cmd %u arg %lu\n", file, cmd, arg); | 244 | dout("ioctl file %p cmd %u arg %lu\n", file, cmd, arg); |
@@ -249,6 +257,9 @@ long ceph_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
249 | 257 | ||
250 | case CEPH_IOC_LAZYIO: | 258 | case CEPH_IOC_LAZYIO: |
251 | return ceph_ioctl_lazyio(file); | 259 | return ceph_ioctl_lazyio(file); |
260 | |||
261 | case CEPH_IOC_SYNCIO: | ||
262 | return ceph_ioctl_syncio(file); | ||
252 | } | 263 | } |
253 | 264 | ||
254 | return -ENOTTY; | 265 | return -ENOTTY; |