aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h41
1 files changed, 22 insertions, 19 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 0dcdd9458f4b..195a8cb2a749 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -63,23 +63,24 @@ extern int dir_notify_enable;
63#define MAY_ACCESS 16 63#define MAY_ACCESS 16
64#define MAY_OPEN 32 64#define MAY_OPEN 32
65 65
66#define FMODE_READ ((__force fmode_t)1) 66/* file is open for reading */
67#define FMODE_WRITE ((__force fmode_t)2) 67#define FMODE_READ ((__force fmode_t)1)
68 68/* file is open for writing */
69/* Internal kernel extensions */ 69#define FMODE_WRITE ((__force fmode_t)2)
70#define FMODE_LSEEK ((__force fmode_t)4) 70/* file is seekable */
71#define FMODE_PREAD ((__force fmode_t)8) 71#define FMODE_LSEEK ((__force fmode_t)4)
72#define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */ 72/* file can be accessed using pread/pwrite */
73 73#define FMODE_PREAD ((__force fmode_t)8)
74/* File is being opened for execution. Primary users of this flag are 74#define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */
75 distributed filesystems that can use it to achieve correct ETXTBUSY 75/* File is opened for execution with sys_execve / sys_uselib */
76 behavior for cross-node execution/opening_for_writing of files */ 76#define FMODE_EXEC ((__force fmode_t)16)
77#define FMODE_EXEC ((__force fmode_t)16) 77/* File is opened with O_NDELAY (only set for block devices) */
78 78#define FMODE_NDELAY ((__force fmode_t)32)
79#define FMODE_NDELAY ((__force fmode_t)32) 79/* File is opened with O_EXCL (only set for block devices) */
80#define FMODE_EXCL ((__force fmode_t)64) 80#define FMODE_EXCL ((__force fmode_t)64)
81/* File is opened using open(.., 3, ..) and is writeable only for ioctls
82 (specialy hack for floppy.c) */
81#define FMODE_WRITE_IOCTL ((__force fmode_t)128) 83#define FMODE_WRITE_IOCTL ((__force fmode_t)128)
82#define FMODE_NDELAY_NOW ((__force fmode_t)256)
83 84
84#define RW_MASK 1 85#define RW_MASK 1
85#define RWA_MASK 2 86#define RWA_MASK 2
@@ -315,6 +316,7 @@ struct poll_table_struct;
315struct kstatfs; 316struct kstatfs;
316struct vm_area_struct; 317struct vm_area_struct;
317struct vfsmount; 318struct vfsmount;
319struct cred;
318 320
319extern void __init inode_init(void); 321extern void __init inode_init(void);
320extern void __init inode_init_early(void); 322extern void __init inode_init_early(void);
@@ -826,7 +828,7 @@ struct file {
826 fmode_t f_mode; 828 fmode_t f_mode;
827 loff_t f_pos; 829 loff_t f_pos;
828 struct fown_struct f_owner; 830 struct fown_struct f_owner;
829 unsigned int f_uid, f_gid; 831 const struct cred *f_cred;
830 struct file_ra_state f_ra; 832 struct file_ra_state f_ra;
831 833
832 u64 f_version; 834 u64 f_version;
@@ -1193,7 +1195,7 @@ enum {
1193#define has_fs_excl() atomic_read(&current->fs_excl) 1195#define has_fs_excl() atomic_read(&current->fs_excl)
1194 1196
1195#define is_owner_or_cap(inode) \ 1197#define is_owner_or_cap(inode) \
1196 ((current->fsuid == (inode)->i_uid) || capable(CAP_FOWNER)) 1198 ((current_fsuid() == (inode)->i_uid) || capable(CAP_FOWNER))
1197 1199
1198/* not quite ready to be deprecated, but... */ 1200/* not quite ready to be deprecated, but... */
1199extern void lock_super(struct super_block *); 1201extern void lock_super(struct super_block *);
@@ -1673,7 +1675,8 @@ extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
1673extern long do_sys_open(int dfd, const char __user *filename, int flags, 1675extern long do_sys_open(int dfd, const char __user *filename, int flags,
1674 int mode); 1676 int mode);
1675extern struct file *filp_open(const char *, int, int); 1677extern struct file *filp_open(const char *, int, int);
1676extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); 1678extern struct file * dentry_open(struct dentry *, struct vfsmount *, int,
1679 const struct cred *);
1677extern int filp_close(struct file *, fl_owner_t id); 1680extern int filp_close(struct file *, fl_owner_t id);
1678extern char * getname(const char __user *); 1681extern char * getname(const char __user *);
1679 1682