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:devpts_pty_new -- create a new inode in /dev/pts/*@ptmx_inode: inode of the master*@device: major+minor of the node to be created*@index: used as a name of the node*@priv: what's given back by devpts_get_priv* The created inode is returned

Proto:struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv)

Type:struct dentry

Parameter:

TypeParameterName
struct pts_fs_info *fsi
intindex
void *priv
565  sb = sb
571  root = s_root
572  opts = mount_opts
574  inode = obtain an inode
575  If Not inode Then Return ERR_PTR( - ENOMEM)
578  Stat data, not accessed from path walking = index + 3
579  i_uid = If setuid Then uid Else current_fsuid()
580  i_gid = If setgid Then gid Else current_fsgid()
581  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.
582  init_special_inode(inode, S_IFCHR | mode, MKDEV(UNIX98_PTY_SLAVE_MAJOR, index))
584  sprintf(s, "%d", index)
586  dentry = d_alloc_name(root, s)
587  If dentry Then
588  fs-specific data = priv
589  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().
590  snotify_create - 'name' was linked in
591  Else
592  put an inode
593  dentry = ERR_PTR( - ENOMEM)
596  Return dentry