diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-26 14:19:18 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-26 14:19:18 -0400 |
| commit | d1e14f1d63eb15ebe97d1a8544ddc143486b0204 (patch) | |
| tree | a73e7c751f23835483f1e8029d04547192611975 /include | |
| parent | 2cc91884b6b3f7328680b8ea7563016d3aee3d19 (diff) | |
| parent | db6ec212b53abc29a5bb6ac8c810010fc28d5191 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro:
"overlayfs merge + leak fix for d_splice_alias() failure exits"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
overlayfs: embed middle into overlay_readdir_data
overlayfs: embed root into overlay_readdir_data
overlayfs: make ovl_cache_entry->name an array instead of pointer
overlayfs: don't hold ->i_mutex over opening the real directory
fix inode leaks on d_splice_alias() failure exits
fs: limit filesystem stacking depth
overlay: overlay filesystem documentation
overlayfs: implement show_options
overlayfs: add statfs support
overlay filesystem
shmem: support RENAME_WHITEOUT
ext4: support RENAME_WHITEOUT
vfs: add RENAME_WHITEOUT
vfs: add whiteout support
vfs: export check_sticky()
vfs: introduce clone_private_mount()
vfs: export __inode_permission() to modules
vfs: export do_splice_direct() to modules
vfs: add i_op->dentry_open()
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/fs.h | 39 | ||||
| -rw-r--r-- | include/linux/mount.h | 3 | ||||
| -rw-r--r-- | include/uapi/linux/fs.h | 1 |
3 files changed, 43 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index a957d4366c24..4e41a4a331bb 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -223,6 +223,13 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | |||
| 223 | #define ATTR_TIMES_SET (1 << 16) | 223 | #define ATTR_TIMES_SET (1 << 16) |
| 224 | 224 | ||
| 225 | /* | 225 | /* |
| 226 | * Whiteout is represented by a char device. The following constants define the | ||
| 227 | * mode and device number to use. | ||
| 228 | */ | ||
| 229 | #define WHITEOUT_MODE 0 | ||
| 230 | #define WHITEOUT_DEV 0 | ||
| 231 | |||
| 232 | /* | ||
| 226 | * This is the Inode Attributes structure, used for notify_change(). It | 233 | * This is the Inode Attributes structure, used for notify_change(). It |
| 227 | * uses the above definitions as flags, to know which values have changed. | 234 | * uses the above definitions as flags, to know which values have changed. |
| 228 | * Also, in this manner, a Filesystem can look at only the values it cares | 235 | * Also, in this manner, a Filesystem can look at only the values it cares |
| @@ -254,6 +261,12 @@ struct iattr { | |||
| 254 | */ | 261 | */ |
| 255 | #include <linux/quota.h> | 262 | #include <linux/quota.h> |
| 256 | 263 | ||
| 264 | /* | ||
| 265 | * Maximum number of layers of fs stack. Needs to be limited to | ||
| 266 | * prevent kernel stack overflow | ||
| 267 | */ | ||
| 268 | #define FILESYSTEM_MAX_STACK_DEPTH 2 | ||
| 269 | |||
| 257 | /** | 270 | /** |
| 258 | * enum positive_aop_returns - aop return codes with specific semantics | 271 | * enum positive_aop_returns - aop return codes with specific semantics |
| 259 | * | 272 | * |
| @@ -1266,6 +1279,11 @@ struct super_block { | |||
| 1266 | struct list_lru s_dentry_lru ____cacheline_aligned_in_smp; | 1279 | struct list_lru s_dentry_lru ____cacheline_aligned_in_smp; |
| 1267 | struct list_lru s_inode_lru ____cacheline_aligned_in_smp; | 1280 | struct list_lru s_inode_lru ____cacheline_aligned_in_smp; |
| 1268 | struct rcu_head rcu; | 1281 | struct rcu_head rcu; |
| 1282 | |||
| 1283 | /* | ||
| 1284 | * Indicates how deep in a filesystem stack this SB is | ||
| 1285 | */ | ||
| 1286 | int s_stack_depth; | ||
| 1269 | }; | 1287 | }; |
| 1270 | 1288 | ||
| 1271 | extern struct timespec current_fs_time(struct super_block *sb); | 1289 | extern struct timespec current_fs_time(struct super_block *sb); |
| @@ -1398,6 +1416,7 @@ extern int vfs_link(struct dentry *, struct inode *, struct dentry *, struct ino | |||
| 1398 | extern int vfs_rmdir(struct inode *, struct dentry *); | 1416 | extern int vfs_rmdir(struct inode *, struct dentry *); |
| 1399 | extern int vfs_unlink(struct inode *, struct dentry *, struct inode **); | 1417 | extern int vfs_unlink(struct inode *, struct dentry *, struct inode **); |
| 1400 | extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *, struct inode **, unsigned int); | 1418 | extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *, struct inode **, unsigned int); |
| 1419 | extern int vfs_whiteout(struct inode *, struct dentry *); | ||
| 1401 | 1420 | ||
| 1402 | /* | 1421 | /* |
| 1403 | * VFS dentry helper functions. | 1422 | * VFS dentry helper functions. |
| @@ -1528,6 +1547,9 @@ struct inode_operations { | |||
| 1528 | umode_t create_mode, int *opened); | 1547 | umode_t create_mode, int *opened); |
| 1529 | int (*tmpfile) (struct inode *, struct dentry *, umode_t); | 1548 | int (*tmpfile) (struct inode *, struct dentry *, umode_t); |
| 1530 | int (*set_acl)(struct inode *, struct posix_acl *, int); | 1549 | int (*set_acl)(struct inode *, struct posix_acl *, int); |
| 1550 | |||
| 1551 | /* WARNING: probably going away soon, do not use! */ | ||
| 1552 | int (*dentry_open)(struct dentry *, struct file *, const struct cred *); | ||
| 1531 | } ____cacheline_aligned; | 1553 | } ____cacheline_aligned; |
| 1532 | 1554 | ||
| 1533 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, | 1555 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, |
| @@ -1625,6 +1647,9 @@ struct super_operations { | |||
| 1625 | #define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT) | 1647 | #define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT) |
| 1626 | #define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC) | 1648 | #define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC) |
| 1627 | 1649 | ||
| 1650 | #define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \ | ||
| 1651 | (inode)->i_rdev == WHITEOUT_DEV) | ||
| 1652 | |||
| 1628 | /* | 1653 | /* |
| 1629 | * Inode state bits. Protected by inode->i_lock | 1654 | * Inode state bits. Protected by inode->i_lock |
| 1630 | * | 1655 | * |
| @@ -2040,6 +2065,7 @@ extern struct file *file_open_name(struct filename *, int, umode_t); | |||
| 2040 | extern struct file *filp_open(const char *, int, umode_t); | 2065 | extern struct file *filp_open(const char *, int, umode_t); |
| 2041 | extern struct file *file_open_root(struct dentry *, struct vfsmount *, | 2066 | extern struct file *file_open_root(struct dentry *, struct vfsmount *, |
| 2042 | const char *, int); | 2067 | const char *, int); |
| 2068 | extern int vfs_open(const struct path *, struct file *, const struct cred *); | ||
| 2043 | extern struct file * dentry_open(const struct path *, int, const struct cred *); | 2069 | extern struct file * dentry_open(const struct path *, int, const struct cred *); |
| 2044 | extern int filp_close(struct file *, fl_owner_t id); | 2070 | extern int filp_close(struct file *, fl_owner_t id); |
| 2045 | 2071 | ||
| @@ -2253,7 +2279,9 @@ extern sector_t bmap(struct inode *, sector_t); | |||
| 2253 | #endif | 2279 | #endif |
| 2254 | extern int notify_change(struct dentry *, struct iattr *, struct inode **); | 2280 | extern int notify_change(struct dentry *, struct iattr *, struct inode **); |
| 2255 | extern int inode_permission(struct inode *, int); | 2281 | extern int inode_permission(struct inode *, int); |
| 2282 | extern int __inode_permission(struct inode *, int); | ||
| 2256 | extern int generic_permission(struct inode *, int); | 2283 | extern int generic_permission(struct inode *, int); |
| 2284 | extern int __check_sticky(struct inode *dir, struct inode *inode); | ||
| 2257 | 2285 | ||
| 2258 | static inline bool execute_ok(struct inode *inode) | 2286 | static inline bool execute_ok(struct inode *inode) |
| 2259 | { | 2287 | { |
| @@ -2452,6 +2480,9 @@ extern ssize_t iter_file_splice_write(struct pipe_inode_info *, | |||
| 2452 | struct file *, loff_t *, size_t, unsigned int); | 2480 | struct file *, loff_t *, size_t, unsigned int); |
| 2453 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, | 2481 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, |
| 2454 | struct file *out, loff_t *, size_t len, unsigned int flags); | 2482 | struct file *out, loff_t *, size_t len, unsigned int flags); |
| 2483 | extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, | ||
| 2484 | loff_t *opos, size_t len, unsigned int flags); | ||
| 2485 | |||
| 2455 | 2486 | ||
| 2456 | extern void | 2487 | extern void |
| 2457 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | 2488 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); |
| @@ -2737,6 +2768,14 @@ static inline int is_sxid(umode_t mode) | |||
| 2737 | return (mode & S_ISUID) || ((mode & S_ISGID) && (mode & S_IXGRP)); | 2768 | return (mode & S_ISUID) || ((mode & S_ISGID) && (mode & S_IXGRP)); |
| 2738 | } | 2769 | } |
| 2739 | 2770 | ||
| 2771 | static inline int check_sticky(struct inode *dir, struct inode *inode) | ||
| 2772 | { | ||
| 2773 | if (!(dir->i_mode & S_ISVTX)) | ||
| 2774 | return 0; | ||
| 2775 | |||
| 2776 | return __check_sticky(dir, inode); | ||
| 2777 | } | ||
| 2778 | |||
| 2740 | static inline void inode_has_no_xattr(struct inode *inode) | 2779 | static inline void inode_has_no_xattr(struct inode *inode) |
| 2741 | { | 2780 | { |
| 2742 | if (!is_sxid(inode->i_mode) && (inode->i_sb->s_flags & MS_NOSEC)) | 2781 | if (!is_sxid(inode->i_mode) && (inode->i_sb->s_flags & MS_NOSEC)) |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 9262e4bf0cc3..c2c561dc0114 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
| @@ -81,6 +81,9 @@ extern struct vfsmount *mntget(struct vfsmount *mnt); | |||
| 81 | extern struct vfsmount *mnt_clone_internal(struct path *path); | 81 | extern struct vfsmount *mnt_clone_internal(struct path *path); |
| 82 | extern int __mnt_is_readonly(struct vfsmount *mnt); | 82 | extern int __mnt_is_readonly(struct vfsmount *mnt); |
| 83 | 83 | ||
| 84 | struct path; | ||
| 85 | extern struct vfsmount *clone_private_mount(struct path *path); | ||
| 86 | |||
| 84 | struct file_system_type; | 87 | struct file_system_type; |
| 85 | extern struct vfsmount *vfs_kern_mount(struct file_system_type *type, | 88 | extern struct vfsmount *vfs_kern_mount(struct file_system_type *type, |
| 86 | int flags, const char *name, | 89 | int flags, const char *name, |
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index ca1a11bb4443..3735fa0a6784 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | 37 | ||
| 38 | #define RENAME_NOREPLACE (1 << 0) /* Don't overwrite target */ | 38 | #define RENAME_NOREPLACE (1 << 0) /* Don't overwrite target */ |
| 39 | #define RENAME_EXCHANGE (1 << 1) /* Exchange source and dest */ | 39 | #define RENAME_EXCHANGE (1 << 1) /* Exchange source and dest */ |
| 40 | #define RENAME_WHITEOUT (1 << 2) /* Whiteout source */ | ||
| 40 | 41 | ||
| 41 | struct fstrim_range { | 42 | struct fstrim_range { |
| 42 | __u64 start; | 43 | __u64 start; |
