Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:get_mountpoint

Proto:static struct mountpoint *get_mountpoint(struct dentry *dentry)

Type:struct mountpoint

Parameter:

TypeParameterName
struct dentry *dentry
702  struct mountpoint * mp, * new = NULL
705  If d_mountpoint(dentry) Then
707  If d_unlinked(dentry) Then Return ERR_PTR( - ENOENT)
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  If mp Then Go to done
717  If Not new Then new = Allocation memory
719  If Not new Then Return ERR_PTR( - ENOMEM)
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  If ret == -EBUSY Then Go to mountpoint
731  mp = ERR_PTR(ret)
732  If ret Then Go to 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 = get a reference to a 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  kfree(new)
747  Return mp
Caller
NameDescribe
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