Re: [GIT PULL] vfs mount

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 4 Apr 2025 at 01:28, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> Or just kill the non-scoped guard because it simply is an insane API.

The scoped guard may be odd, but it's actually rather a common
situation. And when used with the proper indentation, it also ends up
being pretty visually clear about what part of a function is under the
lock.

But yeah, if you don't end up using it right, it ends up very very wrong.

Not that that is any different from "if ()" or any other similar
construct, but obviously people are much more *used* to 'if ()' and
friends.

An 'if ()" without the nested statement looks very wrong - although
it's certainly not unheard of - while a 'scoped_guard()' without the
nested statement might visually pass just because it doesn't trigger
the same visceral "that's not right" reaction.

So I don't think it's an insane API, I think it's mostly that it's a
_newish_ API.

               Linus




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux