aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2023-10-23 21:07:58 +0300
committerChristian Brauner <brauner@kernel.org>2023-10-24 17:57:45 +0200
commit66c62769bcf6aa142e2309278980a2e52f4b08db (patch)
treefbe1385b834c7bf57b87655684bdba6cfdc67634 /fs/nfsd
parent05d3ef8bba77c1b5f98d941d8b2d4aeab8118ef1 (diff)
downloadlinux-66c62769bcf6aa142e2309278980a2e52f4b08db.tar.gz
exportfs: add helpers to check if filesystem can encode/decode file handles
The logic of whether filesystem can encode/decode file handles is open coded in many places. In preparation to changing the logic, move the open coded logic into inline helpers. Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Amir Goldstein <amir73il@gmail.com> Link: https://lore.kernel.org/r/20231023180801.2953446-2-amir73il@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/export.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 11a0eaa2f9140..dc99dfc1d4115 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -421,8 +421,7 @@ static int check_export(struct path *path, int *flags, unsigned char *uuid)
return -EINVAL;
}
- if (!inode->i_sb->s_export_op ||
- !inode->i_sb->s_export_op->fh_to_dentry) {
+ if (!exportfs_can_decode_fh(inode->i_sb->s_export_op)) {
dprintk("exp_export: export of invalid fs type.\n");
return -EINVAL;
}