Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mounts_open_common

Proto:static int mounts_open_common(struct inode *inode, struct file *file, int (*show)(struct seq_file *, struct vfsmount *))

Type:int

Parameter:

TypeParameterName
struct inode *inode
struct file *file
int (*show
241  task = get_proc_task(inode)
243  struct mnt_namespace * ns = NULL
247  ret = -EINVAL
249  If Not task Then Go to err
252  Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring* subscriptions and synchronises with wait4(). Also used in procfs. Also* pins the final release of task.io_context. Also protects ->cpuset and* ->cgroup.subsys[]. And ->vfork_done.
253  nsp = Namespaces:
254  If Not nsp || Not mnt_ns Then
255  task_unlock(task)
256  put_task_struct(task)
257  Go to err
259  ns = mnt_ns
260  get_mnt_ns(ns)
261  If Not Filesystem information: Then
262  task_unlock(task)
263  put_task_struct(task)
264  ret = -ENOENT
265  Go to err_put_ns
267  get_fs_root( Filesystem information: , & root)
268  task_unlock(task)
269  put_task_struct(task)
271  ret = seq_open_private(file, & mounts_op, sizeof(structproc_mounts))
272  If ret Then Go to err_put_path
275  m = needed for tty driver, and maybe others
276  poll_event = event
278  p = private
279  ns = ns
280  root = root
281  show = show
282  cached_event = ~0ULL
284  Return 0
286  err_put_path :
287  path_put - put a reference to a path*@path: path to put the reference to* Given a path decrement the reference count to the dentry and the vfsmount.
288  err_put_ns :
289  put_mnt_ns(ns)
290  err :
291  Return ret
Caller
NameDescribe
mounts_open
mountinfo_open
mountstats_open