aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/solaris/timod.c
diff options
context:
space:
mode:
authorDipankar Sarma <dipankar@in.ibm.com>2005-09-09 16:04:12 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:57:55 -0400
commit6e72ad2c581de121cc7e772469e2a8f6b1fd4379 (patch)
treec6e21e0c3fb0d26c19ead93dfe00b6461cb29c66 /arch/sparc64/solaris/timod.c
parentbadf16621c1f9d1ac753be056fce11b43d6e0be5 (diff)
[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>
Diffstat (limited to 'arch/sparc64/solaris/timod.c')
-rw-r--r--arch/sparc64/solaris/timod.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/arch/sparc64/solaris/timod.c b/arch/sparc64/solaris/timod.c
index 022c80f43392..aaad29c35c83 100644
--- a/arch/sparc64/solaris/timod.c
+++ b/arch/sparc64/solaris/timod.c
@@ -143,9 +143,11 @@ static struct T_primsg *timod_mkctl(int size)
143static void timod_wake_socket(unsigned int fd) 143static void timod_wake_socket(unsigned int fd)
144{ 144{
145 struct socket *sock; 145 struct socket *sock;
146 struct fdtable *fdt;
146 147
147 SOLD("wakeing socket"); 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 wake_up_interruptible(&sock->wait); 151 wake_up_interruptible(&sock->wait);
150 read_lock(&sock->sk->sk_callback_lock); 152 read_lock(&sock->sk->sk_callback_lock);
151 if (sock->fasync_list && !test_bit(SOCK_ASYNC_WAITDATA, &sock->flags)) 153 if (sock->fasync_list && !test_bit(SOCK_ASYNC_WAITDATA, &sock->flags))
@@ -157,9 +159,11 @@ static void timod_wake_socket(unsigned int fd)
157static void timod_queue(unsigned int fd, struct T_primsg *it) 159static void timod_queue(unsigned int fd, struct T_primsg *it)
158{ 160{
159 struct sol_socket_struct *sock; 161 struct sol_socket_struct *sock;
162 struct fdtable *fdt;
160 163
161 SOLD("queuing primsg"); 164 SOLD("queuing primsg");
162 sock = (struct sol_socket_struct *)current->files->fd[fd]->private_data; 165 fdt = files_fdtable(current->files);
166 sock = (struct sol_socket_struct *)fdt->fd[fd]->private_data;
163 it->next = sock->pfirst; 167 it->next = sock->pfirst;
164 sock->pfirst = it; 168 sock->pfirst = it;
165 if (!sock->plast) 169 if (!sock->plast)
@@ -171,9 +175,11 @@ static void timod_queue(unsigned int fd, struct T_primsg *it)
171static void timod_queue_end(unsigned int fd, struct T_primsg *it) 175static void timod_queue_end(unsigned int fd, struct T_primsg *it)
172{ 176{
173 struct sol_socket_struct *sock; 177 struct sol_socket_struct *sock;
178 struct fdtable *fdt;
174 179
175 SOLD("queuing primsg at end"); 180 SOLD("queuing primsg at end");
176 sock = (struct sol_socket_struct *)current->files->fd[fd]->private_data; 181 fdt = files_fdtable(current->files);
182 sock = (struct sol_socket_struct *)fdt->fd[fd]->private_data;
177 it->next = NULL; 183 it->next = NULL;
178 if (sock->plast) 184 if (sock->plast)
179 sock->plast->next = it; 185 sock->plast->next = it;
@@ -344,6 +350,7 @@ int timod_putmsg(unsigned int fd, char __user *ctl_buf, int ctl_len,
344 char *buf; 350 char *buf;
345 struct file *filp; 351 struct file *filp;
346 struct inode *ino; 352 struct inode *ino;
353 struct fdtable *fdt;
347 struct sol_socket_struct *sock; 354 struct sol_socket_struct *sock;
348 mm_segment_t old_fs = get_fs(); 355 mm_segment_t old_fs = get_fs();
349 long args[6]; 356 long args[6];
@@ -351,7 +358,9 @@ int timod_putmsg(unsigned int fd, char __user *ctl_buf, int ctl_len,
351 (int (*)(int, unsigned long __user *))SYS(socketcall); 358 (int (*)(int, unsigned long __user *))SYS(socketcall);
352 int (*sys_sendto)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int) = 359 int (*sys_sendto)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int) =
353 (int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int))SYS(sendto); 360 (int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int))SYS(sendto);
354 filp = current->files->fd[fd]; 361
362 fdt = files_fdtable(current->files);
363 filp = fdt->fd[fd];
355 ino = filp->f_dentry->d_inode; 364 ino = filp->f_dentry->d_inode;
356 sock = (struct sol_socket_struct *)filp->private_data; 365 sock = (struct sol_socket_struct *)filp->private_data;
357 SOLD("entry"); 366 SOLD("entry");
@@ -620,6 +629,7 @@ int timod_getmsg(unsigned int fd, char __user *ctl_buf, int ctl_maxlen, s32 __us
620 int oldflags; 629 int oldflags;
621 struct file *filp; 630 struct file *filp;
622 struct inode *ino; 631 struct inode *ino;
632 struct fdtable *fdt;
623 struct sol_socket_struct *sock; 633 struct sol_socket_struct *sock;
624 struct T_unitdata_ind udi; 634 struct T_unitdata_ind udi;
625 mm_segment_t old_fs = get_fs(); 635 mm_segment_t old_fs = get_fs();
@@ -632,7 +642,8 @@ int timod_getmsg(unsigned int fd, char __user *ctl_buf, int ctl_maxlen, s32 __us
632 642
633 SOLD("entry"); 643 SOLD("entry");
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)); 644 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));
635 filp = current->files->fd[fd]; 645 fdt = files_fdtable(current->files);
646 filp = fdt->fd[fd];
636 ino = filp->f_dentry->d_inode; 647 ino = filp->f_dentry->d_inode;
637 sock = (struct sol_socket_struct *)filp->private_data; 648 sock = (struct sol_socket_struct *)filp->private_data;
638 SOLDD(("%p %p\n", sock->pfirst, sock->pfirst ? sock->pfirst->next : NULL)); 649 SOLDD(("%p %p\n", sock->pfirst, sock->pfirst ? sock->pfirst->next : NULL));
@@ -844,12 +855,14 @@ asmlinkage int solaris_getmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
844 int __user *flgptr; 855 int __user *flgptr;
845 int flags; 856 int flags;
846 int error = -EBADF; 857 int error = -EBADF;
858 struct fdtable *fdt;
847 859
848 SOLD("entry"); 860 SOLD("entry");
849 lock_kernel(); 861 lock_kernel();
850 if(fd >= NR_OPEN) goto out; 862 if(fd >= NR_OPEN) goto out;
851 863
852 filp = current->files->fd[fd]; 864 fdt = files_fdtable(current->files);
865 filp = fdt->fd[fd];
853 if(!filp) goto out; 866 if(!filp) goto out;
854 867
855 ino = filp->f_dentry->d_inode; 868 ino = filp->f_dentry->d_inode;
@@ -910,12 +923,14 @@ asmlinkage int solaris_putmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
910 struct strbuf ctl, dat; 923 struct strbuf ctl, dat;
911 int flags = (int) arg3; 924 int flags = (int) arg3;
912 int error = -EBADF; 925 int error = -EBADF;
926 struct fdtable *fdt;
913 927
914 SOLD("entry"); 928 SOLD("entry");
915 lock_kernel(); 929 lock_kernel();
916 if(fd >= NR_OPEN) goto out; 930 if(fd >= NR_OPEN) goto out;
917 931
918 filp = current->files->fd[fd]; 932 fdt = files_fdtable(current->files);
933 filp = fdt->fd[fd];
919 if(!filp) goto out; 934 if(!filp) goto out;
920 935
921 ino = filp->f_dentry->d_inode; 936 ino = filp->f_dentry->d_inode;