Skip to content

Commit

Permalink
fs: export mnt_idmap_get/mnt_idmap_put
Browse files Browse the repository at this point in the history
These helpers are required to support idmapped mounts in the Cephfs.

Cc: Christian Brauner <brauner@kernel.org>
Cc: Xiubo Li <xiubli@redhat.com>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: ceph-devel@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
  • Loading branch information
mihalicyn authored and idryomov committed Oct 2, 2023
1 parent 65a90fc commit 6efd3e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/mnt_idmapping.c
Expand Up @@ -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
Expand All @@ -271,3 +272,4 @@ void mnt_idmap_put(struct mnt_idmap *idmap)
kfree(idmap);
}
}
EXPORT_SYMBOL_GPL(mnt_idmap_put);
3 changes: 3 additions & 0 deletions include/linux/mnt_idmapping.h
Expand Up @@ -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);

Expand Down

0 comments on commit 6efd3e9

Please sign in to comment.