函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\super.c Create Date:2022-07-29 10:32:21
Last Modify:2022-05-24 06:42:17 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:sget_fc - Find or create a superblock*@fc: Filesystem context

函数原型: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 *))

返回类型:struct super_block

参数:

类型参数名称
struct fs_context *fc
int (*test
int (*set
515  struct super_block * s = NULL
517  user_ns等于如果globaluserns count is 1 for root user, 1 for init_uts_ns,* and 1 for... ?否则user_ns
520  retry :
521  加自旋锁
522  如果test
524  如果test(old, fc)则转到:share_extant_sb
528  如果非s
529  自旋锁解锁
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  如果非s则返回:错误号
533  转到:retry
536  s_fs_info等于s_fs_info
537  err等于set(s, fc)
538  如果err
539  s_fs_info = NULL
540  自旋锁解锁
541  Free a superblock that has never been seen by anyone
542  返回:错误号
544  s_fs_info = NULL
545  s_type等于fs_type
546  s_iflags或等于s_iflags
547  长字符串复制
548  添加链表项
549  hlist_add_head( & s_instances, & fs_supers)
550  自旋锁解锁
551  get_filesystem(s_type)
552  register_shrinker_prepared( & s_shrink)
553  返回:s
555  share_extant_sb :
556  如果user_ns不等于s_user_ns
557  自旋锁解锁
558  Free a superblock that has never been seen by anyone
559  返回:错误号
561  如果非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则转到:retry
563  Free a superblock that has never been seen by anyone
564  返回:old
调用者
名称描述
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