Re: [RFC v10][PATCH 09/13] Restore open file descriprtors

2008-12-01 Thread Oren Laadan
Dave Hansen wrote: On Fri, 2008-11-28 at 11:27 +, Al Viro wrote: On Wed, Nov 26, 2008 at 08:04:40PM -0500, Oren Laadan wrote: +/** + * cr_attach_get_file - attach (and get) lonely file ptr to a file descriptor + * @file: lonely file pointer + */ +static int cr_attach_get_file(struct

Re: [RFC v10][PATCH 09/13] Restore open file descriprtors

2008-12-01 Thread Dave Hansen
On Mon, 2008-12-01 at 15:41 -0500, Oren Laadan wrote: + fd = cr_attach_file(file); /* no need to cleanup 'file' below */ + if (fd 0) { + filp_close(file, NULL); + ret = fd; + goto out; + } + + /* register new objref, file tuple in hash

Re: [RFC v10][PATCH 09/13] Restore open file descriprtors

2008-12-01 Thread Dave Hansen
On Mon, 2008-12-01 at 13:07 -0800, Dave Hansen wrote: When a shared object is inserted to the hash we automatically take another reference to it (according to its type) for as long as it remains in the hash. See: 'cr_obj_ref_grab()' and 'cr_obj_ref_drop()'. So by moving that call higher