diff options
author | Dipankar Sarma <dipankar@in.ibm.com> | 2005-09-09 16:04:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 16:57:55 -0400 |
commit | badf16621c1f9d1ac753be056fce11b43d6e0be5 (patch) | |
tree | 3fdf833fdf2e3d3a439090743539680449ec3428 /security/selinux | |
parent | c0dfb2905126e9e94edebbce8d3e05001301f52d (diff) |
[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>
Diffstat (limited to 'security/selinux')
-rw-r--r-- | security/selinux/hooks.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 3f0b533be92c..acb5a495a902 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -1594,6 +1594,7 @@ static inline void flush_unauthorized_files(struct files_struct * files) | |||
1594 | struct avc_audit_data ad; | 1594 | struct avc_audit_data ad; |
1595 | struct file *file, *devnull = NULL; | 1595 | struct file *file, *devnull = NULL; |
1596 | struct tty_struct *tty = current->signal->tty; | 1596 | struct tty_struct *tty = current->signal->tty; |
1597 | struct fdtable *fdt; | ||
1597 | long j = -1; | 1598 | long j = -1; |
1598 | 1599 | ||
1599 | if (tty) { | 1600 | if (tty) { |
@@ -1627,9 +1628,10 @@ static inline void flush_unauthorized_files(struct files_struct * files) | |||
1627 | 1628 | ||
1628 | j++; | 1629 | j++; |
1629 | i = j * __NFDBITS; | 1630 | i = j * __NFDBITS; |
1630 | if (i >= files->max_fds || i >= files->max_fdset) | 1631 | fdt = files_fdtable(files); |
1632 | if (i >= fdt->max_fds || i >= fdt->max_fdset) | ||
1631 | break; | 1633 | break; |
1632 | set = files->open_fds->fds_bits[j]; | 1634 | set = fdt->open_fds->fds_bits[j]; |
1633 | if (!set) | 1635 | if (!set) |
1634 | continue; | 1636 | continue; |
1635 | spin_unlock(&files->file_lock); | 1637 | spin_unlock(&files->file_lock); |