summaryrefslogtreecommitdiff
path: root/net/ceph/ceph_fs.c
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2011-07-25 09:58:06 -0700
committerJohn Stultz <john.stultz@linaro.org>2011-07-25 09:58:06 -0700
commit21a602b5cdc203cbcf8bbeeb26edeb3de7c65955 (patch)
tree8618b4a8882f78076a779ebb416b54332cc213db /net/ceph/ceph_fs.c
parent1a3807e5a6bea7e4b195fbb399bbc09e73230d4c (diff)
parent81f6236c4811b2b2b3ea64a306c071f76788ac4b (diff)
Merge branch 'upstream/linaro-3.0' into linaro-android-3.0linux-linaro-3.0-2011.07-1-android-0
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 a3a3a31d3c3..41466ccb972 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;