函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\namespace.c Create Date:2022-07-29 10:39:27
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:get_mountpoint

函数原型:static struct mountpoint *get_mountpoint(struct dentry *dentry)

返回类型:struct mountpoint

参数:

类型参数名称
struct dentry *dentry
702  struct mountpoint * mp, * new = NULL
705  如果d_mountpoint(dentry)则
707  如果d_unlinked(dentry)则返回:错误号
709  mountpoint :
710  A locking reader exclusively locks out other writers and locking readers,* but doesn't update the sequence number. Acts like a normal spin_lock/unlock.* Don't need preempt_disable() because that is in the spin_lock already.
711  mp等于lookup_mountpoint(dentry)
712  read_sequnlock_excl( & vfsmount lock may be taken for read to prevent changes to the* vfsmount hash, ie. during mountpoint lookups or walking back* up the tree.* It should be taken for write in all cases where the vfsmount)
713  如果mp则转到:done
717  如果非newnew等于开辟内存
719  如果非new则返回:错误号
724  ret等于Called by mount code to set a mountpoint and check if the mountpoint is* reachable (e.g. NFS can unhash a directory dentry and then the complete* subtree can become unreachable).* Only one of d_invalidate() and d_set_mounted() must succeed. For
727  如果ret恒等于负EBUSY则转到:mountpoint
731  mp等于错误号
732  如果ret则转到:done
736  A locking reader exclusively locks out other writers and locking readers,* but doesn't update the sequence number. Acts like a normal spin_lock/unlock.* Don't need preempt_disable() because that is in the spin_lock already.
737  m_dentry等于获得目录项引用
738  m_count等于1
739  hlist_add_head( & m_hash, mp_hash(dentry))
740  INIT_HLIST_HEAD( & m_list)
741  read_sequnlock_excl( & vfsmount lock may be taken for read to prevent changes to the* vfsmount hash, ie. during mountpoint lookups or walking back* up the tree.* It should be taken for write in all cases where the vfsmount)
743  mp等于new
744  new = NULL
745  done :
746  释放内存
747  返回:mp
调用者
名称描述
attach_recursive_mnt@source_mnt : mount tree to be attached*@nd : place the mount tree @source_mnt is attached*@parent_nd : if non-null, detach the source_mnt from its parent and* store the parent mount and mountpoint dentry
lock_mount