Re: [patch 2/2] ufd v1 - use unsequential O(1) fdmap

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

 



* Davide Libenzi <[email protected]> wrote:

> This patch plugs the extended fdmap into the kernel. At the moment, this
> is done only through sys_dup2() and F_DUPFD.
> The base value for the unsequential file descriptor allocation is (at the
> moment) set to FD_UNSEQ_BASE (defined in asm-generic/fcntl.h):

really nice stuff! :-)

> #define FD_UNSEQ_BASE	(1U << 28)
> #define FD_UNSEQ_ALLOC  (1U << 30)

i'm wondering, why not use (1 << 30) both as the base and as the flag? 
That would make integration of the new fd space 'seemless' in terms of 
dup2() use.

> It'd be possible to add a new O_UNSEQFD flag to open(2) and make 
> sys_open() to allocate the new descriptor inside the unsequential map.

yeah, please do that now - lets not leave any incomplete areas. We've 
too often made the mistake of not pushing through new APIs consistently 
enough.

I'd also suggest a new sys_socket2() call that takes a 'flags' parameter 
as well - because one primary user of this facility will be networking 
servers. (O_UNSEQFD would make sense for it and O_NDELAY - currently 
network apps that want to set O_NDELAY need to do it with an extra 
fcntl() - while they could already indicate this in the sys_socket() 
call, if it were closer to sys_open() semantics)

in any case, your patch is looking really good and already deserves an 
ack!

Acked-by: Ingo Molnar <[email protected]>

	Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux