Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__ns_get_path

Proto:static void *__ns_get_path(struct path *path, struct ns_common *ns)

Type:void

Parameter:

TypeParameterName
struct path *path
struct ns_common *ns
60  mnt = nsfs_mnt
65  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
66  d = atomic_long_read( & stashed)
67  If Not d Then Go to slow
69  dentry = d
70  If Not lockref_get_not_dead - Increments count unless the ref is dead*@lockref: pointer to lockref structure* Return: 1 if count updated successfully or 0 if lockref was dead Then Go to slow
72  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
73  put(ns)
74  got_it :
75  mnt = mntget(mnt)
76  dentry = dentry
77  Return NULL
78  slow :
79  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
80  inode = w_inode_pseudo - obtain an inode*@sb: superblock* Allocates a new inode for given superblock.* Inode wont be chained in superblock s_inodes list* This means :* - fs can't be unmount* - quotas, fsnotify, writeback can't work
81  If Not inode Then
82  put(ns)
83  Return ERR_PTR( - ENOMEM)
85  Stat data, not accessed from path walking = inum
86  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.
87  i_flags |= Immutable file
88  i_mode = S_IFREG | S_IRUGO
89  rmer ->i_op->default_file_ops = ns_file_operations
90  s or device private pointer = ns
92  dentry = d_alloc_anon( pointer to superblock )
93  If Not dentry Then
94  put an inode
95  Return ERR_PTR( - ENOMEM)
97  d_instantiate - fill in inode information for a dentry*@entry: dentry to complete*@inode: inode to attach to this dentry* Fill in inode information in the entry
98  fs-specific data = ops
99  d = atomic_long_cmpxchg( & stashed, 0, (unsignedlong)dentry)
100  If d Then
101  delete a dentry
102  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
103  cpu_relax()
104  Return ERR_PTR( - EAGAIN)
106  Go to got_it
Caller
NameDescribe
ns_get_path_cb
open_related_ns