Skip to content

Commit eb7718c

Browse files
committed
fs: remove unused idmapping helpers
Now that all places can deal with the new type safe helpers remove all of the old helpers. Reviewed-by: Seth Forshee (DigitalOcean) <[email protected]> Signed-off-by: Christian Brauner (Microsoft) <[email protected]>
1 parent c12db92 commit eb7718c

File tree

2 files changed

+0
-102
lines changed

2 files changed

+0
-102
lines changed

include/linux/fs.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,23 +1612,6 @@ static inline void i_gid_write(struct inode *inode, gid_t gid)
16121612
inode->i_gid = make_kgid(i_user_ns(inode), gid);
16131613
}
16141614

1615-
/**
1616-
* i_uid_into_mnt - map an inode's i_uid down into a mnt_userns
1617-
* @mnt_userns: user namespace of the mount the inode was found from
1618-
* @inode: inode to map
1619-
*
1620-
* Note, this will eventually be removed completely in favor of the type-safe
1621-
* i_uid_into_vfsuid().
1622-
*
1623-
* Return: the inode's i_uid mapped down according to @mnt_userns.
1624-
* If the inode's i_uid has no mapping INVALID_UID is returned.
1625-
*/
1626-
static inline kuid_t i_uid_into_mnt(struct user_namespace *mnt_userns,
1627-
const struct inode *inode)
1628-
{
1629-
return AS_KUIDT(make_vfsuid(mnt_userns, i_user_ns(inode), inode->i_uid));
1630-
}
1631-
16321615
/**
16331616
* i_uid_into_vfsuid - map an inode's i_uid down into a mnt_userns
16341617
* @mnt_userns: user namespace of the mount the inode was found from
@@ -1681,23 +1664,6 @@ static inline void i_uid_update(struct user_namespace *mnt_userns,
16811664
attr->ia_vfsuid);
16821665
}
16831666

1684-
/**
1685-
* i_gid_into_mnt - map an inode's i_gid down into a mnt_userns
1686-
* @mnt_userns: user namespace of the mount the inode was found from
1687-
* @inode: inode to map
1688-
*
1689-
* Note, this will eventually be removed completely in favor of the type-safe
1690-
* i_gid_into_vfsgid().
1691-
*
1692-
* Return: the inode's i_gid mapped down according to @mnt_userns.
1693-
* If the inode's i_gid has no mapping INVALID_GID is returned.
1694-
*/
1695-
static inline kgid_t i_gid_into_mnt(struct user_namespace *mnt_userns,
1696-
const struct inode *inode)
1697-
{
1698-
return AS_KGIDT(make_vfsgid(mnt_userns, i_user_ns(inode), inode->i_gid));
1699-
}
1700-
17011667
/**
17021668
* i_gid_into_vfsgid - map an inode's i_gid down into a mnt_userns
17031669
* @mnt_userns: user namespace of the mount the inode was found from

include/linux/mnt_idmapping.h

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,6 @@ static inline vfsuid_t make_vfsuid(struct user_namespace *mnt_userns,
228228
return VFSUIDT_INIT(make_kuid(mnt_userns, uid));
229229
}
230230

231-
static inline kuid_t mapped_kuid_fs(struct user_namespace *mnt_userns,
232-
struct user_namespace *fs_userns,
233-
kuid_t kuid)
234-
{
235-
return AS_KUIDT(make_vfsuid(mnt_userns, fs_userns, kuid));
236-
}
237-
238231
/**
239232
* make_vfsgid - map a filesystem kgid into a mnt_userns
240233
* @mnt_userns: the mount's idmapping
@@ -273,13 +266,6 @@ static inline vfsgid_t make_vfsgid(struct user_namespace *mnt_userns,
273266
return VFSGIDT_INIT(make_kgid(mnt_userns, gid));
274267
}
275268

276-
static inline kgid_t mapped_kgid_fs(struct user_namespace *mnt_userns,
277-
struct user_namespace *fs_userns,
278-
kgid_t kgid)
279-
{
280-
return AS_KGIDT(make_vfsgid(mnt_userns, fs_userns, kgid));
281-
}
282-
283269
/**
284270
* from_vfsuid - map a vfsuid into the filesystem idmapping
285271
* @mnt_userns: the mount's idmapping
@@ -307,33 +293,6 @@ static inline kuid_t from_vfsuid(struct user_namespace *mnt_userns,
307293
return make_kuid(fs_userns, uid);
308294
}
309295

310-
/**
311-
* mapped_kuid_user - map a user kuid into a mnt_userns
312-
* @mnt_userns: the mount's idmapping
313-
* @fs_userns: the filesystem's idmapping
314-
* @kuid : kuid to be mapped
315-
*
316-
* Use the idmapping of @mnt_userns to remap a @kuid into @fs_userns. Use this
317-
* function when preparing a @kuid to be written to disk or inode.
318-
*
319-
* If no_idmapping() determines that this is not an idmapped mount we can
320-
* simply return @kuid unchanged.
321-
* If initial_idmapping() tells us that the filesystem is not mounted with an
322-
* idmapping we know the value of @kuid won't change when calling
323-
* make_kuid() so we can simply retrieve the value via KUIDT_INIT()
324-
* directly.
325-
*
326-
* Return: @kuid mapped according to @mnt_userns.
327-
* If @kuid has no mapping in either @mnt_userns or @fs_userns INVALID_UID is
328-
* returned.
329-
*/
330-
static inline kuid_t mapped_kuid_user(struct user_namespace *mnt_userns,
331-
struct user_namespace *fs_userns,
332-
kuid_t kuid)
333-
{
334-
return from_vfsuid(mnt_userns, fs_userns, VFSUIDT_INIT(kuid));
335-
}
336-
337296
/**
338297
* vfsuid_has_fsmapping - check whether a vfsuid maps into the filesystem
339298
* @mnt_userns: the mount's idmapping
@@ -399,33 +358,6 @@ static inline kgid_t from_vfsgid(struct user_namespace *mnt_userns,
399358
return make_kgid(fs_userns, gid);
400359
}
401360

402-
/**
403-
* mapped_kgid_user - map a user kgid into a mnt_userns
404-
* @mnt_userns: the mount's idmapping
405-
* @fs_userns: the filesystem's idmapping
406-
* @kgid : kgid to be mapped
407-
*
408-
* Use the idmapping of @mnt_userns to remap a @kgid into @fs_userns. Use this
409-
* function when preparing a @kgid to be written to disk or inode.
410-
*
411-
* If no_idmapping() determines that this is not an idmapped mount we can
412-
* simply return @kgid unchanged.
413-
* If initial_idmapping() tells us that the filesystem is not mounted with an
414-
* idmapping we know the value of @kgid won't change when calling
415-
* make_kgid() so we can simply retrieve the value via KGIDT_INIT()
416-
* directly.
417-
*
418-
* Return: @kgid mapped according to @mnt_userns.
419-
* If @kgid has no mapping in either @mnt_userns or @fs_userns INVALID_GID is
420-
* returned.
421-
*/
422-
static inline kgid_t mapped_kgid_user(struct user_namespace *mnt_userns,
423-
struct user_namespace *fs_userns,
424-
kgid_t kgid)
425-
{
426-
return from_vfsgid(mnt_userns, fs_userns, VFSGIDT_INIT(kgid));
427-
}
428-
429361
/**
430362
* vfsgid_has_fsmapping - check whether a vfsgid maps into the filesystem
431363
* @mnt_userns: the mount's idmapping

0 commit comments

Comments
 (0)