diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 01:34:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 01:34:18 -0500 |
commit | 9bc9ccd7db1c9f043f75380b5a5b94912046a60e (patch) | |
tree | dd0a1b3396ae9414f668b0110cc39d11268ad3ed /include/linux | |
parent | f0230294271f511b41797305b685365a9e569a09 (diff) | |
parent | bdd3536618443809d18868563eeafa63b9d29603 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro:
"All kinds of stuff this time around; some more notable parts:
- RCU'd vfsmounts handling
- new primitives for coredump handling
- files_lock is gone
- Bruce's delegations handling series
- exportfs fixes
plus misc stuff all over the place"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (101 commits)
ecryptfs: ->f_op is never NULL
locks: break delegations on any attribute modification
locks: break delegations on link
locks: break delegations on rename
locks: helper functions for delegation breaking
locks: break delegations on unlink
namei: minor vfs_unlink cleanup
locks: implement delegations
locks: introduce new FL_DELEG lock flag
vfs: take i_mutex on renamed file
vfs: rename I_MUTEX_QUOTA now that it's not used for quotas
vfs: don't use PARENT/CHILD lock classes for non-directories
vfs: pull ext4's double-i_mutex-locking into common code
exportfs: fix quadratic behavior in filehandle lookup
exportfs: better variable name
exportfs: move most of reconnect_path to helper function
exportfs: eliminate unused "noprogress" counter
exportfs: stop retrying once we race with rename/remove
exportfs: clear DISCONNECTED on all parents sooner
exportfs: more detailed comment for path_reconnect
...
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/anon_inodes.h | 3 | ||||
-rw-r--r-- | include/linux/binfmts.h | 3 | ||||
-rw-r--r-- | include/linux/compat.h | 2 | ||||
-rw-r--r-- | include/linux/coredump.h | 10 | ||||
-rw-r--r-- | include/linux/dcache.h | 104 | ||||
-rw-r--r-- | include/linux/elf.h | 6 | ||||
-rw-r--r-- | include/linux/elfcore.h | 7 | ||||
-rw-r--r-- | include/linux/fs.h | 106 | ||||
-rw-r--r-- | include/linux/lglock.h | 10 | ||||
-rw-r--r-- | include/linux/mount.h | 2 | ||||
-rw-r--r-- | include/linux/namei.h | 2 | ||||
-rw-r--r-- | include/linux/pid_namespace.h | 1 |
12 files changed, 185 insertions, 71 deletions
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h index cf573c22b81e..8013a45242fe 100644 --- a/include/linux/anon_inodes.h +++ b/include/linux/anon_inodes.h | |||
@@ -13,9 +13,6 @@ struct file_operations; | |||
13 | struct file *anon_inode_getfile(const char *name, | 13 | struct file *anon_inode_getfile(const char *name, |
14 | const struct file_operations *fops, | 14 | const struct file_operations *fops, |
15 | void *priv, int flags); | 15 | void *priv, int flags); |
16 | struct file *anon_inode_getfile_private(const char *name, | ||
17 | const struct file_operations *fops, | ||
18 | void *priv, int flags); | ||
19 | int anon_inode_getfd(const char *name, const struct file_operations *fops, | 16 | int anon_inode_getfd(const char *name, const struct file_operations *fops, |
20 | void *priv, int flags); | 17 | void *priv, int flags); |
21 | 18 | ||
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index e8112ae50531..790d3305a5a7 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -56,11 +56,12 @@ struct linux_binprm { | |||
56 | 56 | ||
57 | /* Function parameter for binfmt->coredump */ | 57 | /* Function parameter for binfmt->coredump */ |
58 | struct coredump_params { | 58 | struct coredump_params { |
59 | siginfo_t *siginfo; | 59 | const siginfo_t *siginfo; |
60 | struct pt_regs *regs; | 60 | struct pt_regs *regs; |
61 | struct file *file; | 61 | struct file *file; |
62 | unsigned long limit; | 62 | unsigned long limit; |
63 | unsigned long mm_flags; | 63 | unsigned long mm_flags; |
64 | loff_t written; | ||
64 | }; | 65 | }; |
65 | 66 | ||
66 | /* | 67 | /* |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 345da00a86e0..78cdf51ff5ba 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -362,7 +362,7 @@ long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask, | |||
362 | long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, | 362 | long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, |
363 | unsigned long bitmap_size); | 363 | unsigned long bitmap_size); |
364 | int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from); | 364 | int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from); |
365 | int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from); | 365 | int copy_siginfo_to_user32(struct compat_siginfo __user *to, const siginfo_t *from); |
366 | int get_compat_sigevent(struct sigevent *event, | 366 | int get_compat_sigevent(struct sigevent *event, |
367 | const struct compat_sigevent __user *u_event); | 367 | const struct compat_sigevent __user *u_event); |
368 | long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig, | 368 | long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig, |
diff --git a/include/linux/coredump.h b/include/linux/coredump.h index a98f1ca60407..d016a121a8c4 100644 --- a/include/linux/coredump.h +++ b/include/linux/coredump.h | |||
@@ -10,12 +10,14 @@ | |||
10 | * These are the only things you should do on a core-file: use only these | 10 | * These are the only things you should do on a core-file: use only these |
11 | * functions to write out all the necessary info. | 11 | * functions to write out all the necessary info. |
12 | */ | 12 | */ |
13 | extern int dump_write(struct file *file, const void *addr, int nr); | 13 | struct coredump_params; |
14 | extern int dump_seek(struct file *file, loff_t off); | 14 | extern int dump_skip(struct coredump_params *cprm, size_t nr); |
15 | extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr); | ||
16 | extern int dump_align(struct coredump_params *cprm, int align); | ||
15 | #ifdef CONFIG_COREDUMP | 17 | #ifdef CONFIG_COREDUMP |
16 | extern void do_coredump(siginfo_t *siginfo); | 18 | extern void do_coredump(const siginfo_t *siginfo); |
17 | #else | 19 | #else |
18 | static inline void do_coredump(siginfo_t *siginfo) {} | 20 | static inline void do_coredump(const siginfo_t *siginfo) {} |
19 | #endif | 21 | #endif |
20 | 22 | ||
21 | #endif /* _LINUX_COREDUMP_H */ | 23 | #endif /* _LINUX_COREDUMP_H */ |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 59066e0b4ff1..57e87e749a48 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -169,13 +169,13 @@ struct dentry_operations { | |||
169 | */ | 169 | */ |
170 | 170 | ||
171 | /* d_flags entries */ | 171 | /* d_flags entries */ |
172 | #define DCACHE_OP_HASH 0x0001 | 172 | #define DCACHE_OP_HASH 0x00000001 |
173 | #define DCACHE_OP_COMPARE 0x0002 | 173 | #define DCACHE_OP_COMPARE 0x00000002 |
174 | #define DCACHE_OP_REVALIDATE 0x0004 | 174 | #define DCACHE_OP_REVALIDATE 0x00000004 |
175 | #define DCACHE_OP_DELETE 0x0008 | 175 | #define DCACHE_OP_DELETE 0x00000008 |
176 | #define DCACHE_OP_PRUNE 0x0010 | 176 | #define DCACHE_OP_PRUNE 0x00000010 |
177 | 177 | ||
178 | #define DCACHE_DISCONNECTED 0x0020 | 178 | #define DCACHE_DISCONNECTED 0x00000020 |
179 | /* This dentry is possibly not currently connected to the dcache tree, in | 179 | /* This dentry is possibly not currently connected to the dcache tree, in |
180 | * which case its parent will either be itself, or will have this flag as | 180 | * which case its parent will either be itself, or will have this flag as |
181 | * well. nfsd will not use a dentry with this bit set, but will first | 181 | * well. nfsd will not use a dentry with this bit set, but will first |
@@ -186,30 +186,38 @@ struct dentry_operations { | |||
186 | * dentry into place and return that dentry rather than the passed one, | 186 | * dentry into place and return that dentry rather than the passed one, |
187 | * typically using d_splice_alias. */ | 187 | * typically using d_splice_alias. */ |
188 | 188 | ||
189 | #define DCACHE_REFERENCED 0x0040 /* Recently used, don't discard. */ | 189 | #define DCACHE_REFERENCED 0x00000040 /* Recently used, don't discard. */ |
190 | #define DCACHE_RCUACCESS 0x0080 /* Entry has ever been RCU-visible */ | 190 | #define DCACHE_RCUACCESS 0x00000080 /* Entry has ever been RCU-visible */ |
191 | 191 | ||
192 | #define DCACHE_CANT_MOUNT 0x0100 | 192 | #define DCACHE_CANT_MOUNT 0x00000100 |
193 | #define DCACHE_GENOCIDE 0x0200 | 193 | #define DCACHE_GENOCIDE 0x00000200 |
194 | #define DCACHE_SHRINK_LIST 0x0400 | 194 | #define DCACHE_SHRINK_LIST 0x00000400 |
195 | 195 | ||
196 | #define DCACHE_OP_WEAK_REVALIDATE 0x0800 | 196 | #define DCACHE_OP_WEAK_REVALIDATE 0x00000800 |
197 | 197 | ||
198 | #define DCACHE_NFSFS_RENAMED 0x1000 | 198 | #define DCACHE_NFSFS_RENAMED 0x00001000 |
199 | /* this dentry has been "silly renamed" and has to be deleted on the last | 199 | /* this dentry has been "silly renamed" and has to be deleted on the last |
200 | * dput() */ | 200 | * dput() */ |
201 | #define DCACHE_COOKIE 0x2000 /* For use by dcookie subsystem */ | 201 | #define DCACHE_COOKIE 0x00002000 /* For use by dcookie subsystem */ |
202 | #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x4000 | 202 | #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x00004000 |
203 | /* Parent inode is watched by some fsnotify listener */ | 203 | /* Parent inode is watched by some fsnotify listener */ |
204 | 204 | ||
205 | #define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ | 205 | #define DCACHE_DENTRY_KILLED 0x00008000 |
206 | #define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ | 206 | |
207 | #define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ | 207 | #define DCACHE_MOUNTED 0x00010000 /* is a mountpoint */ |
208 | #define DCACHE_NEED_AUTOMOUNT 0x00020000 /* handle automount on this dir */ | ||
209 | #define DCACHE_MANAGE_TRANSIT 0x00040000 /* manage transit from this dirent */ | ||
208 | #define DCACHE_MANAGED_DENTRY \ | 210 | #define DCACHE_MANAGED_DENTRY \ |
209 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) | 211 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) |
210 | 212 | ||
211 | #define DCACHE_LRU_LIST 0x80000 | 213 | #define DCACHE_LRU_LIST 0x00080000 |
212 | #define DCACHE_DENTRY_KILLED 0x100000 | 214 | |
215 | #define DCACHE_ENTRY_TYPE 0x00700000 | ||
216 | #define DCACHE_MISS_TYPE 0x00000000 /* Negative dentry */ | ||
217 | #define DCACHE_DIRECTORY_TYPE 0x00100000 /* Normal directory */ | ||
218 | #define DCACHE_AUTODIR_TYPE 0x00200000 /* Lookupless directory (presumed automount) */ | ||
219 | #define DCACHE_SYMLINK_TYPE 0x00300000 /* Symlink */ | ||
220 | #define DCACHE_FILE_TYPE 0x00400000 /* Other file type */ | ||
213 | 221 | ||
214 | extern seqlock_t rename_lock; | 222 | extern seqlock_t rename_lock; |
215 | 223 | ||
@@ -224,6 +232,7 @@ static inline int dname_external(const struct dentry *dentry) | |||
224 | extern void d_instantiate(struct dentry *, struct inode *); | 232 | extern void d_instantiate(struct dentry *, struct inode *); |
225 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); | 233 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); |
226 | extern struct dentry * d_materialise_unique(struct dentry *, struct inode *); | 234 | extern struct dentry * d_materialise_unique(struct dentry *, struct inode *); |
235 | extern int d_instantiate_no_diralias(struct dentry *, struct inode *); | ||
227 | extern void __d_drop(struct dentry *dentry); | 236 | extern void __d_drop(struct dentry *dentry); |
228 | extern void d_drop(struct dentry *dentry); | 237 | extern void d_drop(struct dentry *dentry); |
229 | extern void d_delete(struct dentry *); | 238 | extern void d_delete(struct dentry *); |
@@ -393,6 +402,61 @@ static inline bool d_mountpoint(const struct dentry *dentry) | |||
393 | return dentry->d_flags & DCACHE_MOUNTED; | 402 | return dentry->d_flags & DCACHE_MOUNTED; |
394 | } | 403 | } |
395 | 404 | ||
405 | /* | ||
406 | * Directory cache entry type accessor functions. | ||
407 | */ | ||
408 | static inline void __d_set_type(struct dentry *dentry, unsigned type) | ||
409 | { | ||
410 | dentry->d_flags = (dentry->d_flags & ~DCACHE_ENTRY_TYPE) | type; | ||
411 | } | ||
412 | |||
413 | static inline void __d_clear_type(struct dentry *dentry) | ||
414 | { | ||
415 | __d_set_type(dentry, DCACHE_MISS_TYPE); | ||
416 | } | ||
417 | |||
418 | static inline void d_set_type(struct dentry *dentry, unsigned type) | ||
419 | { | ||
420 | spin_lock(&dentry->d_lock); | ||
421 | __d_set_type(dentry, type); | ||
422 | spin_unlock(&dentry->d_lock); | ||
423 | } | ||
424 | |||
425 | static inline unsigned __d_entry_type(const struct dentry *dentry) | ||
426 | { | ||
427 | return dentry->d_flags & DCACHE_ENTRY_TYPE; | ||
428 | } | ||
429 | |||
430 | static inline bool d_is_directory(const struct dentry *dentry) | ||
431 | { | ||
432 | return __d_entry_type(dentry) == DCACHE_DIRECTORY_TYPE; | ||
433 | } | ||
434 | |||
435 | static inline bool d_is_autodir(const struct dentry *dentry) | ||
436 | { | ||
437 | return __d_entry_type(dentry) == DCACHE_AUTODIR_TYPE; | ||
438 | } | ||
439 | |||
440 | static inline bool d_is_symlink(const struct dentry *dentry) | ||
441 | { | ||
442 | return __d_entry_type(dentry) == DCACHE_SYMLINK_TYPE; | ||
443 | } | ||
444 | |||
445 | static inline bool d_is_file(const struct dentry *dentry) | ||
446 | { | ||
447 | return __d_entry_type(dentry) == DCACHE_FILE_TYPE; | ||
448 | } | ||
449 | |||
450 | static inline bool d_is_negative(const struct dentry *dentry) | ||
451 | { | ||
452 | return __d_entry_type(dentry) == DCACHE_MISS_TYPE; | ||
453 | } | ||
454 | |||
455 | static inline bool d_is_positive(const struct dentry *dentry) | ||
456 | { | ||
457 | return !d_is_negative(dentry); | ||
458 | } | ||
459 | |||
396 | extern int sysctl_vfs_cache_pressure; | 460 | extern int sysctl_vfs_cache_pressure; |
397 | 461 | ||
398 | static inline unsigned long vfs_pressure_ratio(unsigned long val) | 462 | static inline unsigned long vfs_pressure_ratio(unsigned long val) |
diff --git a/include/linux/elf.h b/include/linux/elf.h index 40a3c0e01b2b..67a5fa7830c4 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -39,13 +39,13 @@ extern Elf64_Dyn _DYNAMIC []; | |||
39 | 39 | ||
40 | /* Optional callbacks to write extra ELF notes. */ | 40 | /* Optional callbacks to write extra ELF notes. */ |
41 | struct file; | 41 | struct file; |
42 | struct coredump_params; | ||
42 | 43 | ||
43 | #ifndef ARCH_HAVE_EXTRA_ELF_NOTES | 44 | #ifndef ARCH_HAVE_EXTRA_ELF_NOTES |
44 | static inline int elf_coredump_extra_notes_size(void) { return 0; } | 45 | static inline int elf_coredump_extra_notes_size(void) { return 0; } |
45 | static inline int elf_coredump_extra_notes_write(struct file *file, | 46 | static inline int elf_coredump_extra_notes_write(struct coredump_params *cprm) { return 0; } |
46 | loff_t *foffset) { return 0; } | ||
47 | #else | 47 | #else |
48 | extern int elf_coredump_extra_notes_size(void); | 48 | extern int elf_coredump_extra_notes_size(void); |
49 | extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset); | 49 | extern int elf_coredump_extra_notes_write(struct coredump_params *cprm); |
50 | #endif | 50 | #endif |
51 | #endif /* _LINUX_ELF_H */ | 51 | #endif /* _LINUX_ELF_H */ |
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index cdd3d13efce7..698d51a0eea3 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h | |||
@@ -6,6 +6,8 @@ | |||
6 | #include <asm/elf.h> | 6 | #include <asm/elf.h> |
7 | #include <uapi/linux/elfcore.h> | 7 | #include <uapi/linux/elfcore.h> |
8 | 8 | ||
9 | struct coredump_params; | ||
10 | |||
9 | static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *regs) | 11 | static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *regs) |
10 | { | 12 | { |
11 | #ifdef ELF_CORE_COPY_REGS | 13 | #ifdef ELF_CORE_COPY_REGS |
@@ -63,10 +65,9 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse | |||
63 | */ | 65 | */ |
64 | extern Elf_Half elf_core_extra_phdrs(void); | 66 | extern Elf_Half elf_core_extra_phdrs(void); |
65 | extern int | 67 | extern int |
66 | elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size, | 68 | elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset); |
67 | unsigned long limit); | ||
68 | extern int | 69 | extern int |
69 | elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit); | 70 | elf_core_write_extra_data(struct coredump_params *cprm); |
70 | extern size_t elf_core_extra_data_size(void); | 71 | extern size_t elf_core_extra_data_size(void); |
71 | 72 | ||
72 | #endif /* _LINUX_ELFCORE_H */ | 73 | #endif /* _LINUX_ELFCORE_H */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 955dff5da56a..bf5d574ebdf4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -623,10 +623,13 @@ static inline int inode_unhashed(struct inode *inode) | |||
623 | * 0: the object of the current VFS operation | 623 | * 0: the object of the current VFS operation |
624 | * 1: parent | 624 | * 1: parent |
625 | * 2: child/target | 625 | * 2: child/target |
626 | * 3: quota file | 626 | * 3: xattr |
627 | * 4: second non-directory | ||
628 | * The last is for certain operations (such as rename) which lock two | ||
629 | * non-directories at once. | ||
627 | * | 630 | * |
628 | * The locking order between these classes is | 631 | * The locking order between these classes is |
629 | * parent -> child -> normal -> xattr -> quota | 632 | * parent -> child -> normal -> xattr -> second non-directory |
630 | */ | 633 | */ |
631 | enum inode_i_mutex_lock_class | 634 | enum inode_i_mutex_lock_class |
632 | { | 635 | { |
@@ -634,9 +637,12 @@ enum inode_i_mutex_lock_class | |||
634 | I_MUTEX_PARENT, | 637 | I_MUTEX_PARENT, |
635 | I_MUTEX_CHILD, | 638 | I_MUTEX_CHILD, |
636 | I_MUTEX_XATTR, | 639 | I_MUTEX_XATTR, |
637 | I_MUTEX_QUOTA | 640 | I_MUTEX_NONDIR2 |
638 | }; | 641 | }; |
639 | 642 | ||
643 | void lock_two_nondirectories(struct inode *, struct inode*); | ||
644 | void unlock_two_nondirectories(struct inode *, struct inode*); | ||
645 | |||
640 | /* | 646 | /* |
641 | * NOTE: in a 32bit arch with a preemptable kernel and | 647 | * NOTE: in a 32bit arch with a preemptable kernel and |
642 | * an UP compile the i_size_read/write must be atomic | 648 | * an UP compile the i_size_read/write must be atomic |
@@ -764,12 +770,7 @@ static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index) | |||
764 | #define FILE_MNT_WRITE_RELEASED 2 | 770 | #define FILE_MNT_WRITE_RELEASED 2 |
765 | 771 | ||
766 | struct file { | 772 | struct file { |
767 | /* | ||
768 | * fu_list becomes invalid after file_free is called and queued via | ||
769 | * fu_rcuhead for RCU freeing | ||
770 | */ | ||
771 | union { | 773 | union { |
772 | struct list_head fu_list; | ||
773 | struct llist_node fu_llist; | 774 | struct llist_node fu_llist; |
774 | struct rcu_head fu_rcuhead; | 775 | struct rcu_head fu_rcuhead; |
775 | } f_u; | 776 | } f_u; |
@@ -783,9 +784,6 @@ struct file { | |||
783 | * Must not be taken from IRQ context. | 784 | * Must not be taken from IRQ context. |
784 | */ | 785 | */ |
785 | spinlock_t f_lock; | 786 | spinlock_t f_lock; |
786 | #ifdef CONFIG_SMP | ||
787 | int f_sb_list_cpu; | ||
788 | #endif | ||
789 | atomic_long_t f_count; | 787 | atomic_long_t f_count; |
790 | unsigned int f_flags; | 788 | unsigned int f_flags; |
791 | fmode_t f_mode; | 789 | fmode_t f_mode; |
@@ -882,6 +880,7 @@ static inline int file_check_writeable(struct file *filp) | |||
882 | 880 | ||
883 | #define FL_POSIX 1 | 881 | #define FL_POSIX 1 |
884 | #define FL_FLOCK 2 | 882 | #define FL_FLOCK 2 |
883 | #define FL_DELEG 4 /* NFSv4 delegation */ | ||
885 | #define FL_ACCESS 8 /* not trying to lock, just looking */ | 884 | #define FL_ACCESS 8 /* not trying to lock, just looking */ |
886 | #define FL_EXISTS 16 /* when unlocking, test for existence */ | 885 | #define FL_EXISTS 16 /* when unlocking, test for existence */ |
887 | #define FL_LEASE 32 /* lease held on this file */ | 886 | #define FL_LEASE 32 /* lease held on this file */ |
@@ -1023,7 +1022,7 @@ extern int vfs_test_lock(struct file *, struct file_lock *); | |||
1023 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); | 1022 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); |
1024 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); | 1023 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); |
1025 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | 1024 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); |
1026 | extern int __break_lease(struct inode *inode, unsigned int flags); | 1025 | extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type); |
1027 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 1026 | extern void lease_get_mtime(struct inode *, struct timespec *time); |
1028 | extern int generic_setlease(struct file *, long, struct file_lock **); | 1027 | extern int generic_setlease(struct file *, long, struct file_lock **); |
1029 | extern int vfs_setlease(struct file *, long, struct file_lock **); | 1028 | extern int vfs_setlease(struct file *, long, struct file_lock **); |
@@ -1132,7 +1131,7 @@ static inline int flock_lock_file_wait(struct file *filp, | |||
1132 | return -ENOLCK; | 1131 | return -ENOLCK; |
1133 | } | 1132 | } |
1134 | 1133 | ||
1135 | static inline int __break_lease(struct inode *inode, unsigned int mode) | 1134 | static inline int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) |
1136 | { | 1135 | { |
1137 | return 0; | 1136 | return 0; |
1138 | } | 1137 | } |
@@ -1264,11 +1263,6 @@ struct super_block { | |||
1264 | 1263 | ||
1265 | struct list_head s_inodes; /* all inodes */ | 1264 | struct list_head s_inodes; /* all inodes */ |
1266 | struct hlist_bl_head s_anon; /* anonymous dentries for (nfs) exporting */ | 1265 | struct hlist_bl_head s_anon; /* anonymous dentries for (nfs) exporting */ |
1267 | #ifdef CONFIG_SMP | ||
1268 | struct list_head __percpu *s_files; | ||
1269 | #else | ||
1270 | struct list_head s_files; | ||
1271 | #endif | ||
1272 | struct list_head s_mounts; /* list of mounts; _not_ for fs use */ | 1266 | struct list_head s_mounts; /* list of mounts; _not_ for fs use */ |
1273 | struct block_device *s_bdev; | 1267 | struct block_device *s_bdev; |
1274 | struct backing_dev_info *s_bdi; | 1268 | struct backing_dev_info *s_bdi; |
@@ -1330,6 +1324,7 @@ struct super_block { | |||
1330 | */ | 1324 | */ |
1331 | struct list_lru s_dentry_lru ____cacheline_aligned_in_smp; | 1325 | struct list_lru s_dentry_lru ____cacheline_aligned_in_smp; |
1332 | struct list_lru s_inode_lru ____cacheline_aligned_in_smp; | 1326 | struct list_lru s_inode_lru ____cacheline_aligned_in_smp; |
1327 | struct rcu_head rcu; | ||
1333 | }; | 1328 | }; |
1334 | 1329 | ||
1335 | extern struct timespec current_fs_time(struct super_block *sb); | 1330 | extern struct timespec current_fs_time(struct super_block *sb); |
@@ -1458,10 +1453,10 @@ extern int vfs_create(struct inode *, struct dentry *, umode_t, bool); | |||
1458 | extern int vfs_mkdir(struct inode *, struct dentry *, umode_t); | 1453 | extern int vfs_mkdir(struct inode *, struct dentry *, umode_t); |
1459 | extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); | 1454 | extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); |
1460 | extern int vfs_symlink(struct inode *, struct dentry *, const char *); | 1455 | extern int vfs_symlink(struct inode *, struct dentry *, const char *); |
1461 | extern int vfs_link(struct dentry *, struct inode *, struct dentry *); | 1456 | extern int vfs_link(struct dentry *, struct inode *, struct dentry *, struct inode **); |
1462 | extern int vfs_rmdir(struct inode *, struct dentry *); | 1457 | extern int vfs_rmdir(struct inode *, struct dentry *); |
1463 | extern int vfs_unlink(struct inode *, struct dentry *); | 1458 | extern int vfs_unlink(struct inode *, struct dentry *, struct inode **); |
1464 | extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); | 1459 | extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *, struct inode **); |
1465 | 1460 | ||
1466 | /* | 1461 | /* |
1467 | * VFS dentry helper functions. | 1462 | * VFS dentry helper functions. |
@@ -1875,6 +1870,17 @@ extern struct dentry *mount_pseudo(struct file_system_type *, char *, | |||
1875 | (((fops) && try_module_get((fops)->owner) ? (fops) : NULL)) | 1870 | (((fops) && try_module_get((fops)->owner) ? (fops) : NULL)) |
1876 | #define fops_put(fops) \ | 1871 | #define fops_put(fops) \ |
1877 | do { if (fops) module_put((fops)->owner); } while(0) | 1872 | do { if (fops) module_put((fops)->owner); } while(0) |
1873 | /* | ||
1874 | * This one is to be used *ONLY* from ->open() instances. | ||
1875 | * fops must be non-NULL, pinned down *and* module dependencies | ||
1876 | * should be sufficient to pin the caller down as well. | ||
1877 | */ | ||
1878 | #define replace_fops(f, fops) \ | ||
1879 | do { \ | ||
1880 | struct file *__file = (f); \ | ||
1881 | fops_put(__file->f_op); \ | ||
1882 | BUG_ON(!(__file->f_op = (fops))); \ | ||
1883 | } while(0) | ||
1878 | 1884 | ||
1879 | extern int register_filesystem(struct file_system_type *); | 1885 | extern int register_filesystem(struct file_system_type *); |
1880 | extern int unregister_filesystem(struct file_system_type *); | 1886 | extern int unregister_filesystem(struct file_system_type *); |
@@ -1899,6 +1905,9 @@ extern bool fs_fully_visible(struct file_system_type *); | |||
1899 | 1905 | ||
1900 | extern int current_umask(void); | 1906 | extern int current_umask(void); |
1901 | 1907 | ||
1908 | extern void ihold(struct inode * inode); | ||
1909 | extern void iput(struct inode *); | ||
1910 | |||
1902 | /* /sys/fs */ | 1911 | /* /sys/fs */ |
1903 | extern struct kobject *fs_kobj; | 1912 | extern struct kobject *fs_kobj; |
1904 | 1913 | ||
@@ -1955,9 +1964,39 @@ static inline int locks_verify_truncate(struct inode *inode, | |||
1955 | static inline int break_lease(struct inode *inode, unsigned int mode) | 1964 | static inline int break_lease(struct inode *inode, unsigned int mode) |
1956 | { | 1965 | { |
1957 | if (inode->i_flock) | 1966 | if (inode->i_flock) |
1958 | return __break_lease(inode, mode); | 1967 | return __break_lease(inode, mode, FL_LEASE); |
1968 | return 0; | ||
1969 | } | ||
1970 | |||
1971 | static inline int break_deleg(struct inode *inode, unsigned int mode) | ||
1972 | { | ||
1973 | if (inode->i_flock) | ||
1974 | return __break_lease(inode, mode, FL_DELEG); | ||
1959 | return 0; | 1975 | return 0; |
1960 | } | 1976 | } |
1977 | |||
1978 | static inline int try_break_deleg(struct inode *inode, struct inode **delegated_inode) | ||
1979 | { | ||
1980 | int ret; | ||
1981 | |||
1982 | ret = break_deleg(inode, O_WRONLY|O_NONBLOCK); | ||
1983 | if (ret == -EWOULDBLOCK && delegated_inode) { | ||
1984 | *delegated_inode = inode; | ||
1985 | ihold(inode); | ||
1986 | } | ||
1987 | return ret; | ||
1988 | } | ||
1989 | |||
1990 | static inline int break_deleg_wait(struct inode **delegated_inode) | ||
1991 | { | ||
1992 | int ret; | ||
1993 | |||
1994 | ret = break_deleg(*delegated_inode, O_WRONLY); | ||
1995 | iput(*delegated_inode); | ||
1996 | *delegated_inode = NULL; | ||
1997 | return ret; | ||
1998 | } | ||
1999 | |||
1961 | #else /* !CONFIG_FILE_LOCKING */ | 2000 | #else /* !CONFIG_FILE_LOCKING */ |
1962 | static inline int locks_mandatory_locked(struct inode *inode) | 2001 | static inline int locks_mandatory_locked(struct inode *inode) |
1963 | { | 2002 | { |
@@ -1997,6 +2036,22 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1997 | return 0; | 2036 | return 0; |
1998 | } | 2037 | } |
1999 | 2038 | ||
2039 | static inline int break_deleg(struct inode *inode, unsigned int mode) | ||
2040 | { | ||
2041 | return 0; | ||
2042 | } | ||
2043 | |||
2044 | static inline int try_break_deleg(struct inode *inode, struct inode **delegated_inode) | ||
2045 | { | ||
2046 | return 0; | ||
2047 | } | ||
2048 | |||
2049 | static inline int break_deleg_wait(struct inode **delegated_inode) | ||
2050 | { | ||
2051 | BUG(); | ||
2052 | return 0; | ||
2053 | } | ||
2054 | |||
2000 | #endif /* CONFIG_FILE_LOCKING */ | 2055 | #endif /* CONFIG_FILE_LOCKING */ |
2001 | 2056 | ||
2002 | /* fs/open.c */ | 2057 | /* fs/open.c */ |
@@ -2223,7 +2278,7 @@ extern void emergency_remount(void); | |||
2223 | #ifdef CONFIG_BLOCK | 2278 | #ifdef CONFIG_BLOCK |
2224 | extern sector_t bmap(struct inode *, sector_t); | 2279 | extern sector_t bmap(struct inode *, sector_t); |
2225 | #endif | 2280 | #endif |
2226 | extern int notify_change(struct dentry *, struct iattr *); | 2281 | extern int notify_change(struct dentry *, struct iattr *, struct inode **); |
2227 | extern int inode_permission(struct inode *, int); | 2282 | extern int inode_permission(struct inode *, int); |
2228 | extern int generic_permission(struct inode *, int); | 2283 | extern int generic_permission(struct inode *, int); |
2229 | 2284 | ||
@@ -2337,8 +2392,6 @@ extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence); | |||
2337 | extern int inode_init_always(struct super_block *, struct inode *); | 2392 | extern int inode_init_always(struct super_block *, struct inode *); |
2338 | extern void inode_init_once(struct inode *); | 2393 | extern void inode_init_once(struct inode *); |
2339 | extern void address_space_init_once(struct address_space *mapping); | 2394 | extern void address_space_init_once(struct address_space *mapping); |
2340 | extern void ihold(struct inode * inode); | ||
2341 | extern void iput(struct inode *); | ||
2342 | extern struct inode * igrab(struct inode *); | 2395 | extern struct inode * igrab(struct inode *); |
2343 | extern ino_t iunique(struct super_block *, ino_t); | 2396 | extern ino_t iunique(struct super_block *, ino_t); |
2344 | extern int inode_needs_sync(struct inode *inode); | 2397 | extern int inode_needs_sync(struct inode *inode); |
@@ -2507,8 +2560,10 @@ extern int __page_symlink(struct inode *inode, const char *symname, int len, | |||
2507 | int nofs); | 2560 | int nofs); |
2508 | extern int page_symlink(struct inode *inode, const char *symname, int len); | 2561 | extern int page_symlink(struct inode *inode, const char *symname, int len); |
2509 | extern const struct inode_operations page_symlink_inode_operations; | 2562 | extern const struct inode_operations page_symlink_inode_operations; |
2563 | extern void kfree_put_link(struct dentry *, struct nameidata *, void *); | ||
2510 | extern int generic_readlink(struct dentry *, char __user *, int); | 2564 | extern int generic_readlink(struct dentry *, char __user *, int); |
2511 | extern void generic_fillattr(struct inode *, struct kstat *); | 2565 | extern void generic_fillattr(struct inode *, struct kstat *); |
2566 | int vfs_getattr_nosec(struct path *path, struct kstat *stat); | ||
2512 | extern int vfs_getattr(struct path *, struct kstat *); | 2567 | extern int vfs_getattr(struct path *, struct kstat *); |
2513 | void __inode_add_bytes(struct inode *inode, loff_t bytes); | 2568 | void __inode_add_bytes(struct inode *inode, loff_t bytes); |
2514 | void inode_add_bytes(struct inode *inode, loff_t bytes); | 2569 | void inode_add_bytes(struct inode *inode, loff_t bytes); |
@@ -2567,6 +2622,7 @@ extern int simple_write_begin(struct file *file, struct address_space *mapping, | |||
2567 | extern int simple_write_end(struct file *file, struct address_space *mapping, | 2622 | extern int simple_write_end(struct file *file, struct address_space *mapping, |
2568 | loff_t pos, unsigned len, unsigned copied, | 2623 | loff_t pos, unsigned len, unsigned copied, |
2569 | struct page *page, void *fsdata); | 2624 | struct page *page, void *fsdata); |
2625 | extern struct inode *alloc_anon_inode(struct super_block *); | ||
2570 | 2626 | ||
2571 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags); | 2627 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags); |
2572 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); | 2628 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); |
diff --git a/include/linux/lglock.h b/include/linux/lglock.h index 0d24e932db0b..96549abe8842 100644 --- a/include/linux/lglock.h +++ b/include/linux/lglock.h | |||
@@ -25,16 +25,6 @@ | |||
25 | #include <linux/cpu.h> | 25 | #include <linux/cpu.h> |
26 | #include <linux/notifier.h> | 26 | #include <linux/notifier.h> |
27 | 27 | ||
28 | /* can make br locks by using local lock for read side, global lock for write */ | ||
29 | #define br_lock_init(name) lg_lock_init(name, #name) | ||
30 | #define br_read_lock(name) lg_local_lock(name) | ||
31 | #define br_read_unlock(name) lg_local_unlock(name) | ||
32 | #define br_write_lock(name) lg_global_lock(name) | ||
33 | #define br_write_unlock(name) lg_global_unlock(name) | ||
34 | |||
35 | #define DEFINE_BRLOCK(name) DEFINE_LGLOCK(name) | ||
36 | #define DEFINE_STATIC_BRLOCK(name) DEFINE_STATIC_LGLOCK(name) | ||
37 | |||
38 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 28 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
39 | #define LOCKDEP_INIT_MAP lockdep_init_map | 29 | #define LOCKDEP_INIT_MAP lockdep_init_map |
40 | #else | 30 | #else |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 38cd98f112a0..371d346fa270 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -49,6 +49,8 @@ struct mnt_namespace; | |||
49 | 49 | ||
50 | #define MNT_LOCK_READONLY 0x400000 | 50 | #define MNT_LOCK_READONLY 0x400000 |
51 | #define MNT_LOCKED 0x800000 | 51 | #define MNT_LOCKED 0x800000 |
52 | #define MNT_DOOMED 0x1000000 | ||
53 | #define MNT_SYNC_UMOUNT 0x2000000 | ||
52 | 54 | ||
53 | struct vfsmount { | 55 | struct vfsmount { |
54 | struct dentry *mnt_root; /* root of the mounted tree */ | 56 | struct dentry *mnt_root; /* root of the mounted tree */ |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 8e47bc7a1665..492de72560fa 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -16,7 +16,7 @@ struct nameidata { | |||
16 | struct path root; | 16 | struct path root; |
17 | struct inode *inode; /* path.dentry.d_inode */ | 17 | struct inode *inode; /* path.dentry.d_inode */ |
18 | unsigned int flags; | 18 | unsigned int flags; |
19 | unsigned seq; | 19 | unsigned seq, m_seq; |
20 | int last_type; | 20 | int last_type; |
21 | unsigned depth; | 21 | unsigned depth; |
22 | char *saved_names[MAX_NESTED_LINKS + 1]; | 22 | char *saved_names[MAX_NESTED_LINKS + 1]; |
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index e2772666f004..7246ef3d4455 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
@@ -23,6 +23,7 @@ struct bsd_acct_struct; | |||
23 | struct pid_namespace { | 23 | struct pid_namespace { |
24 | struct kref kref; | 24 | struct kref kref; |
25 | struct pidmap pidmap[PIDMAP_ENTRIES]; | 25 | struct pidmap pidmap[PIDMAP_ENTRIES]; |
26 | struct rcu_head rcu; | ||
26 | int last_pid; | 27 | int last_pid; |
27 | unsigned int nr_hashed; | 28 | unsigned int nr_hashed; |
28 | struct task_struct *child_reaper; | 29 | struct task_struct *child_reaper; |