Skip to content
Snippets Groups Projects
Commit e6625fa4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
parents 47126d80 38be7a79
No related branches found
No related tags found
No related merge requests found
...@@ -36,16 +36,19 @@ int ceph_flags_to_mode(int flags) ...@@ -36,16 +36,19 @@ int ceph_flags_to_mode(int flags)
if ((flags & O_DIRECTORY) == O_DIRECTORY) if ((flags & O_DIRECTORY) == O_DIRECTORY)
return CEPH_FILE_MODE_PIN; return CEPH_FILE_MODE_PIN;
#endif #endif
if ((flags & O_APPEND) == O_APPEND)
flags |= O_WRONLY;
if ((flags & O_ACCMODE) == O_RDWR) switch (flags & O_ACCMODE) {
mode = CEPH_FILE_MODE_RDWR; case O_WRONLY:
else if ((flags & O_ACCMODE) == O_WRONLY)
mode = CEPH_FILE_MODE_WR; mode = CEPH_FILE_MODE_WR;
else break;
case O_RDONLY:
mode = CEPH_FILE_MODE_RD; 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 #ifdef O_LAZY
if (flags & O_LAZY) if (flags & O_LAZY)
mode |= CEPH_FILE_MODE_LAZY; mode |= CEPH_FILE_MODE_LAZY;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment