diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-22 15:51:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-22 15:51:21 -0400 |
commit | 052b398a43a7de8c68c13e7fa05d6b3d16ce6801 (patch) | |
tree | 8b7ee72d0617daf55083bc9cbc904ee22cb953db /fs/kernfs | |
parent | b953c0d234bc72e8489d3bf51a276c5c4ec85345 (diff) | |
parent | b853a16176cf3e02c57e215743015614152c2428 (diff) |
Merge branch 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro:
"In this pile: pathname resolution rewrite.
- recursion in link_path_walk() is gone.
- nesting limits on symlinks are gone (the only limit remaining is
that the total amount of symlinks is no more than 40, no matter how
nested).
- "fast" (inline) symlinks are handled without leaving rcuwalk mode.
- stack footprint (independent of the nesting) is below kilobyte now,
about on par with what it used to be with one level of nested
symlinks and ~2.8 times lower than it used to be in the worst case.
- struct nameidata is entirely private to fs/namei.c now (not even
opaque pointers are being passed around).
- ->follow_link() and ->put_link() calling conventions had been
changed; all in-tree filesystems converted, out-of-tree should be
able to follow reasonably easily.
For out-of-tree conversions, see Documentation/filesystems/porting
for details (and in-tree filesystems for examples of conversion).
That has sat in -next since mid-May, seems to survive all testing
without regressions and merges clean with v4.1"
* 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (131 commits)
turn user_{path_at,path,lpath,path_dir}() into static inlines
namei: move saved_nd pointer into struct nameidata
inline user_path_create()
inline user_path_parent()
namei: trim do_last() arguments
namei: stash dfd and name into nameidata
namei: fold path_cleanup() into terminate_walk()
namei: saner calling conventions for filename_parentat()
namei: saner calling conventions for filename_create()
namei: shift nameidata down into filename_parentat()
namei: make filename_lookup() reject ERR_PTR() passed as name
namei: shift nameidata inside filename_lookup()
namei: move putname() call into filename_lookup()
namei: pass the struct path to store the result down into path_lookupat()
namei: uninline set_root{,_rcu}()
namei: be careful with mountpoint crossings in follow_dotdot_rcu()
Documentation: remove outdated information from automount-support.txt
get rid of assorted nameidata-related debris
lustre: kill unused helper
lustre: kill unused macro (LOOKUP_CONTINUE)
...
Diffstat (limited to 'fs/kernfs')
-rw-r--r-- | fs/kernfs/symlink.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/fs/kernfs/symlink.c b/fs/kernfs/symlink.c index 8a198898e39a..db272528ab5b 100644 --- a/fs/kernfs/symlink.c +++ b/fs/kernfs/symlink.c | |||
@@ -112,25 +112,18 @@ static int kernfs_getlink(struct dentry *dentry, char *path) | |||
112 | return error; | 112 | return error; |
113 | } | 113 | } |
114 | 114 | ||
115 | static void *kernfs_iop_follow_link(struct dentry *dentry, struct nameidata *nd) | 115 | static const char *kernfs_iop_follow_link(struct dentry *dentry, void **cookie) |
116 | { | 116 | { |
117 | int error = -ENOMEM; | 117 | int error = -ENOMEM; |
118 | unsigned long page = get_zeroed_page(GFP_KERNEL); | 118 | unsigned long page = get_zeroed_page(GFP_KERNEL); |
119 | if (page) { | 119 | if (!page) |
120 | error = kernfs_getlink(dentry, (char *) page); | 120 | return ERR_PTR(-ENOMEM); |
121 | if (error < 0) | 121 | error = kernfs_getlink(dentry, (char *)page); |
122 | free_page((unsigned long)page); | 122 | if (unlikely(error < 0)) { |
123 | } | ||
124 | nd_set_link(nd, error ? ERR_PTR(error) : (char *)page); | ||
125 | return NULL; | ||
126 | } | ||
127 | |||
128 | static void kernfs_iop_put_link(struct dentry *dentry, struct nameidata *nd, | ||
129 | void *cookie) | ||
130 | { | ||
131 | char *page = nd_get_link(nd); | ||
132 | if (!IS_ERR(page)) | ||
133 | free_page((unsigned long)page); | 123 | free_page((unsigned long)page); |
124 | return ERR_PTR(error); | ||
125 | } | ||
126 | return *cookie = (char *)page; | ||
134 | } | 127 | } |
135 | 128 | ||
136 | const struct inode_operations kernfs_symlink_iops = { | 129 | const struct inode_operations kernfs_symlink_iops = { |
@@ -140,7 +133,7 @@ const struct inode_operations kernfs_symlink_iops = { | |||
140 | .listxattr = kernfs_iop_listxattr, | 133 | .listxattr = kernfs_iop_listxattr, |
141 | .readlink = generic_readlink, | 134 | .readlink = generic_readlink, |
142 | .follow_link = kernfs_iop_follow_link, | 135 | .follow_link = kernfs_iop_follow_link, |
143 | .put_link = kernfs_iop_put_link, | 136 | .put_link = free_page_put_link, |
144 | .setattr = kernfs_iop_setattr, | 137 | .setattr = kernfs_iop_setattr, |
145 | .getattr = kernfs_iop_getattr, | 138 | .getattr = kernfs_iop_getattr, |
146 | .permission = kernfs_iop_permission, | 139 | .permission = kernfs_iop_permission, |