vfs: Kill sget_userns()
Kill sget_userns(), folding it into sget() as that's the only remaining user. Signed-off-by: David Howells <dhowells@redhat.com> cc: linux-fsdevel@vger.kernel.org
This commit is contained in:
Родитель
db2c246a09
Коммит
023d066a0d
54
fs/super.c
54
fs/super.c
|
@ -563,24 +563,31 @@ share_extant_sb:
|
||||||
EXPORT_SYMBOL(sget_fc);
|
EXPORT_SYMBOL(sget_fc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sget_userns - find or create a superblock
|
* sget - find or create a superblock
|
||||||
* @type: filesystem type superblock should belong to
|
* @type: filesystem type superblock should belong to
|
||||||
* @test: comparison callback
|
* @test: comparison callback
|
||||||
* @set: setup callback
|
* @set: setup callback
|
||||||
* @flags: mount flags
|
* @flags: mount flags
|
||||||
* @user_ns: User namespace for the super_block
|
* @data: argument to each of them
|
||||||
* @data: argument to each of them
|
|
||||||
*/
|
*/
|
||||||
struct super_block *sget_userns(struct file_system_type *type,
|
struct super_block *sget(struct file_system_type *type,
|
||||||
int (*test)(struct super_block *,void *),
|
int (*test)(struct super_block *,void *),
|
||||||
int (*set)(struct super_block *,void *),
|
int (*set)(struct super_block *,void *),
|
||||||
int flags, struct user_namespace *user_ns,
|
int flags,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
|
struct user_namespace *user_ns = current_user_ns();
|
||||||
struct super_block *s = NULL;
|
struct super_block *s = NULL;
|
||||||
struct super_block *old;
|
struct super_block *old;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
/* We don't yet pass the user namespace of the parent
|
||||||
|
* mount through to here so always use &init_user_ns
|
||||||
|
* until that changes.
|
||||||
|
*/
|
||||||
|
if (flags & SB_SUBMOUNT)
|
||||||
|
user_ns = &init_user_ns;
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
spin_lock(&sb_lock);
|
spin_lock(&sb_lock);
|
||||||
if (test) {
|
if (test) {
|
||||||
|
@ -621,35 +628,6 @@ retry:
|
||||||
register_shrinker_prepared(&s->s_shrink);
|
register_shrinker_prepared(&s->s_shrink);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(sget_userns);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* sget - find or create a superblock
|
|
||||||
* @type: filesystem type superblock should belong to
|
|
||||||
* @test: comparison callback
|
|
||||||
* @set: setup callback
|
|
||||||
* @flags: mount flags
|
|
||||||
* @data: argument to each of them
|
|
||||||
*/
|
|
||||||
struct super_block *sget(struct file_system_type *type,
|
|
||||||
int (*test)(struct super_block *,void *),
|
|
||||||
int (*set)(struct super_block *,void *),
|
|
||||||
int flags,
|
|
||||||
void *data)
|
|
||||||
{
|
|
||||||
struct user_namespace *user_ns = current_user_ns();
|
|
||||||
|
|
||||||
/* We don't yet pass the user namespace of the parent
|
|
||||||
* mount through to here so always use &init_user_ns
|
|
||||||
* until that changes.
|
|
||||||
*/
|
|
||||||
if (flags & SB_SUBMOUNT)
|
|
||||||
user_ns = &init_user_ns;
|
|
||||||
|
|
||||||
return sget_userns(type, test, set, flags, user_ns, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
EXPORT_SYMBOL(sget);
|
EXPORT_SYMBOL(sget);
|
||||||
|
|
||||||
void drop_super(struct super_block *sb)
|
void drop_super(struct super_block *sb)
|
||||||
|
|
|
@ -2245,11 +2245,6 @@ void free_anon_bdev(dev_t);
|
||||||
struct super_block *sget_fc(struct fs_context *fc,
|
struct super_block *sget_fc(struct fs_context *fc,
|
||||||
int (*test)(struct super_block *, struct fs_context *),
|
int (*test)(struct super_block *, struct fs_context *),
|
||||||
int (*set)(struct super_block *, struct fs_context *));
|
int (*set)(struct super_block *, struct fs_context *));
|
||||||
struct super_block *sget_userns(struct file_system_type *type,
|
|
||||||
int (*test)(struct super_block *,void *),
|
|
||||||
int (*set)(struct super_block *,void *),
|
|
||||||
int flags, struct user_namespace *user_ns,
|
|
||||||
void *data);
|
|
||||||
struct super_block *sget(struct file_system_type *type,
|
struct super_block *sget(struct file_system_type *type,
|
||||||
int (*test)(struct super_block *,void *),
|
int (*test)(struct super_block *,void *),
|
||||||
int (*set)(struct super_block *,void *),
|
int (*set)(struct super_block *,void *),
|
||||||
|
|
Загрузка…
Ссылка в новой задаче