diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-04 11:15:33 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-04 11:15:33 -0500 |
| commit | 0f2cc4ecd81dc1917a041dc93db0ada28f8356fa (patch) | |
| tree | f128b50f48f50f0cda6d2b20b53e9ad6e2dfded3 /include | |
| parent | 1fae4cfb97302289bb5df6a8195eb28385d0b002 (diff) | |
| parent | 9643f5d94aadd47a5fa9754fb60f2c957de05903 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (52 commits)
init: Open /dev/console from rootfs
mqueue: fix typo "failues" -> "failures"
mqueue: only set error codes if they are really necessary
mqueue: simplify do_open() error handling
mqueue: apply mathematics distributivity on mq_bytes calculation
mqueue: remove unneeded info->messages initialization
mqueue: fix mq_open() file descriptor leak on user-space processes
fix race in d_splice_alias()
set S_DEAD on unlink() and non-directory rename() victims
vfs: add NOFOLLOW flag to umount(2)
get rid of ->mnt_parent in tomoyo/realpath
hppfs can use existing proc_mnt, no need for do_kern_mount() in there
Mirror MS_KERNMOUNT in ->mnt_flags
get rid of useless vfsmount_lock use in put_mnt_ns()
Take vfsmount_lock to fs/internal.h
get rid of insanity with namespace roots in tomoyo
take check for new events in namespace (guts of mounts_poll()) to namespace.c
Don't mess with generic_permission() under ->d_lock in hpfs
sanitize const/signedness for udf
nilfs: sanitize const/signedness in dealing with ->d_name.name
...
Fix up fairly trivial (famous last words...) conflicts in
drivers/infiniband/core/uverbs_main.c and security/tomoyo/realpath.c
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/audit.h | 11 | ||||
| -rw-r--r-- | include/linux/fs.h | 26 | ||||
| -rw-r--r-- | include/linux/fsnotify.h | 11 | ||||
| -rw-r--r-- | include/linux/magic.h | 1 | ||||
| -rw-r--r-- | include/linux/mnt_namespace.h | 1 | ||||
| -rw-r--r-- | include/linux/mount.h | 14 |
6 files changed, 35 insertions, 29 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index 3c7a358241a7..f391d45c8aea 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -424,7 +424,7 @@ extern void audit_syscall_exit(int failed, long return_code); | |||
| 424 | extern void __audit_getname(const char *name); | 424 | extern void __audit_getname(const char *name); |
| 425 | extern void audit_putname(const char *name); | 425 | extern void audit_putname(const char *name); |
| 426 | extern void __audit_inode(const char *name, const struct dentry *dentry); | 426 | extern void __audit_inode(const char *name, const struct dentry *dentry); |
| 427 | extern void __audit_inode_child(const char *dname, const struct dentry *dentry, | 427 | extern void __audit_inode_child(const struct dentry *dentry, |
| 428 | const struct inode *parent); | 428 | const struct inode *parent); |
| 429 | extern void __audit_ptrace(struct task_struct *t); | 429 | extern void __audit_ptrace(struct task_struct *t); |
| 430 | 430 | ||
| @@ -442,11 +442,10 @@ static inline void audit_inode(const char *name, const struct dentry *dentry) { | |||
| 442 | if (unlikely(!audit_dummy_context())) | 442 | if (unlikely(!audit_dummy_context())) |
| 443 | __audit_inode(name, dentry); | 443 | __audit_inode(name, dentry); |
| 444 | } | 444 | } |
| 445 | static inline void audit_inode_child(const char *dname, | 445 | static inline void audit_inode_child(const struct dentry *dentry, |
| 446 | const struct dentry *dentry, | ||
| 447 | const struct inode *parent) { | 446 | const struct inode *parent) { |
| 448 | if (unlikely(!audit_dummy_context())) | 447 | if (unlikely(!audit_dummy_context())) |
| 449 | __audit_inode_child(dname, dentry, parent); | 448 | __audit_inode_child(dentry, parent); |
| 450 | } | 449 | } |
| 451 | void audit_core_dumps(long signr); | 450 | void audit_core_dumps(long signr); |
| 452 | 451 | ||
| @@ -544,9 +543,9 @@ extern int audit_signals; | |||
| 544 | #define audit_getname(n) do { ; } while (0) | 543 | #define audit_getname(n) do { ; } while (0) |
| 545 | #define audit_putname(n) do { ; } while (0) | 544 | #define audit_putname(n) do { ; } while (0) |
| 546 | #define __audit_inode(n,d) do { ; } while (0) | 545 | #define __audit_inode(n,d) do { ; } while (0) |
| 547 | #define __audit_inode_child(d,i,p) do { ; } while (0) | 546 | #define __audit_inode_child(i,p) do { ; } while (0) |
| 548 | #define audit_inode(n,d) do { ; } while (0) | 547 | #define audit_inode(n,d) do { ; } while (0) |
| 549 | #define audit_inode_child(d,i,p) do { ; } while (0) | 548 | #define audit_inode_child(i,p) do { ; } while (0) |
| 550 | #define audit_core_dumps(i) do { ; } while (0) | 549 | #define audit_core_dumps(i) do { ; } while (0) |
| 551 | #define auditsc_get_stamp(c,t,s) (0) | 550 | #define auditsc_get_stamp(c,t,s) (0) |
| 552 | #define audit_get_loginuid(t) (-1) | 551 | #define audit_get_loginuid(t) (-1) |
diff --git a/include/linux/fs.h b/include/linux/fs.h index ebb1cd5bc241..5b3182c7eb5f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -1305,6 +1305,8 @@ extern int send_sigurg(struct fown_struct *fown); | |||
| 1305 | #define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */ | 1305 | #define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */ |
| 1306 | #define MNT_DETACH 0x00000002 /* Just detach from the tree */ | 1306 | #define MNT_DETACH 0x00000002 /* Just detach from the tree */ |
| 1307 | #define MNT_EXPIRE 0x00000004 /* Mark for expiry */ | 1307 | #define MNT_EXPIRE 0x00000004 /* Mark for expiry */ |
| 1308 | #define UMOUNT_NOFOLLOW 0x00000008 /* Don't follow symlink on umount */ | ||
| 1309 | #define UMOUNT_UNUSED 0x80000000 /* Flag guaranteed to be unused */ | ||
| 1308 | 1310 | ||
| 1309 | extern struct list_head super_blocks; | 1311 | extern struct list_head super_blocks; |
| 1310 | extern spinlock_t sb_lock; | 1312 | extern spinlock_t sb_lock; |
| @@ -1314,9 +1316,9 @@ extern spinlock_t sb_lock; | |||
| 1314 | struct super_block { | 1316 | struct super_block { |
| 1315 | struct list_head s_list; /* Keep this first */ | 1317 | struct list_head s_list; /* Keep this first */ |
| 1316 | dev_t s_dev; /* search index; _not_ kdev_t */ | 1318 | dev_t s_dev; /* search index; _not_ kdev_t */ |
| 1317 | unsigned long s_blocksize; | ||
| 1318 | unsigned char s_blocksize_bits; | ||
| 1319 | unsigned char s_dirt; | 1319 | unsigned char s_dirt; |
| 1320 | unsigned char s_blocksize_bits; | ||
| 1321 | unsigned long s_blocksize; | ||
| 1320 | loff_t s_maxbytes; /* Max file size */ | 1322 | loff_t s_maxbytes; /* Max file size */ |
| 1321 | struct file_system_type *s_type; | 1323 | struct file_system_type *s_type; |
| 1322 | const struct super_operations *s_op; | 1324 | const struct super_operations *s_op; |
| @@ -1357,16 +1359,16 @@ struct super_block { | |||
| 1357 | void *s_fs_info; /* Filesystem private info */ | 1359 | void *s_fs_info; /* Filesystem private info */ |
| 1358 | fmode_t s_mode; | 1360 | fmode_t s_mode; |
| 1359 | 1361 | ||
| 1362 | /* Granularity of c/m/atime in ns. | ||
| 1363 | Cannot be worse than a second */ | ||
| 1364 | u32 s_time_gran; | ||
| 1365 | |||
| 1360 | /* | 1366 | /* |
| 1361 | * The next field is for VFS *only*. No filesystems have any business | 1367 | * The next field is for VFS *only*. No filesystems have any business |
| 1362 | * even looking at it. You had been warned. | 1368 | * even looking at it. You had been warned. |
| 1363 | */ | 1369 | */ |
| 1364 | struct mutex s_vfs_rename_mutex; /* Kludge */ | 1370 | struct mutex s_vfs_rename_mutex; /* Kludge */ |
| 1365 | 1371 | ||
| 1366 | /* Granularity of c/m/atime in ns. | ||
| 1367 | Cannot be worse than a second */ | ||
| 1368 | u32 s_time_gran; | ||
| 1369 | |||
| 1370 | /* | 1372 | /* |
| 1371 | * Filesystem subtype. If non-empty the filesystem type field | 1373 | * Filesystem subtype. If non-empty the filesystem type field |
| 1372 | * in /proc/mounts will be "type.subtype" | 1374 | * in /proc/mounts will be "type.subtype" |
| @@ -1794,7 +1796,8 @@ extern int may_umount(struct vfsmount *); | |||
| 1794 | extern long do_mount(char *, char *, char *, unsigned long, void *); | 1796 | extern long do_mount(char *, char *, char *, unsigned long, void *); |
| 1795 | extern struct vfsmount *collect_mounts(struct path *); | 1797 | extern struct vfsmount *collect_mounts(struct path *); |
| 1796 | extern void drop_collected_mounts(struct vfsmount *); | 1798 | extern void drop_collected_mounts(struct vfsmount *); |
| 1797 | 1799 | extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, | |
| 1800 | struct vfsmount *); | ||
| 1798 | extern int vfs_statfs(struct dentry *, struct kstatfs *); | 1801 | extern int vfs_statfs(struct dentry *, struct kstatfs *); |
| 1799 | 1802 | ||
| 1800 | extern int current_umask(void); | 1803 | extern int current_umask(void); |
| @@ -2058,12 +2061,6 @@ extern int invalidate_inodes(struct super_block *); | |||
| 2058 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 2061 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
| 2059 | pgoff_t start, pgoff_t end); | 2062 | pgoff_t start, pgoff_t end); |
| 2060 | 2063 | ||
| 2061 | static inline unsigned long __deprecated | ||
| 2062 | invalidate_inode_pages(struct address_space *mapping) | ||
| 2063 | { | ||
| 2064 | return invalidate_mapping_pages(mapping, 0, ~0UL); | ||
| 2065 | } | ||
| 2066 | |||
| 2067 | static inline void invalidate_remote_inode(struct inode *inode) | 2064 | static inline void invalidate_remote_inode(struct inode *inode) |
| 2068 | { | 2065 | { |
| 2069 | if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || | 2066 | if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || |
| @@ -2132,6 +2129,7 @@ extern struct file * open_exec(const char *); | |||
| 2132 | 2129 | ||
| 2133 | /* fs/dcache.c -- generic fs support functions */ | 2130 | /* fs/dcache.c -- generic fs support functions */ |
| 2134 | extern int is_subdir(struct dentry *, struct dentry *); | 2131 | extern int is_subdir(struct dentry *, struct dentry *); |
| 2132 | extern int path_is_under(struct path *, struct path *); | ||
| 2135 | extern ino_t find_inode_number(struct dentry *, struct qstr *); | 2133 | extern ino_t find_inode_number(struct dentry *, struct qstr *); |
| 2136 | 2134 | ||
| 2137 | #include <linux/err.h> | 2135 | #include <linux/err.h> |
| @@ -2340,8 +2338,6 @@ extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct | |||
| 2340 | extern int simple_sync_file(struct file *, struct dentry *, int); | 2338 | extern int simple_sync_file(struct file *, struct dentry *, int); |
| 2341 | extern int simple_empty(struct dentry *); | 2339 | extern int simple_empty(struct dentry *); |
| 2342 | extern int simple_readpage(struct file *file, struct page *page); | 2340 | extern int simple_readpage(struct file *file, struct page *page); |
| 2343 | extern int simple_prepare_write(struct file *file, struct page *page, | ||
| 2344 | unsigned offset, unsigned to); | ||
| 2345 | extern int simple_write_begin(struct file *file, struct address_space *mapping, | 2341 | extern int simple_write_begin(struct file *file, struct address_space *mapping, |
| 2346 | loff_t pos, unsigned len, unsigned flags, | 2342 | loff_t pos, unsigned len, unsigned flags, |
| 2347 | struct page **pagep, void **fsdata); | 2343 | struct page **pagep, void **fsdata); |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 936f9aa8bb97..df8fd9a3b214 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
| @@ -65,7 +65,7 @@ static inline void fsnotify_link_count(struct inode *inode) | |||
| 65 | * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir | 65 | * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir |
| 66 | */ | 66 | */ |
| 67 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | 67 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, |
| 68 | const char *old_name, const char *new_name, | 68 | const char *old_name, |
| 69 | int isdir, struct inode *target, struct dentry *moved) | 69 | int isdir, struct inode *target, struct dentry *moved) |
| 70 | { | 70 | { |
| 71 | struct inode *source = moved->d_inode; | 71 | struct inode *source = moved->d_inode; |
| @@ -73,6 +73,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
| 73 | u32 fs_cookie = fsnotify_get_cookie(); | 73 | u32 fs_cookie = fsnotify_get_cookie(); |
| 74 | __u32 old_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_FROM); | 74 | __u32 old_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_FROM); |
| 75 | __u32 new_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_TO); | 75 | __u32 new_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_TO); |
| 76 | const char *new_name = moved->d_name.name; | ||
| 76 | 77 | ||
| 77 | if (old_dir == new_dir) | 78 | if (old_dir == new_dir) |
| 78 | old_dir_mask |= FS_DN_RENAME; | 79 | old_dir_mask |= FS_DN_RENAME; |
| @@ -103,7 +104,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
| 103 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); | 104 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); |
| 104 | fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 105 | fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE, NULL, 0); |
| 105 | } | 106 | } |
| 106 | audit_inode_child(new_name, moved, new_dir); | 107 | audit_inode_child(moved, new_dir); |
| 107 | } | 108 | } |
| 108 | 109 | ||
| 109 | /* | 110 | /* |
| @@ -146,7 +147,7 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) | |||
| 146 | { | 147 | { |
| 147 | inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name, | 148 | inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name, |
| 148 | dentry->d_inode); | 149 | dentry->d_inode); |
| 149 | audit_inode_child(dentry->d_name.name, dentry, inode); | 150 | audit_inode_child(dentry, inode); |
| 150 | 151 | ||
| 151 | fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); | 152 | fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); |
| 152 | } | 153 | } |
| @@ -161,7 +162,7 @@ static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct | |||
| 161 | inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name, | 162 | inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name, |
| 162 | inode); | 163 | inode); |
| 163 | fsnotify_link_count(inode); | 164 | fsnotify_link_count(inode); |
| 164 | audit_inode_child(new_dentry->d_name.name, new_dentry, dir); | 165 | audit_inode_child(new_dentry, dir); |
| 165 | 166 | ||
| 166 | fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE, new_dentry->d_name.name, 0); | 167 | fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE, new_dentry->d_name.name, 0); |
| 167 | } | 168 | } |
| @@ -175,7 +176,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | |||
| 175 | struct inode *d_inode = dentry->d_inode; | 176 | struct inode *d_inode = dentry->d_inode; |
| 176 | 177 | ||
| 177 | inotify_inode_queue_event(inode, mask, 0, dentry->d_name.name, d_inode); | 178 | inotify_inode_queue_event(inode, mask, 0, dentry->d_name.name, d_inode); |
| 178 | audit_inode_child(dentry->d_name.name, dentry, inode); | 179 | audit_inode_child(dentry, inode); |
| 179 | 180 | ||
| 180 | fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); | 181 | fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); |
| 181 | } | 182 | } |
diff --git a/include/linux/magic.h b/include/linux/magic.h index 76285e01b39e..eb9800f05782 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
| @@ -52,7 +52,6 @@ | |||
| 52 | #define CGROUP_SUPER_MAGIC 0x27e0eb | 52 | #define CGROUP_SUPER_MAGIC 0x27e0eb |
| 53 | 53 | ||
| 54 | #define FUTEXFS_SUPER_MAGIC 0xBAD1DEA | 54 | #define FUTEXFS_SUPER_MAGIC 0xBAD1DEA |
| 55 | #define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA | ||
| 56 | 55 | ||
| 57 | #define STACK_END_MAGIC 0x57AC6E9D | 56 | #define STACK_END_MAGIC 0x57AC6E9D |
| 58 | 57 | ||
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h index d74785c2393a..0b89efc6f215 100644 --- a/include/linux/mnt_namespace.h +++ b/include/linux/mnt_namespace.h | |||
| @@ -35,6 +35,7 @@ static inline void get_mnt_ns(struct mnt_namespace *ns) | |||
| 35 | extern const struct seq_operations mounts_op; | 35 | extern const struct seq_operations mounts_op; |
| 36 | extern const struct seq_operations mountinfo_op; | 36 | extern const struct seq_operations mountinfo_op; |
| 37 | extern const struct seq_operations mountstats_op; | 37 | extern const struct seq_operations mountstats_op; |
| 38 | extern int mnt_had_events(struct proc_mounts *); | ||
| 38 | 39 | ||
| 39 | #endif | 40 | #endif |
| 40 | #endif | 41 | #endif |
diff --git a/include/linux/mount.h b/include/linux/mount.h index b5f43a34ef88..4bd05474d11d 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
| @@ -34,7 +34,18 @@ struct mnt_namespace; | |||
| 34 | 34 | ||
| 35 | #define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */ | 35 | #define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */ |
| 36 | #define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */ | 36 | #define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */ |
| 37 | #define MNT_PNODE_MASK 0x3000 /* propagation flag mask */ | 37 | /* |
| 38 | * MNT_SHARED_MASK is the set of flags that should be cleared when a | ||
| 39 | * mount becomes shared. Currently, this is only the flag that says a | ||
| 40 | * mount cannot be bind mounted, since this is how we create a mount | ||
| 41 | * that shares events with another mount. If you add a new MNT_* | ||
| 42 | * flag, consider how it interacts with shared mounts. | ||
| 43 | */ | ||
| 44 | #define MNT_SHARED_MASK (MNT_UNBINDABLE) | ||
| 45 | #define MNT_PROPAGATION_MASK (MNT_SHARED | MNT_UNBINDABLE) | ||
| 46 | |||
| 47 | |||
| 48 | #define MNT_INTERNAL 0x4000 | ||
| 38 | 49 | ||
| 39 | struct vfsmount { | 50 | struct vfsmount { |
| 40 | struct list_head mnt_hash; | 51 | struct list_head mnt_hash; |
| @@ -123,7 +134,6 @@ extern int do_add_mount(struct vfsmount *newmnt, struct path *path, | |||
| 123 | 134 | ||
| 124 | extern void mark_mounts_for_expiry(struct list_head *mounts); | 135 | extern void mark_mounts_for_expiry(struct list_head *mounts); |
| 125 | 136 | ||
| 126 | extern spinlock_t vfsmount_lock; | ||
| 127 | extern dev_t name_to_dev_t(char *name); | 137 | extern dev_t name_to_dev_t(char *name); |
| 128 | 138 | ||
| 129 | #endif /* _LINUX_MOUNT_H */ | 139 | #endif /* _LINUX_MOUNT_H */ |
