diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-17 22:16:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-17 22:16:12 -0500 |
commit | 231753ef780012eb6f3922c3dfc0a7186baa33c2 (patch) | |
tree | c580186402ac9c5d7392ba4516dd3c88588807ba /fs/nfsd/vfs.c | |
parent | 0110c350c86d511be2130cb2a30dcbb76c4af750 (diff) | |
parent | d16744ec8ad011793144bb932ce822cc0c1733cb (diff) |
Merge uncontroversial parts of branch 'readlink' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs
Pull partial readlink cleanups from Miklos Szeredi.
This is the uncontroversial part of the readlink cleanup patch-set that
simplifies the default readlink handling.
Miklos and Al are still discussing the rest of the series.
* git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
vfs: make generic_readlink() static
vfs: remove ".readlink = generic_readlink" assignments
vfs: default to generic_readlink()
vfs: replace calling i_op->readlink with vfs_readlink()
proc/self: use generic_readlink
ecryptfs: use vfs_get_link()
bad_inode: add missing i_op initializers
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r-- | fs/nfsd/vfs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 357e844aee84..7a21abe7caf7 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1450,7 +1450,6 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1450 | __be32 | 1450 | __be32 |
1451 | nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp) | 1451 | nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp) |
1452 | { | 1452 | { |
1453 | struct inode *inode; | ||
1454 | mm_segment_t oldfs; | 1453 | mm_segment_t oldfs; |
1455 | __be32 err; | 1454 | __be32 err; |
1456 | int host_err; | 1455 | int host_err; |
@@ -1462,10 +1461,9 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp) | |||
1462 | 1461 | ||
1463 | path.mnt = fhp->fh_export->ex_path.mnt; | 1462 | path.mnt = fhp->fh_export->ex_path.mnt; |
1464 | path.dentry = fhp->fh_dentry; | 1463 | path.dentry = fhp->fh_dentry; |
1465 | inode = d_inode(path.dentry); | ||
1466 | 1464 | ||
1467 | err = nfserr_inval; | 1465 | err = nfserr_inval; |
1468 | if (!inode->i_op->readlink) | 1466 | if (!d_is_symlink(path.dentry)) |
1469 | goto out; | 1467 | goto out; |
1470 | 1468 | ||
1471 | touch_atime(&path); | 1469 | touch_atime(&path); |
@@ -1474,7 +1472,7 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp) | |||
1474 | */ | 1472 | */ |
1475 | 1473 | ||
1476 | oldfs = get_fs(); set_fs(KERNEL_DS); | 1474 | oldfs = get_fs(); set_fs(KERNEL_DS); |
1477 | host_err = inode->i_op->readlink(path.dentry, (char __user *)buf, *lenp); | 1475 | host_err = vfs_readlink(path.dentry, (char __user *)buf, *lenp); |
1478 | set_fs(oldfs); | 1476 | set_fs(oldfs); |
1479 | 1477 | ||
1480 | if (host_err < 0) | 1478 | if (host_err < 0) |