Re: [GIT PULL] vfs fixes
From: Linus Torvalds
Date: Mon Mar 18 2024 - 15:42:21 EST
On Mon, 18 Mar 2024 at 12:14, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> IOW, isn't the 'get()' always basically paired with the mounting? And
> the 'put()' would probably be best done iin kill_block_super()?
. or alternative handwavy approach:
The fundamental _reason_ for the ->get/put seems to be to make the
'holder' lifetime be at least as long as the 'struct file' it is
associated with. No?
So how about we just make the 'holder' always *be* a 'struct file *'? That
(a) gets rid of the typeless 'void *' part
(b) is already what it is for normal cases (ie O_EXCL file opens).
wouldn't it be lovely if we just made the rule be that 'holder' *is*
the file pointer, and got rid of a lot of typeless WTF code?
Again, this comment (and the previous email) is more based on "this
does not feel right to me" than anything else.
That code just makes my skin itch. I can't say it's _wrong_, but it
just FeelsWrongToMe(tm).
Linus