lkml.org 
[lkml]   [2003]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] reducing overheads in fget/fput
On Fri, May 02, 2003 at 09:00:03PM -0700, Andrew Morton wrote:
> Dipankar Sarma <dipankar@in.ibm.com> wrote:
> > Not sure what your grouse is, but I don't like the fget_ligth()/fput_light
> > semantics myself. They don't seem natural, but I can't think of
> > better way to do this.
>
> Precisely.

I thought of doing something like -

static inline is_fds_shared(void)
{
struct files_struct *files = current->files;
return atomic_read(&files->count) != 1;
}


sys_blah(..)
{

int fds_shared = is_fds_shared();

file = fget_light(fd, fds_shared);
...
...
fput_light(file, fds_shared);
}

It still didn't look very natural. We leave open the possibility of
users doing is_fds_shared() for both fget_light and fput_light.
With fput_needed flag, atleast we force them to use what is returned
by fget_light.

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

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.560 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site