diff options
author | Amir Goldstein <amir73il@gmail.com> | 2023-10-23 21:07:58 +0300 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2023-10-24 18:57:45 +0300 |
commit | 66c62769bcf6aa142e2309278980a2e52f4b08db (patch) | |
tree | fbe1385b834c7bf57b87655684bdba6cfdc67634 /fs/fhandle.c | |
parent | 05d3ef8bba77c1b5f98d941d8b2d4aeab8118ef1 (diff) | |
download | linux-66c62769bcf6aa142e2309278980a2e52f4b08db.tar.xz |
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/fhandle.c')
-rw-r--r-- | fs/fhandle.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/fhandle.c b/fs/fhandle.c index 6ea8d35a9382..18b3ba8dc8ea 100644 --- a/fs/fhandle.c +++ b/fs/fhandle.c @@ -26,12 +26,8 @@ static long do_sys_name_to_handle(const struct path *path, /* * We need to make sure whether the file system support decoding of * the file handle if decodeable file handle was requested. - * Otherwise, even empty export_operations are sufficient to opt-in - * to encoding FIDs. */ - if (!path->dentry->d_sb->s_export_op || - (!(fh_flags & EXPORT_FH_FID) && - !path->dentry->d_sb->s_export_op->fh_to_dentry)) + if (!exportfs_can_encode_fh(path->dentry->d_sb->s_export_op, fh_flags)) return -EOPNOTSUPP; if (copy_from_user(&f_handle, ufh, sizeof(struct file_handle))) |