Re: [PATCH 25/26] get rid of mountpoint->m_count

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

 



On Wed, Jun 11, 2025 at 07:47:00PM +0100, Al Viro wrote:
> On Wed, Jun 11, 2025 at 01:19:43PM +0200, Christian Brauner wrote:
> 
> > This feels well-suited for a DEFINE_FREE based annotation so that
> > unpin_mountpoint() is called when the scope ends.
> 
> FWIW, I'd be more interested in having unlock_mount() treated that
> way, but I'm not sure what syntax would make sense there.
> 
> scoped_cond_guard() is not a good fit, unfortunately...

Folks, how much would you hate the following trick:

lock_mount(path, &m) returning void, and indicating error by storing
ERR_PTR(-E...) into m.path; unlock_mount(&m) doing nothing if IS_ERR(m.mp);
users turned into

	scoped_guard(lock_mount, mp)(path) {
		if (IS_ERR(mp.mp))
			return ERR_PTR(mp.mp);
		....
	}




[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