linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Query on freeing of new_fdt->open_fds in file.c
@ 2015-12-11 11:51 pavi1729
  2015-12-12  0:38 ` Eric Biggers
  0 siblings, 1 reply; 2+ messages in thread
From: pavi1729 @ 2015-12-11 11:51 UTC (permalink / raw)
  To: linux-fsdevel

Hi,
   I am unable to understand how

   new_fdt->open_fds can be freed in __free_fdtable when its an
unsigned long in files_struct ?


Details:

FUNCTION: dup_fd
http://lxr.free-electrons.com/source/fs/file.c#L261

LINE : 282 : new_fdt->open_fds = newf->open_fds_init;

files_struct : http://lxr.free-electrons.com/source/include/linux/fdtable.h#L45
unsigned long open_fds_init[1];


Cheers,
Pavi

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Query on freeing of new_fdt->open_fds in file.c
  2015-12-11 11:51 Query on freeing of new_fdt->open_fds in file.c pavi1729
@ 2015-12-12  0:38 ` Eric Biggers
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Biggers @ 2015-12-12  0:38 UTC (permalink / raw)
  To: pavi1729; +Cc: linux-fsdevel

On Fri, Dec 11, 2015 at 05:21:40PM +0530, pavi1729 wrote:
> Hi,
>    I am unable to understand how
> 
>    new_fdt->open_fds can be freed in __free_fdtable when its an
> unsigned long in files_struct ?

The 'struct fdtable' is either embedded in the files_struct (if there are few
file descriptors) or allocated separately (if there are many file descriptors).
__free_fdtable() is only ever called if the 'struct fdtable' is *not* embedded.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-12  0:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-11 11:51 Query on freeing of new_fdt->open_fds in file.c pavi1729
2015-12-12  0:38 ` Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).