Commit 2923857f authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Thomas Graf

[SPARC64]: Stop referencing i_sock directly.

Use S_ISSOCK() instead.
Signed-off-by: default avatarMatthew Wilcox <matthew@wil.cx>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8709fe7b
...@@ -298,7 +298,7 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg) ...@@ -298,7 +298,7 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
if (! current->files->fd[fd] || if (! current->files->fd[fd] ||
! current->files->fd[fd]->f_dentry || ! current->files->fd[fd]->f_dentry ||
! (ino = current->files->fd[fd]->f_dentry->d_inode) || ! (ino = current->files->fd[fd]->f_dentry->d_inode) ||
! ino->i_sock) { ! S_ISSOCK(ino->i_mode)) {
spin_unlock(&current->files->file_lock); spin_unlock(&current->files->file_lock);
return TBADF; return TBADF;
} }
...@@ -478,7 +478,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd ...@@ -478,7 +478,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd
struct module_info *mi; struct module_info *mi;
ino = filp->f_dentry->d_inode; ino = filp->f_dentry->d_inode;
if (! ino->i_sock) if (!S_ISSOCK(ino->i_mode))
return -EBADF; return -EBADF;
sock = filp->private_data; sock = filp->private_data;
if (! sock) { if (! sock) {
......
...@@ -150,7 +150,7 @@ static unsigned int socksys_poll(struct file * filp, poll_table * wait) ...@@ -150,7 +150,7 @@ static unsigned int socksys_poll(struct file * filp, poll_table * wait)
unsigned int mask = 0; unsigned int mask = 0;
ino=filp->f_dentry->d_inode; ino=filp->f_dentry->d_inode;
if (ino && ino->i_sock) { if (ino && S_ISSOCK(ino->i_mode)) {
struct sol_socket_struct *sock; struct sol_socket_struct *sock;
sock = (struct sol_socket_struct*)filp->private_data; sock = (struct sol_socket_struct*)filp->private_data;
if (sock && sock->pfirst) { if (sock && sock->pfirst) {
......
...@@ -853,9 +853,7 @@ asmlinkage int solaris_getmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3) ...@@ -853,9 +853,7 @@ asmlinkage int solaris_getmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
if(!filp) goto out; if(!filp) goto out;
ino = filp->f_dentry->d_inode; ino = filp->f_dentry->d_inode;
if (!ino) goto out; if (!ino || !S_ISSOCK(ino->i_mode))
if (!ino->i_sock)
goto out; goto out;
ctlptr = (struct strbuf __user *)A(arg1); ctlptr = (struct strbuf __user *)A(arg1);
...@@ -923,7 +921,7 @@ asmlinkage int solaris_putmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3) ...@@ -923,7 +921,7 @@ asmlinkage int solaris_putmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
ino = filp->f_dentry->d_inode; ino = filp->f_dentry->d_inode;
if (!ino) goto out; if (!ino) goto out;
if (!ino->i_sock && if (!IS_SOCK(ino->i_mode) &&
(imajor(ino) != 30 || iminor(ino) != 1)) (imajor(ino) != 30 || iminor(ino) != 1))
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment