Commit 3c1be84b authored by Fox Chen's avatar Fox Chen Committed by Jonathan Corbet

docs: path-lookup: update get_link() ->follow_link description

get_link() is merged into pick_link(). i_op->follow_link is
replaced with i_op->get_link(). get_link() can return ERR_PTR(0)
which equals NULL.
Signed-off-by: default avatarFox Chen <foxhlchen@gmail.com>
Reviewed-by: default avatarNeilBrown <neilb@suse.de>
Link: https://lore.kernel.org/r/20210527091618.287093-12-foxhlchen@gmail.comSigned-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent de9414ad
...@@ -1136,10 +1136,10 @@ Symlinks with no final component ...@@ -1136,10 +1136,10 @@ Symlinks with no final component
A pair of special-case symlinks deserve a little further explanation. A pair of special-case symlinks deserve a little further explanation.
Both result in a new ``struct path`` (with mount and dentry) being set Both result in a new ``struct path`` (with mount and dentry) being set
up in the ``nameidata``, and result in ``get_link()`` returning ``NULL``. up in the ``nameidata``, and result in ``pick_link()`` returning ``NULL``.
The more obvious case is a symlink to "``/``". All symlinks starting The more obvious case is a symlink to "``/``". All symlinks starting
with "``/``" are detected in ``get_link()`` which resets the ``nameidata`` with "``/``" are detected in ``pick_link()`` which resets the ``nameidata``
to point to the effective filesystem root. If the symlink only to point to the effective filesystem root. If the symlink only
contains "``/``" then there is nothing more to do, no components at all, contains "``/``" then there is nothing more to do, no components at all,
so ``NULL`` is returned to indicate that the symlink can be released and so ``NULL`` is returned to indicate that the symlink can be released and
...@@ -1156,12 +1156,11 @@ something that looks like a symlink. It is really a reference to the ...@@ -1156,12 +1156,11 @@ something that looks like a symlink. It is really a reference to the
target file, not just the name of it. When you ``readlink`` these target file, not just the name of it. When you ``readlink`` these
objects you get a name that might refer to the same file - unless it objects you get a name that might refer to the same file - unless it
has been unlinked or mounted over. When ``walk_component()`` follows has been unlinked or mounted over. When ``walk_component()`` follows
one of these, the ``->follow_link()`` method in "procfs" doesn't return one of these, the ``->get_link()`` method in "procfs" doesn't return
a string name, but instead calls ``nd_jump_link()`` which updates the a string name, but instead calls ``nd_jump_link()`` which updates the
``nameidata`` in place to point to that target. ``->follow_link()`` then ``nameidata`` in place to point to that target. ``->get_link()`` then
returns ``NULL``. Again there is no final component and ``get_link()`` returns ``NULL``. Again there is no final component and ``pick_link()``
reports this by leaving the ``last_type`` field of ``nameidata`` as returns ``NULL``.
``LAST_BIND``.
Following the symlink in the final component Following the symlink in the final component
-------------------------------------------- --------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment