Re: [PATCH 13/52] has_locked_children(): use guards

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

 



[ diff edited to be just the end result ]

On Mon, 25 Aug 2025 at 00:44, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>
>  bool has_locked_children(struct mount *mnt, struct dentry *dentry)
>  {
> +       scoped_guard(mount_locked_reader)
> +               return __has_locked_children(mnt, dentry);
>  }

So the use of scoped_guard() looks a bit odd to me. Why create a new
scope for when the existing scope is identical? It would seem to be
more straightforward to just do

        guard(mount_locked_reader);
        return __has_locked_children(mnt, dentry);

instead. Was there some code generation issue or other thing that made
you go the 'scoped' way?

There was at least one other patch that did the same pattern (but I
haven't gone through the whole series, maybe there are explanations
later).

               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