Re: [PATCH 1/2] open: add close_range()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: David Howells <dhowells@xxxxxxxxxx>
- Subject: Re: [PATCH 1/2] open: add close_range()
- From: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 21 May 2019 20:20:09 +0100
- Cc: Christian Brauner <christian@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-api@xxxxxxxxxxxxxxx, jannh@xxxxxxxxxx, fweimer@xxxxxxxxxx, oleg@xxxxxxxxxx, tglx@xxxxxxxxxxxxx, torvalds@xxxxxxxxxxxxxxxxxxxx, arnd@xxxxxxxx, shuah@xxxxxxxxxx, tkjos@xxxxxxxxxxx, ldv@xxxxxxxxxxxx, miklos@xxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-kselftest@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx
- In-reply-to: <28114.1558456227@warthog.procyon.org.uk>
- References: <20190521150006.GJ17978@ZenIV.linux.org.uk> <20190521113448.20654-1-christian@brauner.io> <28114.1558456227@warthog.procyon.org.uk>
- User-agent: Mutt/1.11.3 (2019-02-01)
On Tue, May 21, 2019 at 05:30:27PM +0100, David Howells wrote:
> If we can live with close_from(int first) rather than close_range(), then this
> can perhaps be done a lot more efficiently by:
>
> new = alloc_fdtable(first);
> spin_lock(&files->file_lock);
> old = files_fdtable(files);
> copy_fds(new, old, 0, first - 1);
> rcu_assign_pointer(files->fdt, new);
> spin_unlock(&files->file_lock);
> clear_fds(old, 0, first - 1);
> close_fdt_from(old, first);
> kfree_rcu(old);
I really hate to think how that would interact with POSIX locks...
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]