Thread View: org.kernel.vger.linux-unionfs
1 messages
1 total messages
Started by Al Viro
Mon, 05 May 2025 17:29
Re: [PATCH] vfs: change 'struct file *' argument to 'const struct file *' where possible
Author: Al Viro
Date: Mon, 05 May 2025 17:29
Date: Mon, 05 May 2025 17:29
27 lines
5028 bytes
5028 bytes
On Mon, May 05, 2025 at 05:27:34PM +0100, Matthew Wilcox wrote:
> On Mon, May 05, 2025 at 05:41:47PM +0200, Miklos Szeredi wrote:
> > -static inline struct backing_file *backing_file(struct file *f)
> > +#define backing_file(f) container_of(f, struct backing_file, file)
> > +
> > +struct path *backing_file_user_path(struct file *f)
> > {
> > - return container_of(f, struct backing_file, file);
> > + return &backing_file(f)->user_path;
> > }
> >
> > -struct path *backing_file_user_path(struct file *f)
> > +const struct path *backing_file_user_path_c(const struct file *f)
> > {
> > return &backing_file(f)->user_path;
> > }
> > -EXPORT_SYMBOL_GPL(backing_file_user_path);
> > +EXPORT_SYMBOL_GPL(backing_file_user_path_c);
>
> May I suggest:
>
> #define backing_file_user_path(f) (_Generic((f), \
> const struct file *: (const struct path *)&backing_file(f)->user_path, \
> struct file *: (struct path *)&backing_file(f)->user_path)))
Um... You do realize that backing_file_user_path() has users in places
that do *NOT* see the definition of struct backing_file?
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads