Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\super.c Create Date:2022-07-28 20:02:25
Last Modify:2022-05-24 06:42:17 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:sget_fc - Find or create a superblock*@fc: Filesystem context

Proto:struct super_block *sget_fc(struct fs_context *fc, int (*test)(struct super_block *, struct fs_context *), int (*set)(struct super_block *, struct fs_context *))

Type:struct super_block

Parameter:

TypeParameterName
struct fs_context *fc
int (*test
int (*set
515  struct super_block * s = NULL
517  user_ns = If global Then userns count is 1 for root user, 1 for init_uts_ns,* and 1 for... ? Else user_ns
520  retry :
521  spin_lock( & sb_lock)
522  If test Then
524  If test(old, fc) Then Go to share_extant_sb
528  If Not s Then
529  spin_unlock( & sb_lock)
530  s = alloc_super - create new superblock*@type: filesystem type superblock should belong to*@flags: the mount flags*@user_ns: User namespace for the super_block* Allocates and initializes a new &struct super_block. alloc_super()
531  If Not s Then Return ERR_PTR( - ENOMEM)
533  Go to retry
536  s_fs_info = s_fs_info
537  err = set(s, fc)
538  If err Then
539  s_fs_info = NULL
540  spin_unlock( & sb_lock)
541  Free a superblock that has never been seen by anyone
542  Return ERR_PTR(err)
544  s_fs_info = NULL
545  s_type = fs_type
546  s_iflags |= s_iflags
547  Copy a NUL terminated string into a sized buffer
548  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
549  hlist_add_head( & s_instances, & fs_supers)
550  spin_unlock( & sb_lock)
551  get_filesystem(s_type)
552  register_shrinker_prepared( & s_shrink)
553  Return s
555  share_extant_sb :
556  If user_ns != s_user_ns Then
557  spin_unlock( & sb_lock)
558  Free a superblock that has never been seen by anyone
559  Return ERR_PTR( - EBUSY)
561  If Not grab_super - acquire an active reference*@s: reference we are trying to make active* Tries to acquire an active reference. grab_super() is used when we* had just found a superblock in super_blocks or fs_type->fs_supers Then Go to retry
563  Free a superblock that has never been seen by anyone
564  Return old
Caller
NameDescribe
vfs_get_supervfs_get_super - Get a superblock with a search key set in s_fs_info.*@fc: The filesystem context holding the parameters*@keying: How to distinguish superblocks*@fill_super: Helper to initialise a new superblock
get_tree_bdevget_tree_bdev - Get a superblock based on a single block device*@fc: The filesystem context holding the parameters*@fill_super: Helper to initialise a new superblock