diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-19 10:15:07 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-22 12:27:34 -0500 |
commit | 5300990c0370e804e49d9a59d928c5d53fb73487 (patch) | |
tree | 08ed922afd172662039c082ec9e9410070f4afe8 /include/linux/fs.h | |
parent | 482928d59db668b8d82a48717f78986d8cea72e9 (diff) |
Sanitize f_flags helpers
* pull ACC_MODE to fs.h; we have several copies all over the place
* nightmarish expression calculating f_mode by f_flags deserves a helper
too (OPEN_FMODE(flags))
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index cca191933ff6..9e13b533aaef 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2464,5 +2464,8 @@ int proc_nr_files(struct ctl_table *table, int write, | |||
2464 | 2464 | ||
2465 | int __init get_filesystem_list(char *buf); | 2465 | int __init get_filesystem_list(char *buf); |
2466 | 2466 | ||
2467 | #define ACC_MODE(x) ("\000\004\002\006"[(x)&O_ACCMODE]) | ||
2468 | #define OPEN_FMODE(flag) ((__force fmode_t)((flag + 1) & O_ACCMODE)) | ||
2469 | |||
2467 | #endif /* __KERNEL__ */ | 2470 | #endif /* __KERNEL__ */ |
2468 | #endif /* _LINUX_FS_H */ | 2471 | #endif /* _LINUX_FS_H */ |