summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>2023-08-07 15:26:15 +0200
committerIlya Dryomov <idryomov@gmail.com>2023-11-03 23:28:33 +0100
commit1b90344614cc5949666328b37f03edec1d4e2873 (patch)
tree06c827faefe5b057464ae968668305e08eb32bf6
parent522dc5108f07ef30e2c7399e59b9547d382308ff (diff)
downloadlinux-stable-1b90344614cc5949666328b37f03edec1d4e2873.tar.gz
linux-stable-1b90344614cc5949666328b37f03edec1d4e2873.tar.bz2
linux-stable-1b90344614cc5949666328b37f03edec1d4e2873.zip
fs: export mnt_idmap_get/mnt_idmap_put
These helpers are required to support idmapped mounts in CephFS. Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r--fs/mnt_idmapping.c2
-rw-r--r--include/linux/mnt_idmapping.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/fs/mnt_idmapping.c b/fs/mnt_idmapping.c
index 4905665c47d0..57d1dedf3f8f 100644
--- a/fs/mnt_idmapping.c
+++ b/fs/mnt_idmapping.c
@@ -256,6 +256,7 @@ struct mnt_idmap *mnt_idmap_get(struct mnt_idmap *idmap)
return idmap;
}
+EXPORT_SYMBOL_GPL(mnt_idmap_get);
/**
* mnt_idmap_put - put a reference to an idmapping
@@ -271,3 +272,4 @@ void mnt_idmap_put(struct mnt_idmap *idmap)
kfree(idmap);
}
}
+EXPORT_SYMBOL_GPL(mnt_idmap_put);
diff --git a/include/linux/mnt_idmapping.h b/include/linux/mnt_idmapping.h
index 057c89867aa2..b8da2db4ecd2 100644
--- a/include/linux/mnt_idmapping.h
+++ b/include/linux/mnt_idmapping.h
@@ -115,6 +115,9 @@ static inline bool vfsgid_eq_kgid(vfsgid_t vfsgid, kgid_t kgid)
int vfsgid_in_group_p(vfsgid_t vfsgid);
+struct mnt_idmap *mnt_idmap_get(struct mnt_idmap *idmap);
+void mnt_idmap_put(struct mnt_idmap *idmap);
+
vfsuid_t make_vfsuid(struct mnt_idmap *idmap,
struct user_namespace *fs_userns, kuid_t kuid);