函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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()

函数原型:static struct super_block *alloc_super(struct file_system_type *type, int flags, struct user_namespace *user_ns)

返回类型:struct super_block

参数:

类型参数名称
struct file_system_type *type
intflags
struct user_namespace *user_ns
203  s等于分配内存并置零
207  如果非s则返回:NULL
210  初始化链表头
211  s_user_ns等于get_user_ns(user_ns)
212  init_rwsem( & s_umount)
213  lockdep_set_class( & s_umount, & s_umount_key)
229  down_write_nested( & s_umount, For trivial one-depth nesting of a lock-class, the following* global define can be used. (Subsystems with multiple levels* of nesting should define their own lock-nesting subclasses.))
231  如果security_sb_alloc(s)则转到:fail
234 i小于SB_FREEZE_LEVELS循环
235  如果__percpu_init_rwsem( & rw_sem[i], sb_writers_name[i], & s_writers_key[i])则转到:fail
240  init_waitqueue_head( & wait_unfrozen)
241  s_bdi等于noop_backing_dev_info
242  s_flags等于flags
243  如果s_user_ns不等于userns count is 1 for root user, 1 for init_uts_ns,* and 1 for... ?s_iflags或等于Ignore devices on this fs
245  INIT_HLIST_NODE( & s_instances)
246  INIT_HLIST_BL_HEAD( & s_roots)
247  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & s_sync_lock)
248  初始化链表头
249  spin_lock_init( & s_inode_list_lock)
250  初始化链表头
251  spin_lock_init( & s_inode_wblist_lock)
253  s_count等于1
254  atomic_set( & s_active, 1)
255  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & s_vfs_rename_mutex)
256  lockdep_set_class( & s_vfs_rename_mutex, & s_vfs_rename_key)
257  init_rwsem( & dqio_sem)
258  s_maxbytes等于MAX_NON_LFS
259  s_op等于default_op
260  s_time_gran等于1000000000
261  s_time_min等于TIME64_MIN
262  s_time_max等于Located here for timespec[64]_valid_strict
263  cleancache_poolid等于CLEANCACHE_NO_POOL
265  seeks等于A good number if you don't know better.
266  scan_objects等于One thing we have to be careful of with a per-sb shrinker is that we don't* drop the last active reference to the superblock from within the shrinker.* If that happens we could trigger unregistering the shrinker from within the
267  count_objects等于super_cache_count
268  batch等于1024
269  flags等于Flags 按位或SHRINKER_MEMCG_AWARE
270  如果Add a shrinker callback to be called from the vm.则转到:fail
272  如果list_lru_init_memcg( & s_dentry_lru, & s_shrink)则转到:fail
274  如果list_lru_init_memcg( & s_inode_lru, & s_shrink)则转到:fail
276  返回:s
278  fail :
279  Free a superblock that has never been seen by anyone
280  返回:NULL
调用者
名称描述
sget_fcsget_fc - Find or create a superblock*@fc: Filesystem context
sget查找或创建超级块