From: Al Viro <viro@zeniv.linux.org.uk>
To: Christian Brauner <brauner@kernel.org>
Cc: Dawid Osuchowski <linux@osuchow.ski>,
linux-fsdevel@vger.kernel.org, jack@suse.cz
Subject: Re: [PATCH] fs: Create anon_inode_getfile_fmode()
Date: Thu, 25 Apr 2024 21:25:50 +0100 [thread overview]
Message-ID: <20240425202550.GL2118490@ZenIV> (raw)
In-Reply-To: <20240425-wohltat-galant-16b3360118d0@brauner>
On Thu, Apr 25, 2024 at 11:57:12AM +0200, Christian Brauner wrote:
> On Thu, Apr 25, 2024 at 01:38:59AM +0200, Dawid Osuchowski wrote:
> > Creates an anon_inode_getfile_fmode() function that works similarly to
> > anon_inode_getfile() with the addition of being able to set the fmode
> > member.
>
> And for what use-case exactly?
There are several places where we might want that -
arch/powerpc/platforms/pseries/papr-vpd.c:488: file = anon_inode_getfile("[papr-vpd]", &papr_vpd_handle_ops,
fs/cachefiles/ondemand.c:233: file = anon_inode_getfile("[cachefiles]", &cachefiles_ondemand_fd_fops,
fs/eventfd.c:412: file = anon_inode_getfile("[eventfd]", &eventfd_fops, ctx, flags);
in addition to vfio example Dawid mentions, as well as a couple of
borderline cases in
virt/kvm/kvm_main.c:4404: file = anon_inode_getfile(name, &kvm_vcpu_stats_fops, vcpu, O_RDONLY);
virt/kvm/kvm_main.c:5092: file = anon_inode_getfile("kvm-vm-stats",
So something of that sort is probably a good idea. Said that,
what the hell is __anon_inode_getfile_fmode() for? It's identical
to exported variant, AFAICS. And then there's this:
if (IS_ERR(file))
goto err;
file->f_mode |= f_mode;
return file;
err:
return file;
a really odd way to spell
if (!IS_ERR(file))
file->f_mode |= f_mode;
return file;
next prev parent reply other threads:[~2024-04-25 20:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-24 23:38 [PATCH] fs: Create anon_inode_getfile_fmode() Dawid Osuchowski
2024-04-25 9:57 ` Christian Brauner
2024-04-25 10:13 ` Dawid Osuchowski
2024-04-25 20:25 ` Al Viro [this message]
2024-04-25 21:45 ` Dawid Osuchowski
2024-04-26 8:58 ` Christian Brauner
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=20240425202550.GL2118490@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux@osuchow.ski \
/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).