From: "Partha P. Mukherjee" <ppm.floss@gmail.com>
To: kernelnewbies@kernelnewbies.org
Subject: Re: Where is getname () defined
Date: Sun, 31 Aug 2025 12:25:37 -0400 [thread overview]
Message-ID: <279d457f-2213-43a5-9375-d914959c1fa8@gmail.com> (raw)
In-Reply-To: <qukCzdjDLoqkaHsa2aeBhlihEgme6QpGzexwP4iKf-iH3GsJrw_IzyDWIQZUR385k9DolvaqYFAJjWfTEnSB1uXZXGHIm199g29gvFOdVhk=@vulturus.xyz>
On 8/29/25 2:43 PM, Vulturus wrote:
> Dear kernelnewbies subscribers,
>
> I was reading the kernel source tree in an
> attempt to understand how the chroot syscall workes.
> (I was using the linux-6.17-rc3 tarball from kernel.org.)
>
> At line 1429 of the fs/open.c file, inside the
> definition of the do_sys_openat2() function getname() is called.
>
> I am having trouble finding its definition.
>
> In particular,
> $ grep -rn 'getname' fs
> doesn't return a line like 'struct file *getname (args)'
> or similar, as I would expect.
>
> Can someone point me to the file/line where getname() is defined?
You can use GNU Global [1] to find definition and references.
$ make gtags
$ global -x getname
getname 2916 include/linux/fs.h static inline struct filename *getname(const char __user *name)
$ global -xr getname
getname 484 crypto/af_alg.c .getname = sock_no_getname,
...
<snip>
[1] https://www.gnu.org/software/global/
> Thank you,
> Vulturus
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
prev parent reply other threads:[~2025-08-31 16:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 18:43 Where is getname () defined Vulturus
2025-08-29 19:19 ` Dan Bokser
2025-08-29 19:38 ` Alison Schofield
2025-08-31 16:25 ` Partha P. Mukherjee [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=279d457f-2213-43a5-9375-d914959c1fa8@gmail.com \
--to=ppm.floss@gmail.com \
--cc=kernelnewbies@kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).