aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-11-17 10:20:54 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-12-08 22:41:54 -0500
commit6b2553918d8b4e6de9853fd6315bec7271a2e592 (patch)
tree85540dcb0dc0de3d67c68d0aa7b17058f4e96539 /fs/xfs
parent21fc61c73c3903c4c312d0802da01ec2b323d174 (diff)
replace ->follow_link() with new method that could stay in RCU mode
new method: ->get_link(); replacement of ->follow_link(). The differences are: * inode and dentry are passed separately * might be called both in RCU and non-RCU mode; the former is indicated by passing it a NULL dentry. * when called that way it isn't allowed to block and should return ERR_PTR(-ECHILD) if it needs to be called in non-RCU mode. It's a flagday change - the old method is gone, all in-tree instances converted. Conversion isn't hard; said that, so far very few instances do not immediately bail out when called in RCU mode. That'll change in the next commits. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_iops.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index 245268a0cdf0..f638fd58b5b3 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -414,13 +414,17 @@ xfs_vn_rename(
414 * uio is kmalloced for this reason... 414 * uio is kmalloced for this reason...
415 */ 415 */
416STATIC const char * 416STATIC const char *
417xfs_vn_follow_link( 417xfs_vn_get_link(
418 struct dentry *dentry, 418 struct dentry *dentry,
419 struct inode *inode,
419 void **cookie) 420 void **cookie)
420{ 421{
421 char *link; 422 char *link;
422 int error = -ENOMEM; 423 int error = -ENOMEM;
423 424
425 if (!dentry)
426 return ERR_PTR(-ECHILD);
427
424 link = kmalloc(MAXPATHLEN+1, GFP_KERNEL); 428 link = kmalloc(MAXPATHLEN+1, GFP_KERNEL);
425 if (!link) 429 if (!link)
426 goto out_err; 430 goto out_err;
@@ -1172,7 +1176,7 @@ static const struct inode_operations xfs_dir_ci_inode_operations = {
1172 1176
1173static const struct inode_operations xfs_symlink_inode_operations = { 1177static const struct inode_operations xfs_symlink_inode_operations = {
1174 .readlink = generic_readlink, 1178 .readlink = generic_readlink,
1175 .follow_link = xfs_vn_follow_link, 1179 .get_link = xfs_vn_get_link,
1176 .put_link = kfree_put_link, 1180 .put_link = kfree_put_link,
1177 .getattr = xfs_vn_getattr, 1181 .getattr = xfs_vn_getattr,
1178 .setattr = xfs_vn_setattr, 1182 .setattr = xfs_vn_setattr,