<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Dipankar Sarma &lt;dipankar@in.ibm.com&gt;

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 &lt;dipankar@in.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 arch/sparc64/solaris/timod.c |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

diff -puN arch/sparc64/solaris/timod.c~files-sparc64-fix-2 arch/sparc64/solaris/timod.c
--- devel/arch/sparc64/solaris/timod.c~files-sparc64-fix-2	2005-07-07 00:06:51.000000000 -0700
+++ devel-akpm/arch/sparc64/solaris/timod.c	2005-07-07 00:06:51.000000000 -0700
@@ -143,9 +143,11 @@ static struct T_primsg *timod_mkctl(int 
 static void timod_wake_socket(unsigned int fd)
 {
 	struct socket *sock;
+	struct fdtable *fdt;
 
 	SOLD("wakeing socket");
-	sock = SOCKET_I(current-&gt;files-&gt;fd[fd]-&gt;f_dentry-&gt;d_inode);
+	fdt = files_fdtable(current-&gt;files);
+	sock = SOCKET_I(fdt-&gt;fd[fd]-&gt;f_dentry-&gt;d_inode);
 	wake_up_interruptible(&amp;sock-&gt;wait);
 	read_lock(&amp;sock-&gt;sk-&gt;sk_callback_lock);
 	if (sock-&gt;fasync_list &amp;&amp; !test_bit(SOCK_ASYNC_WAITDATA, &amp;sock-&gt;flags))
@@ -157,9 +159,11 @@ static void timod_wake_socket(unsigned i
 static void timod_queue(unsigned int fd, struct T_primsg *it)
 {
 	struct sol_socket_struct *sock;
+	struct fdtable *fdt;
 
 	SOLD("queuing primsg");
-	sock = (struct sol_socket_struct *)current-&gt;files-&gt;fd[fd]-&gt;private_data;
+	fdt = files_fdtable(current-&gt;files);
+	sock = (struct sol_socket_struct *)fdt-&gt;fd[fd]-&gt;private_data;
 	it-&gt;next = sock-&gt;pfirst;
 	sock-&gt;pfirst = it;
 	if (!sock-&gt;plast)
@@ -171,9 +175,11 @@ static void timod_queue(unsigned int fd,
 static void timod_queue_end(unsigned int fd, struct T_primsg *it)
 {
 	struct sol_socket_struct *sock;
+	struct fdtable *fdt;
 
 	SOLD("queuing primsg at end");
-	sock = (struct sol_socket_struct *)current-&gt;files-&gt;fd[fd]-&gt;private_data;
+	fdt = files_fdtable(current-&gt;files);
+	sock = (struct sol_socket_struct *)fdt-&gt;fd[fd]-&gt;private_data;
 	it-&gt;next = NULL;
 	if (sock-&gt;plast)
 		sock-&gt;plast-&gt;next = it;
@@ -344,6 +350,7 @@ int timod_putmsg(unsigned int fd, char _
 	char *buf;
 	struct file *filp;
 	struct inode *ino;
+	struct fdtable *fdt;
 	struct sol_socket_struct *sock;
 	mm_segment_t old_fs = get_fs();
 	long args[6];
@@ -351,7 +358,9 @@ int timod_putmsg(unsigned int fd, char _
 		(int (*)(int, unsigned long __user *))SYS(socketcall);
 	int (*sys_sendto)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int) =
 		(int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int))SYS(sendto);
-	filp = current-&gt;files-&gt;fd[fd];
+
+	fdt = files_fdtable(current-&gt;files);
+	filp = fdt-&gt;fd[fd];
 	ino = filp-&gt;f_dentry-&gt;d_inode;
 	sock = (struct sol_socket_struct *)filp-&gt;private_data;
 	SOLD("entry");
@@ -620,6 +629,7 @@ int timod_getmsg(unsigned int fd, char _
 	int oldflags;
 	struct file *filp;
 	struct inode *ino;
+	struct fdtable *fdt;
 	struct sol_socket_struct *sock;
 	struct T_unitdata_ind udi;
 	mm_segment_t old_fs = get_fs();
@@ -632,7 +642,8 @@ int timod_getmsg(unsigned int fd, char _
 	
 	SOLD("entry");
 	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));
-	filp = current-&gt;files-&gt;fd[fd];
+	fdt = files_fdtable(current-&gt;files);
+	filp = fdt-&gt;fd[fd];
 	ino = filp-&gt;f_dentry-&gt;d_inode;
 	sock = (struct sol_socket_struct *)filp-&gt;private_data;
 	SOLDD(("%p %p\n", sock-&gt;pfirst, sock-&gt;pfirst ? sock-&gt;pfirst-&gt;next : NULL));
@@ -844,12 +855,14 @@ asmlinkage int solaris_getmsg(unsigned i
 	int __user *flgptr;
 	int flags;
 	int error = -EBADF;
+	struct fdtable *fdt;
 
 	SOLD("entry");
 	lock_kernel();
 	if(fd &gt;= NR_OPEN) goto out;
 
-	filp = current-&gt;files-&gt;fd[fd];
+	fdt = files_fdtable(current-&gt;files);
+	filp = fdt-&gt;fd[fd];
 	if(!filp) goto out;
 
 	ino = filp-&gt;f_dentry-&gt;d_inode;
@@ -910,12 +923,14 @@ asmlinkage int solaris_putmsg(unsigned i
 	struct strbuf ctl, dat;
 	int flags = (int) arg3;
 	int error = -EBADF;
+	struct fdtable *fdt;
 
 	SOLD("entry");
 	lock_kernel();
 	if(fd &gt;= NR_OPEN) goto out;
 
-	filp = current-&gt;files-&gt;fd[fd];
+	fdt = files_fdtable(current-&gt;files);
+	filp = fdt-&gt;fd[fd];
 	if(!filp) goto out;
 
 	ino = filp-&gt;f_dentry-&gt;d_inode;
_
</pre></body></html>