Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] files-sparc64-fix 2

Fix sparc64 timod to use the new files_fdtable() api to get the fd table.
This is necessary for RCUification.

Signed-off-by: Dipankar Sarma <dipankar@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Dipankar Sarma and committed by
Linus Torvalds
6e72ad2c badf1662

+22 -7
+22 -7
arch/sparc64/solaris/timod.c
··· 143 143 static void timod_wake_socket(unsigned int fd) 144 144 { 145 145 struct socket *sock; 146 + struct fdtable *fdt; 146 147 147 148 SOLD("wakeing socket"); 148 - sock = SOCKET_I(current->files->fd[fd]->f_dentry->d_inode); 149 + fdt = files_fdtable(current->files); 150 + sock = SOCKET_I(fdt->fd[fd]->f_dentry->d_inode); 149 151 wake_up_interruptible(&sock->wait); 150 152 read_lock(&sock->sk->sk_callback_lock); 151 153 if (sock->fasync_list && !test_bit(SOCK_ASYNC_WAITDATA, &sock->flags)) ··· 159 157 static void timod_queue(unsigned int fd, struct T_primsg *it) 160 158 { 161 159 struct sol_socket_struct *sock; 160 + struct fdtable *fdt; 162 161 163 162 SOLD("queuing primsg"); 164 - sock = (struct sol_socket_struct *)current->files->fd[fd]->private_data; 163 + fdt = files_fdtable(current->files); 164 + sock = (struct sol_socket_struct *)fdt->fd[fd]->private_data; 165 165 it->next = sock->pfirst; 166 166 sock->pfirst = it; 167 167 if (!sock->plast) ··· 175 171 static void timod_queue_end(unsigned int fd, struct T_primsg *it) 176 172 { 177 173 struct sol_socket_struct *sock; 174 + struct fdtable *fdt; 178 175 179 176 SOLD("queuing primsg at end"); 180 - sock = (struct sol_socket_struct *)current->files->fd[fd]->private_data; 177 + fdt = files_fdtable(current->files); 178 + sock = (struct sol_socket_struct *)fdt->fd[fd]->private_data; 181 179 it->next = NULL; 182 180 if (sock->plast) 183 181 sock->plast->next = it; ··· 350 344 char *buf; 351 345 struct file *filp; 352 346 struct inode *ino; 347 + struct fdtable *fdt; 353 348 struct sol_socket_struct *sock; 354 349 mm_segment_t old_fs = get_fs(); 355 350 long args[6]; ··· 358 351 (int (*)(int, unsigned long __user *))SYS(socketcall); 359 352 int (*sys_sendto)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int) = 360 353 (int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int))SYS(sendto); 361 - filp = current->files->fd[fd]; 354 + 355 + fdt = files_fdtable(current->files); 356 + filp = fdt->fd[fd]; 362 357 ino = filp->f_dentry->d_inode; 363 358 sock = (struct sol_socket_struct *)filp->private_data; 364 359 SOLD("entry"); ··· 629 620 int oldflags; 630 621 struct file *filp; 631 622 struct inode *ino; 623 + struct fdtable *fdt; 632 624 struct sol_socket_struct *sock; 633 625 struct T_unitdata_ind udi; 634 626 mm_segment_t old_fs = get_fs(); ··· 642 632 643 633 SOLD("entry"); 644 634 SOLDD(("%u %p %d %p %p %d %p %d\n", fd, ctl_buf, ctl_maxlen, ctl_len, data_buf, data_maxlen, data_len, *flags_p)); 645 - filp = current->files->fd[fd]; 635 + fdt = files_fdtable(current->files); 636 + filp = fdt->fd[fd]; 646 637 ino = filp->f_dentry->d_inode; 647 638 sock = (struct sol_socket_struct *)filp->private_data; 648 639 SOLDD(("%p %p\n", sock->pfirst, sock->pfirst ? sock->pfirst->next : NULL)); ··· 855 844 int __user *flgptr; 856 845 int flags; 857 846 int error = -EBADF; 847 + struct fdtable *fdt; 858 848 859 849 SOLD("entry"); 860 850 lock_kernel(); 861 851 if(fd >= NR_OPEN) goto out; 862 852 863 - filp = current->files->fd[fd]; 853 + fdt = files_fdtable(current->files); 854 + filp = fdt->fd[fd]; 864 855 if(!filp) goto out; 865 856 866 857 ino = filp->f_dentry->d_inode; ··· 923 910 struct strbuf ctl, dat; 924 911 int flags = (int) arg3; 925 912 int error = -EBADF; 913 + struct fdtable *fdt; 926 914 927 915 SOLD("entry"); 928 916 lock_kernel(); 929 917 if(fd >= NR_OPEN) goto out; 930 918 931 - filp = current->files->fd[fd]; 919 + fdt = files_fdtable(current->files); 920 + filp = fdt->fd[fd]; 932 921 if(!filp) goto out; 933 922 934 923 ino = filp->f_dentry->d_inode;