Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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()

Proto:static struct super_block *alloc_super(struct file_system_type *type, int flags, struct user_namespace *user_ns)

Type:struct super_block

Parameter:

TypeParameterName
struct file_system_type *type
intflags
struct user_namespace *user_ns
203  s = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
207  If Not s Then Return NULL
210  Initialization list head
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  If security_sb_alloc(s) Then Go to fail
234  When i < SB_FREEZE_LEVELS cycle
235  If __percpu_init_rwsem( & rw_sem[i], sb_writers_name[i], & s_writers_key[i]) Then Go to fail
240  init_waitqueue_head( & wait_unfrozen)
241  s_bdi = noop_backing_dev_info
242  s_flags = flags
243  If s_user_ns != userns count is 1 for root user, 1 for init_uts_ns,* and 1 for... ? Then 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  Initialization list head
249  Process spin lock initialization( & s_inode_list_lock)
250  Initialization list head
251  Process spin lock initialization( & 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  If Add a shrinker callback to be called from the vm. Then Go to fail
272  If list_lru_init_memcg( & s_dentry_lru, & s_shrink) Then Go to fail
274  If list_lru_init_memcg( & s_inode_lru, & s_shrink) Then Go to fail
276  Return s
278  fail :
279  Free a superblock that has never been seen by anyone
280  Return NULL
Caller
NameDescribe
sget_fcsget_fc - Find or create a superblock*@fc: Filesystem context
sgetfind or create a superblock