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.h36
1 files changed, 23 insertions, 13 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 277f497923a2..14493a2d5a03 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 */
@@ -2397,8 +2407,8 @@ file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
2397extern loff_t noop_llseek(struct file *file, loff_t offset, int origin); 2407extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
2398extern loff_t no_llseek(struct file *file, loff_t offset, int origin); 2408extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
2399extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); 2409extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
2400extern loff_t generic_file_llseek_unlocked(struct file *file, loff_t offset, 2410extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
2401 int origin); 2411 int origin, loff_t maxsize);
2402extern int generic_file_open(struct inode * inode, struct file * filp); 2412extern int generic_file_open(struct inode * inode, struct file * filp);
2403extern int nonseekable_open(struct inode * inode, struct file * filp); 2413extern int nonseekable_open(struct inode * inode, struct file * filp);
2404 2414