函数逻辑报告

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

函数名称:查找或创建超级块

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

参数:

类型参数名称
struct file_system_type *type
int (*test
int (*set
intflags
void *data
582  user_ns等于current_user_ns()
583  struct super_block * s = NULL
591  如果flags按位与These sb flags are internal to the kernel user_ns等于userns count is 1 for root user, 1 for init_uts_ns,* and 1 for... ?
594  retry :
595  加自旋锁
596  如果test
598  如果非test(old, data)则继续下一循环
600  如果user_ns不等于s_user_ns
603  返回:错误号
605  如果非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
607  Free a superblock that has never been seen by anyone
608  返回:old
611  如果非s
612  自旋锁解锁
613  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()
614  如果非s则返回:错误号
616  转到:retry
619  err等于set(s, data)
620  如果err
621  自旋锁解锁
622  Free a superblock that has never been seen by anyone
623  返回:错误号
625  s_type等于type
626  长字符串复制
627  添加链表项
628  hlist_add_head( & s_instances, & fs_supers)
629  自旋锁解锁
630  get_filesystem(type)
631  register_shrinker_prepared( & s_shrink)
632  返回:s
调用者
名称描述
mount_bdev
mount_nodev
mount_single