mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
[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 <[email protected]> Signed-Off-By: David Howells <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
c0dfb29051
commit
badf16621c
17 changed files with 211 additions and 124 deletions
|
|
@ -1594,6 +1594,7 @@ static inline void flush_unauthorized_files(struct files_struct * files)
|
|||
struct avc_audit_data ad;
|
||||
struct file *file, *devnull = NULL;
|
||||
struct tty_struct *tty = current->signal->tty;
|
||||
struct fdtable *fdt;
|
||||
long j = -1;
|
||||
|
||||
if (tty) {
|
||||
|
|
@ -1627,9 +1628,10 @@ static inline void flush_unauthorized_files(struct files_struct * files)
|
|||
|
||||
j++;
|
||||
i = j * __NFDBITS;
|
||||
if (i >= files->max_fds || i >= files->max_fdset)
|
||||
fdt = files_fdtable(files);
|
||||
if (i >= fdt->max_fds || i >= fdt->max_fdset)
|
||||
break;
|
||||
set = files->open_fds->fds_bits[j];
|
||||
set = fdt->open_fds->fds_bits[j];
|
||||
if (!set)
|
||||
continue;
|
||||
spin_unlock(&files->file_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue