summaryrefslogtreecommitdiffstats
path: root/net/ceph/ceph_fs.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-07-22 13:40:42 -0700
committerKeith Packard <keithp@keithp.com>2011-07-22 13:40:42 -0700
commitdf7976797fa9af161690dbf4dee81ed92cdc150f (patch)
treebe6f04706d91cc80da4dbd3a5f5f2a174f1bdae3 /net/ceph/ceph_fs.c
parentf0b69efc29b024747a88ce020dada425e3193d5a (diff)
parent9c54c0dd948d715ccfd79e97d852f80eeb53254a (diff)
downloadop-kernel-dev-df7976797fa9af161690dbf4dee81ed92cdc150f.zip
op-kernel-dev-df7976797fa9af161690dbf4dee81ed92cdc150f.tar.gz
Merge branch 'drm-intel-fixes' into drm-intel-next
Diffstat (limited to 'net/ceph/ceph_fs.c')
-rw-r--r--net/ceph/ceph_fs.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/net/ceph/ceph_fs.c b/net/ceph/ceph_fs.c
index a3a3a31..41466cc 100644
--- a/net/ceph/ceph_fs.c
+++ b/net/ceph/ceph_fs.c
@@ -36,16 +36,19 @@ int ceph_flags_to_mode(int flags)
if ((flags & O_DIRECTORY) == O_DIRECTORY)
return CEPH_FILE_MODE_PIN;
#endif
- if ((flags & O_APPEND) == O_APPEND)
- flags |= O_WRONLY;
- if ((flags & O_ACCMODE) == O_RDWR)
- mode = CEPH_FILE_MODE_RDWR;
- else if ((flags & O_ACCMODE) == O_WRONLY)
+ switch (flags & O_ACCMODE) {
+ case O_WRONLY:
mode = CEPH_FILE_MODE_WR;
- else
+ break;
+ case O_RDONLY:
mode = CEPH_FILE_MODE_RD;
-
+ break;
+ case O_RDWR:
+ case O_ACCMODE: /* this is what the VFS does */
+ mode = CEPH_FILE_MODE_RDWR;
+ break;
+ }
#ifdef O_LAZY
if (flags & O_LAZY)
mode |= CEPH_FILE_MODE_LAZY;
OpenPOWER on IntegriCloud