Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\fs_context.c Create Date:2022-07-28 20:13:04
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:alloc_fs_context - Create a filesystem context.*@fs_type: The filesystem type.*@reference: The dentry from which this one derives (or NULL)*@sb_flags: Filesystem/superblock flags (SB_*)*@sb_flags_mask: Applicable members of @sb_flags

Proto:static struct fs_context *alloc_fs_context(struct file_system_type *fs_type, struct dentry *reference, unsigned int sb_flags, unsigned int sb_flags_mask, enum fs_context_purpose purpose)

Type:struct fs_context

Parameter:

TypeParameterName
struct file_system_type *fs_type
struct dentry *reference
unsigned intsb_flags
unsigned intsb_flags_mask
enum fs_context_purposepurpose
259  ret = -ENOMEM
261  fc = 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).
262  If Not fc Then Return ERR_PTR( - ENOMEM)
265  purpose = purpose
266  sb_flags = sb_flags
267  sb_flags_mask = sb_flags_mask
268  fs_type = WARNING: This can be used only if we _already_ own a reference
269  cred = get_current_cred - Get the current task's subjective credentials* Get the subjective credentials of the current task, pinning them so that* they can't go away. Accessing the current task's credentials directly is* not permitted.()
270  net_ns = get_net(net_ns)
272  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.( & uapi_mutex)
275  Case purpose == New superblock for explicit mount
276  user_ns = get_user_ns(user_ns)
277  Break
278  Case purpose == New superblock for automatic submount
279  user_ns = get_user_ns(s_user_ns)
280  Break
281  Case purpose == Superblock reconfiguration (remount)
282  atomic_inc( & s_active)
283  user_ns = get_user_ns(s_user_ns)
284  root = get a reference to a dentry
285  Break
289  init_fs_context = init_fs_context
290  If Not init_fs_context Then init_fs_context = legacy_init_fs_context
293  ret = init_fs_context(fc)
294  If ret < 0 Then Go to err_fc
296  need_free = true
297  Return fc
299  err_fc :
300  put_fs_context - Dispose of a superblock configuration context.*@fc: The context to dispose of.
301  Return ERR_PTR(ret)
Caller
NameDescribe
fs_context_for_mount
fs_context_for_reconfigure
fs_context_for_submount