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 /arch/sparc64/solaris | |
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 'arch/sparc64/solaris')
-rw-r--r-- | arch/sparc64/solaris/ioctl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/sparc64/solaris/ioctl.c b/arch/sparc64/solaris/ioctl.c index cac0a1cf0050..374766455f5e 100644 --- a/arch/sparc64/solaris/ioctl.c +++ b/arch/sparc64/solaris/ioctl.c | |||
@@ -293,11 +293,13 @@ static struct module_info { | |||
293 | static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg) | 293 | static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg) |
294 | { | 294 | { |
295 | struct inode *ino; | 295 | struct inode *ino; |
296 | struct fdtable *fdt; | ||
296 | /* I wonder which of these tests are superfluous... --patrik */ | 297 | /* I wonder which of these tests are superfluous... --patrik */ |
297 | spin_lock(¤t->files->file_lock); | 298 | spin_lock(¤t->files->file_lock); |
298 | if (! current->files->fd[fd] || | 299 | fdt = files_fdtable(current->files); |
299 | ! current->files->fd[fd]->f_dentry || | 300 | if (! fdt->fd[fd] || |
300 | ! (ino = current->files->fd[fd]->f_dentry->d_inode) || | 301 | ! fdt->fd[fd]->f_dentry || |
302 | ! (ino = fdt->fd[fd]->f_dentry->d_inode) || | ||
301 | ! S_ISSOCK(ino->i_mode)) { | 303 | ! S_ISSOCK(ino->i_mode)) { |
302 | spin_unlock(¤t->files->file_lock); | 304 | spin_unlock(¤t->files->file_lock); |
303 | return TBADF; | 305 | return TBADF; |