diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 277f497923a2..7a049fd2aa4c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -58,14 +58,15 @@ struct inodes_stat_t { | |||
58 | 58 | ||
59 | #define NR_FILE 8192 /* this can well be larger on a larger system */ | 59 | #define NR_FILE 8192 /* this can well be larger on a larger system */ |
60 | 60 | ||
61 | #define MAY_EXEC 1 | 61 | #define MAY_EXEC 0x00000001 |
62 | #define MAY_WRITE 2 | 62 | #define MAY_WRITE 0x00000002 |
63 | #define MAY_READ 4 | 63 | #define MAY_READ 0x00000004 |
64 | #define MAY_APPEND 8 | 64 | #define MAY_APPEND 0x00000008 |
65 | #define MAY_ACCESS 16 | 65 | #define MAY_ACCESS 0x00000010 |
66 | #define MAY_OPEN 32 | 66 | #define MAY_OPEN 0x00000020 |
67 | #define MAY_CHDIR 64 | 67 | #define MAY_CHDIR 0x00000040 |
68 | #define MAY_NOT_BLOCK 128 /* called from RCU mode, don't block */ | 68 | /* called from RCU mode, don't block */ |
69 | #define MAY_NOT_BLOCK 0x00000080 | ||
69 | 70 | ||
70 | /* | 71 | /* |
71 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond | 72 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond |
@@ -963,7 +964,12 @@ struct file { | |||
963 | #define f_dentry f_path.dentry | 964 | #define f_dentry f_path.dentry |
964 | #define f_vfsmnt f_path.mnt | 965 | #define f_vfsmnt f_path.mnt |
965 | const struct file_operations *f_op; | 966 | const struct file_operations *f_op; |
966 | spinlock_t f_lock; /* f_ep_links, f_flags, no IRQ */ | 967 | |
968 | /* | ||
969 | * Protects f_ep_links, f_flags, f_pos vs i_size in lseek SEEK_CUR. | ||
970 | * Must not be taken from IRQ context. | ||
971 | */ | ||
972 | spinlock_t f_lock; | ||
967 | #ifdef CONFIG_SMP | 973 | #ifdef CONFIG_SMP |
968 | int f_sb_list_cpu; | 974 | int f_sb_list_cpu; |
969 | #endif | 975 | #endif |
@@ -1063,6 +1069,8 @@ static inline int file_check_writeable(struct file *filp) | |||
1063 | #define FL_LEASE 32 /* lease held on this file */ | 1069 | #define FL_LEASE 32 /* lease held on this file */ |
1064 | #define FL_CLOSE 64 /* unlock on close */ | 1070 | #define FL_CLOSE 64 /* unlock on close */ |
1065 | #define FL_SLEEP 128 /* A blocking lock */ | 1071 | #define FL_SLEEP 128 /* A blocking lock */ |
1072 | #define FL_DOWNGRADE_PENDING 256 /* Lease is being downgraded */ | ||
1073 | #define FL_UNLOCK_PENDING 512 /* Lease is being broken */ | ||
1066 | 1074 | ||
1067 | /* | 1075 | /* |
1068 | * Special return value from posix_lock_file() and vfs_lock_file() for | 1076 | * Special return value from posix_lock_file() and vfs_lock_file() for |
@@ -1109,7 +1117,7 @@ struct file_lock { | |||
1109 | struct list_head fl_link; /* doubly linked list of all locks */ | 1117 | struct list_head fl_link; /* doubly linked list of all locks */ |
1110 | struct list_head fl_block; /* circular list of blocked processes */ | 1118 | struct list_head fl_block; /* circular list of blocked processes */ |
1111 | fl_owner_t fl_owner; | 1119 | fl_owner_t fl_owner; |
1112 | unsigned char fl_flags; | 1120 | unsigned int fl_flags; |
1113 | unsigned char fl_type; | 1121 | unsigned char fl_type; |
1114 | unsigned int fl_pid; | 1122 | unsigned int fl_pid; |
1115 | struct pid *fl_nspid; | 1123 | struct pid *fl_nspid; |
@@ -1119,7 +1127,9 @@ struct file_lock { | |||
1119 | loff_t fl_end; | 1127 | loff_t fl_end; |
1120 | 1128 | ||
1121 | struct fasync_struct * fl_fasync; /* for lease break notifications */ | 1129 | struct fasync_struct * fl_fasync; /* for lease break notifications */ |
1122 | unsigned long fl_break_time; /* for nonblocking lease breaks */ | 1130 | /* for lease breaks: */ |
1131 | unsigned long fl_break_time; | ||
1132 | unsigned long fl_downgrade_time; | ||
1123 | 1133 | ||
1124 | const struct file_lock_operations *fl_ops; /* Callbacks for filesystems */ | 1134 | const struct file_lock_operations *fl_ops; /* Callbacks for filesystems */ |
1125 | const struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */ | 1135 | const struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */ |
@@ -1623,9 +1633,10 @@ struct inode_operations { | |||
1623 | struct seq_file; | 1633 | struct seq_file; |
1624 | 1634 | ||
1625 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, | 1635 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, |
1626 | unsigned long nr_segs, unsigned long fast_segs, | 1636 | unsigned long nr_segs, unsigned long fast_segs, |
1627 | struct iovec *fast_pointer, | 1637 | struct iovec *fast_pointer, |
1628 | struct iovec **ret_pointer); | 1638 | struct iovec **ret_pointer, |
1639 | int check_access); | ||
1629 | 1640 | ||
1630 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); | 1641 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); |
1631 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); | 1642 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); |
@@ -2397,8 +2408,8 @@ file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | |||
2397 | extern loff_t noop_llseek(struct file *file, loff_t offset, int origin); | 2408 | extern loff_t noop_llseek(struct file *file, loff_t offset, int origin); |
2398 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); | 2409 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); |
2399 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); | 2410 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); |
2400 | extern loff_t generic_file_llseek_unlocked(struct file *file, loff_t offset, | 2411 | extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, |
2401 | int origin); | 2412 | int origin, loff_t maxsize); |
2402 | extern int generic_file_open(struct inode * inode, struct file * filp); | 2413 | extern int generic_file_open(struct inode * inode, struct file * filp); |
2403 | extern int nonseekable_open(struct inode * inode, struct file * filp); | 2414 | extern int nonseekable_open(struct inode * inode, struct file * filp); |
2404 | 2415 | ||
@@ -2624,8 +2635,8 @@ static const struct file_operations __fops = { \ | |||
2624 | .llseek = generic_file_llseek, \ | 2635 | .llseek = generic_file_llseek, \ |
2625 | }; | 2636 | }; |
2626 | 2637 | ||
2627 | static inline void __attribute__((format(printf, 1, 2))) | 2638 | static inline __printf(1, 2) |
2628 | __simple_attr_check_format(const char *fmt, ...) | 2639 | void __simple_attr_check_format(const char *fmt, ...) |
2629 | { | 2640 | { |
2630 | /* don't do anything, just let the compiler check the arguments; */ | 2641 | /* don't do anything, just let the compiler check the arguments; */ |
2631 | } | 2642 | } |