diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-11-17 10:20:54 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-08 22:41:54 -0500 |
commit | 6b2553918d8b4e6de9853fd6315bec7271a2e592 (patch) | |
tree | 85540dcb0dc0de3d67c68d0aa7b17058f4e96539 /fs/fuse/dir.c | |
parent | 21fc61c73c3903c4c312d0802da01ec2b323d174 (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/fuse/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 5e2e08712d3b..148e8ef7c541 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -1365,14 +1365,17 @@ static int fuse_readdir(struct file *file, struct dir_context *ctx) | |||
1365 | return err; | 1365 | return err; |
1366 | } | 1366 | } |
1367 | 1367 | ||
1368 | static const char *fuse_follow_link(struct dentry *dentry, void **cookie) | 1368 | static const char *fuse_get_link(struct dentry *dentry, |
1369 | struct inode *inode, void **cookie) | ||
1369 | { | 1370 | { |
1370 | struct inode *inode = d_inode(dentry); | ||
1371 | struct fuse_conn *fc = get_fuse_conn(inode); | 1371 | struct fuse_conn *fc = get_fuse_conn(inode); |
1372 | FUSE_ARGS(args); | 1372 | FUSE_ARGS(args); |
1373 | char *link; | 1373 | char *link; |
1374 | ssize_t ret; | 1374 | ssize_t ret; |
1375 | 1375 | ||
1376 | if (!dentry) | ||
1377 | return ERR_PTR(-ECHILD); | ||
1378 | |||
1376 | link = (char *) __get_free_page(GFP_KERNEL); | 1379 | link = (char *) __get_free_page(GFP_KERNEL); |
1377 | if (!link) | 1380 | if (!link) |
1378 | return ERR_PTR(-ENOMEM); | 1381 | return ERR_PTR(-ENOMEM); |
@@ -1909,7 +1912,7 @@ static const struct inode_operations fuse_common_inode_operations = { | |||
1909 | 1912 | ||
1910 | static const struct inode_operations fuse_symlink_inode_operations = { | 1913 | static const struct inode_operations fuse_symlink_inode_operations = { |
1911 | .setattr = fuse_setattr, | 1914 | .setattr = fuse_setattr, |
1912 | .follow_link = fuse_follow_link, | 1915 | .get_link = fuse_get_link, |
1913 | .put_link = free_page_put_link, | 1916 | .put_link = free_page_put_link, |
1914 | .readlink = generic_readlink, | 1917 | .readlink = generic_readlink, |
1915 | .getattr = fuse_getattr, | 1918 | .getattr = fuse_getattr, |