[PATCH] files: break up files struct
In order for the RCU to work, the file table array, sets and their sizes must be updated atomically. Instead of ensuring this through too many memory barriers, we put the arrays and their sizes in a separate structure. This patch takes the first step of putting the file table elements in a separate structure fdtable that is embedded withing files_struct. It also changes all the users to refer to the file table using files_fdtable() macro. Subsequent applciation of RCU becomes easier after this. Signed-off-by: Dipankar Sarma <dipankar@in.ibm.com> Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
c0dfb29051
commit
badf16621c
@ -159,6 +159,7 @@ static inline char * task_state(struct task_struct *p, char *buffer)
|
||||
{
|
||||
struct group_info *group_info;
|
||||
int g;
|
||||
struct fdtable *fdt = NULL;
|
||||
|
||||
read_lock(&tasklist_lock);
|
||||
buffer += sprintf(buffer,
|
||||
@ -179,10 +180,12 @@ static inline char * task_state(struct task_struct *p, char *buffer)
|
||||
p->gid, p->egid, p->sgid, p->fsgid);
|
||||
read_unlock(&tasklist_lock);
|
||||
task_lock(p);
|
||||
if (p->files)
|
||||
fdt = files_fdtable(p->files);
|
||||
buffer += sprintf(buffer,
|
||||
"FDSize:\t%d\n"
|
||||
"Groups:\t",
|
||||
p->files ? p->files->max_fds : 0);
|
||||
fdt ? fdt->max_fds : 0);
|
||||
|
||||
group_info = p->group_info;
|
||||
get_group_info(group_info);
|
||||
|
Reference in New Issue
Block a user