Rev 6293 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6293 | Rev 6936 | ||
---|---|---|---|
1 | #ifndef _LINUX_FS_H |
1 | #ifndef _LINUX_FS_H |
2 | #define _LINUX_FS_H |
2 | #define _LINUX_FS_H |
3 | #include |
3 | #include |
4 | #include |
4 | #include |
5 | #include |
5 | #include |
6 | #include |
6 | #include |
7 | #define MAY_EXEC 0x00000001 |
7 | #define MAY_EXEC 0x00000001 |
8 | #define MAY_WRITE 0x00000002 |
8 | #define MAY_WRITE 0x00000002 |
9 | #define MAY_READ 0x00000004 |
9 | #define MAY_READ 0x00000004 |
10 | #define MAY_APPEND 0x00000008 |
10 | #define MAY_APPEND 0x00000008 |
11 | #define MAY_ACCESS 0x00000010 |
11 | #define MAY_ACCESS 0x00000010 |
12 | #define MAY_OPEN 0x00000020 |
12 | #define MAY_OPEN 0x00000020 |
13 | #define MAY_CHDIR 0x00000040 |
13 | #define MAY_CHDIR 0x00000040 |
14 | /* called from RCU mode, don't block */ |
14 | /* called from RCU mode, don't block */ |
15 | #define MAY_NOT_BLOCK 0x00000080 |
15 | #define MAY_NOT_BLOCK 0x00000080 |
16 | /* |
16 | /* |
17 | * Attribute flags. These should be or-ed together to figure out what |
17 | * Attribute flags. These should be or-ed together to figure out what |
18 | * has been changed! |
18 | * has been changed! |
19 | */ |
19 | */ |
20 | #define ATTR_MODE (1 << 0) |
20 | #define ATTR_MODE (1 << 0) |
21 | #define ATTR_UID (1 << 1) |
21 | #define ATTR_UID (1 << 1) |
22 | #define ATTR_GID (1 << 2) |
22 | #define ATTR_GID (1 << 2) |
23 | #define ATTR_SIZE (1 << 3) |
23 | #define ATTR_SIZE (1 << 3) |
24 | #define ATTR_ATIME (1 << 4) |
24 | #define ATTR_ATIME (1 << 4) |
25 | #define ATTR_MTIME (1 << 5) |
25 | #define ATTR_MTIME (1 << 5) |
26 | #define ATTR_CTIME (1 << 6) |
26 | #define ATTR_CTIME (1 << 6) |
27 | #define ATTR_ATIME_SET (1 << 7) |
27 | #define ATTR_ATIME_SET (1 << 7) |
28 | #define ATTR_MTIME_SET (1 << 8) |
28 | #define ATTR_MTIME_SET (1 << 8) |
29 | #define ATTR_FORCE (1 << 9) /* Not a change, but a change it */ |
29 | #define ATTR_FORCE (1 << 9) /* Not a change, but a change it */ |
30 | #define ATTR_ATTR_FLAG (1 << 10) |
30 | #define ATTR_ATTR_FLAG (1 << 10) |
31 | #define ATTR_KILL_SUID (1 << 11) |
31 | #define ATTR_KILL_SUID (1 << 11) |
32 | #define ATTR_KILL_SGID (1 << 12) |
32 | #define ATTR_KILL_SGID (1 << 12) |
33 | #define ATTR_FILE (1 << 13) |
33 | #define ATTR_FILE (1 << 13) |
34 | #define ATTR_KILL_PRIV (1 << 14) |
34 | #define ATTR_KILL_PRIV (1 << 14) |
35 | #define ATTR_OPEN (1 << 15) /* Truncating from open(O_TRUNC) */ |
35 | #define ATTR_OPEN (1 << 15) /* Truncating from open(O_TRUNC) */ |
36 | #define ATTR_TIMES_SET (1 << 16) |
36 | #define ATTR_TIMES_SET (1 << 16) |
37 | /* |
37 | /* |
38 | * inode->i_mutex nesting subclasses for the lock validator: |
38 | * inode->i_mutex nesting subclasses for the lock validator: |
39 | * |
39 | * |
40 | * 0: the object of the current VFS operation |
40 | * 0: the object of the current VFS operation |
41 | * 1: parent |
41 | * 1: parent |
42 | * 2: child/target |
42 | * 2: child/target |
43 | * 3: xattr |
43 | * 3: xattr |
44 | * 4: second non-directory |
44 | * 4: second non-directory |
45 | * 5: second parent (when locking independent directories in rename) |
45 | * 5: second parent (when locking independent directories in rename) |
46 | * |
46 | * |
47 | * I_MUTEX_NONDIR2 is for certain operations (such as rename) which lock two |
47 | * I_MUTEX_NONDIR2 is for certain operations (such as rename) which lock two |
48 | * non-directories at once. |
48 | * non-directories at once. |
49 | * |
49 | * |
50 | * The locking order between these classes is |
50 | * The locking order between these classes is |
51 | * parent[2] -> child -> grandchild -> normal -> xattr -> second non-directory |
51 | * parent[2] -> child -> grandchild -> normal -> xattr -> second non-directory |
52 | */ |
52 | */ |
53 | enum inode_i_mutex_lock_class |
53 | enum inode_i_mutex_lock_class |
54 | { |
54 | { |
55 | I_MUTEX_NORMAL, |
55 | I_MUTEX_NORMAL, |
56 | I_MUTEX_PARENT, |
56 | I_MUTEX_PARENT, |
57 | I_MUTEX_CHILD, |
57 | I_MUTEX_CHILD, |
58 | I_MUTEX_XATTR, |
58 | I_MUTEX_XATTR, |
59 | I_MUTEX_NONDIR2, |
59 | I_MUTEX_NONDIR2, |
60 | I_MUTEX_PARENT2, |
60 | I_MUTEX_PARENT2, |
61 | }; |
61 | }; |
62 | struct file { |
62 | struct file { |
63 | 63 | ||
64 | /* |
64 | /* |
65 | * Protects f_ep_links, f_flags. |
65 | * Protects f_ep_links, f_flags. |
66 | * Must not be taken from IRQ context. |
66 | * Must not be taken from IRQ context. |
67 | */ |
67 | */ |
68 | spinlock_t f_lock; |
68 | spinlock_t f_lock; |
69 | atomic_long_t f_count; |
69 | atomic_long_t f_count; |
70 | unsigned int f_flags; |
70 | unsigned int f_flags; |
71 | fmode_t f_mode; |
71 | fmode_t f_mode; |
72 | 72 | ||
73 | /* needed for tty driver, and maybe others */ |
73 | /* needed for tty driver, and maybe others */ |
74 | void *private_data; |
74 | void *private_data; |
75 | 75 | ||
76 | struct page **pages; /* physical memory backend */ |
76 | struct page **pages; /* physical memory backend */ |
77 | unsigned int count; |
77 | unsigned int count; |
78 | unsigned int allocated; |
78 | unsigned int allocated; |
79 | void *vma; |
79 | void *vma; |
80 | 80 | ||
81 | } __attribute__((aligned(4))); /* lest something weird decides that 2 is OK */ |
81 | } __attribute__((aligned(4))); /* lest something weird decides that 2 is OK */ |
82 | #define get_file_rcu(x) atomic_long_inc_not_zero(&(x)->f_count) |
82 | #define get_file_rcu(x) atomic_long_inc_not_zero(&(x)->f_count) |
83 | #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) |
83 | #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) |
84 | #define file_count(x) atomic_long_read(&(x)->f_count) |
84 | #define file_count(x) atomic_long_read(&(x)->f_count) |
85 | #define FL_POSIX 1 |
85 | #define FL_POSIX 1 |
86 | #define FL_FLOCK 2 |
86 | #define FL_FLOCK 2 |
87 | #define FL_DELEG 4 /* NFSv4 delegation */ |
87 | #define FL_DELEG 4 /* NFSv4 delegation */ |
88 | #define FL_ACCESS 8 /* not trying to lock, just looking */ |
88 | #define FL_ACCESS 8 /* not trying to lock, just looking */ |
89 | #define FL_EXISTS 16 /* when unlocking, test for existence */ |
89 | #define FL_EXISTS 16 /* when unlocking, test for existence */ |
90 | #define FL_LEASE 32 /* lease held on this file */ |
90 | #define FL_LEASE 32 /* lease held on this file */ |
91 | #define FL_CLOSE 64 /* unlock on close */ |
91 | #define FL_CLOSE 64 /* unlock on close */ |
92 | #define FL_SLEEP 128 /* A blocking lock */ |
92 | #define FL_SLEEP 128 /* A blocking lock */ |
93 | #define FL_DOWNGRADE_PENDING 256 /* Lease is being downgraded */ |
93 | #define FL_DOWNGRADE_PENDING 256 /* Lease is being downgraded */ |
94 | #define FL_UNLOCK_PENDING 512 /* Lease is being broken */ |
94 | #define FL_UNLOCK_PENDING 512 /* Lease is being broken */ |
95 | #define FL_OFDLCK 1024 /* lock is "owned" by struct file */ |
95 | #define FL_OFDLCK 1024 /* lock is "owned" by struct file */ |
96 | #define FL_LAYOUT 2048 /* outstanding pNFS layout */ |
96 | #define FL_LAYOUT 2048 /* outstanding pNFS layout */ |
- | 97 | struct inode; |
|
97 | #endif /* _LINUX_FS_H */><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><> |
98 | #endif /* _LINUX_FS_H */><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><> |