Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mknod_ptmx

Proto:static int mknod_ptmx(struct super_block *sb)

Type:int

Parameter:

TypeParameterName
struct super_block *sb
325  rc = -ENOMEM
328  root = s_root
329  fsi = DEVPTS_SB(sb)
330  opts = mount_opts
331  ptmx_uid = current_fsuid()
332  ptmx_gid = current_fsgid()
334  inode_lock(d_inode - Get the actual inode of this dentry*@dentry: The dentry to query* This is the helper normal filesystems should use to get at their own inodes* in their own dentries and ignore the layering superimposed upon them.)
337  If ptmx_dentry Then
338  rc = 0
339  Go to out
342  dentry = d_alloc_name(root, "ptmx")
343  If Not dentry Then
344  pr_err("Unable to alloc dentry for ptmx node\n")
345  Go to out
351  inode = obtain an inode
352  If Not inode Then
353  pr_err("Unable to alloc inode for ptmx node\n")
354  dput - release a dentry*@dentry: dentry to release * Release a dentry. This will drop the usage count and if appropriate* call the dentry unlink method as well as removing it from the queues and* releasing its resources
355  Go to out
358  Stat data, not accessed from path walking = 2
359  i_mtime = i_atime = i_ctime = rrent_time - Return FS time*@inode: inode.* Return the current time truncated to the time granularity supported by* the fs.* Note that inode and inode->sb cannot be NULL.* Otherwise, the function warns and returns time without truncation.
361  mode = S_IFCHR | ptmxmode
362  init_special_inode(inode, mode, MKDEV(TTYAUX_MAJOR, 2))
363  i_uid = ptmx_uid
364  i_gid = ptmx_gid
366  d_add - add dentry to hash queues*@entry: dentry to add*@inode: The inode to attach to this dentry* This adds the entry to the hash queues and initializes @inode.* The entry was actually filled in earlier during d_alloc().
368  ptmx_dentry = dentry
369  rc = 0
370  out :
371  inode_unlock(d_inode - Get the actual inode of this dentry*@dentry: The dentry to query* This is the helper normal filesystems should use to get at their own inodes* in their own dentries and ignore the layering superimposed upon them.)
372  Return rc
Caller
NameDescribe
devpts_fill_super