diff options
author | Colin Cross <ccross@android.com> | 2011-08-10 18:04:43 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-08-10 18:04:43 -0700 |
commit | d2c3c40789e6645e40c8538182acf7a6831d1db3 (patch) | |
tree | 39d26f98a61fbed58d59586bbc7fe97b176e4c33 /net/ceph/ceph_fs.c | |
parent | 526bc12ba4772b1301dfaae17572181f4a82cb41 (diff) | |
parent | 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff) | |
download | kernel_samsung_tuna-d2c3c40789e6645e40c8538182acf7a6831d1db3.zip kernel_samsung_tuna-d2c3c40789e6645e40c8538182acf7a6831d1db3.tar.gz kernel_samsung_tuna-d2c3c40789e6645e40c8538182acf7a6831d1db3.tar.bz2 |
Merge commit 'v3.0' into linux-omap-3.0
Diffstat (limited to 'net/ceph/ceph_fs.c')
-rw-r--r-- | net/ceph/ceph_fs.c | 17 |
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; |