Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
628561a6
Commit
628561a6
authored
Feb 05, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Feb 05, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] (1/2) inode trimming
more inode->u trimming - socket_i is killed.
parent
676952b9
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
128 additions
and
105 deletions
+128
-105
arch/sparc/kernel/sys_sunos.c
arch/sparc/kernel/sys_sunos.c
+1
-1
arch/sparc64/kernel/sys_sunos32.c
arch/sparc64/kernel/sys_sunos32.c
+1
-1
arch/sparc64/solaris/ioctl.c
arch/sparc64/solaris/ioctl.c
+5
-5
arch/sparc64/solaris/socket.c
arch/sparc64/solaris/socket.c
+2
-8
arch/sparc64/solaris/socksys.c
arch/sparc64/solaris/socksys.c
+11
-1
arch/sparc64/solaris/timod.c
arch/sparc64/solaris/timod.c
+3
-3
drivers/block/nbd.c
drivers/block/nbd.c
+7
-4
fs/ncpfs/inode.c
fs/ncpfs/inode.c
+1
-1
fs/ncpfs/sock.c
fs/ncpfs/sock.c
+4
-4
fs/smbfs/sock.c
fs/smbfs/sock.c
+2
-2
include/linux/fs.h
include/linux/fs.h
+15
-1
include/linux/net.h
include/linux/net.h
+1
-3
include/net/sock.h
include/net/sock.h
+2
-2
net/ax25/af_ax25.c
net/ax25/af_ax25.c
+1
-1
net/ipv6/icmp.c
net/ipv6/icmp.c
+2
-12
net/ipv6/mcast.c
net/ipv6/mcast.c
+2
-12
net/ipv6/ndisc.c
net/ipv6/ndisc.c
+2
-12
net/netrom/af_netrom.c
net/netrom/af_netrom.c
+1
-1
net/packet/af_packet.c
net/packet/af_packet.c
+2
-2
net/rose/af_rose.c
net/rose/af_rose.c
+1
-1
net/socket.c
net/socket.c
+59
-25
net/unix/af_unix.c
net/unix/af_unix.c
+1
-1
net/unix/garbage.c
net/unix/garbage.c
+1
-1
net/x25/af_x25.c
net/x25/af_x25.c
+1
-1
No files found.
arch/sparc/kernel/sys_sunos.c
View file @
628561a6
...
@@ -646,7 +646,7 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr)
...
@@ -646,7 +646,7 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr)
inode
=
file
->
f_dentry
->
d_inode
;
inode
=
file
->
f_dentry
->
d_inode
;
socket
=
&
inode
->
u
.
socket_i
;
socket
=
SOCKET_I
(
inode
)
;
local
.
sin_family
=
AF_INET
;
local
.
sin_family
=
AF_INET
;
local
.
sin_addr
.
s_addr
=
INADDR_ANY
;
local
.
sin_addr
.
s_addr
=
INADDR_ANY
;
...
...
arch/sparc64/kernel/sys_sunos32.c
View file @
628561a6
...
@@ -612,7 +612,7 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr)
...
@@ -612,7 +612,7 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr)
inode
=
file
->
f_dentry
->
d_inode
;
inode
=
file
->
f_dentry
->
d_inode
;
socket
=
&
inode
->
u
.
socket_i
;
socket
=
SOCKET_I
(
inode
)
;
local
.
sin_family
=
AF_INET
;
local
.
sin_family
=
AF_INET
;
local
.
sin_addr
.
s_addr
=
INADDR_ANY
;
local
.
sin_addr
.
s_addr
=
INADDR_ANY
;
...
...
arch/sparc64/solaris/ioctl.c
View file @
628561a6
...
@@ -308,7 +308,7 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
...
@@ -308,7 +308,7 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
case
110
:
/* SI_GETUDATA */
case
110
:
/* SI_GETUDATA */
{
{
int
etsdusize
,
servtype
;
int
etsdusize
,
servtype
;
switch
(
ino
->
u
.
socket_i
.
type
)
{
switch
(
SOCKET_I
(
ino
)
->
type
)
{
case
SOCK_STREAM
:
case
SOCK_STREAM
:
etsdusize
=
1
;
etsdusize
=
1
;
servtype
=
2
;
servtype
=
2
;
...
@@ -326,16 +326,16 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
...
@@ -326,16 +326,16 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
__put_user
(
0
,
&
((
struct
solaris_si_udata
*
)
A
(
arg
))
->
so_state
)
||
__put_user
(
0
,
&
((
struct
solaris_si_udata
*
)
A
(
arg
))
->
so_state
)
||
__put_user
(
0
,
&
((
struct
solaris_si_udata
*
)
A
(
arg
))
->
so_options
)
||
__put_user
(
0
,
&
((
struct
solaris_si_udata
*
)
A
(
arg
))
->
so_options
)
||
__put_user
(
16384
,
&
((
struct
solaris_si_udata
*
)
A
(
arg
))
->
tsdusize
)
||
__put_user
(
16384
,
&
((
struct
solaris_si_udata
*
)
A
(
arg
))
->
tsdusize
)
||
__put_user
(
ino
->
u
.
socket_i
.
ops
->
family
,
&
((
struct
solaris_si_udata
*
)
A
(
arg
))
->
sockparams
.
sp_family
)
||
__put_user
(
SOCKET_I
(
ino
)
->
ops
->
family
,
&
((
struct
solaris_si_udata
*
)
A
(
arg
))
->
sockparams
.
sp_family
)
||
__put_user
(
ino
->
u
.
socket_i
.
type
,
&
((
struct
solaris_si_udata
*
)
A
(
arg
))
->
sockparams
.
sp_type
)
||
__put_user
(
SOCKET_I
(
ino
)
->
type
,
&
((
struct
solaris_si_udata
*
)
A
(
arg
))
->
sockparams
.
sp_type
)
||
__put_user
(
ino
->
u
.
socket_i
.
ops
->
family
,
&
((
struct
solaris_si_udata
*
)
A
(
arg
))
->
sockparams
.
sp_protocol
))
__put_user
(
SOCKET_I
(
ino
)
->
ops
->
family
,
&
((
struct
solaris_si_udata
*
)
A
(
arg
))
->
sockparams
.
sp_protocol
))
return
(
EFAULT
<<
8
)
|
TSYSERR
;
return
(
EFAULT
<<
8
)
|
TSYSERR
;
return
0
;
return
0
;
}
}
case
101
:
/* O_SI_GETUDATA */
case
101
:
/* O_SI_GETUDATA */
{
{
int
etsdusize
,
servtype
;
int
etsdusize
,
servtype
;
switch
(
ino
->
u
.
socket_i
.
type
)
{
switch
(
SOCKET_I
(
ino
)
->
type
)
{
case
SOCK_STREAM
:
case
SOCK_STREAM
:
etsdusize
=
1
;
etsdusize
=
1
;
servtype
=
2
;
servtype
=
2
;
...
...
arch/sparc64/solaris/socket.c
View file @
628561a6
...
@@ -248,12 +248,6 @@ asmlinkage int solaris_getsockname(int fd, struct sockaddr *addr, int *addrlen)
...
@@ -248,12 +248,6 @@ asmlinkage int solaris_getsockname(int fd, struct sockaddr *addr, int *addrlen)
24 for IPv6,
24 for IPv6,
about 80 for AX.25 */
about 80 for AX.25 */
/* XXX These as well... */
extern
__inline__
struct
socket
*
socki_lookup
(
struct
inode
*
inode
)
{
return
&
inode
->
u
.
socket_i
;
}
extern
__inline__
struct
socket
*
sockfd_lookup
(
int
fd
,
int
*
err
)
extern
__inline__
struct
socket
*
sockfd_lookup
(
int
fd
,
int
*
err
)
{
{
struct
file
*
file
;
struct
file
*
file
;
...
@@ -265,13 +259,13 @@ extern __inline__ struct socket *sockfd_lookup(int fd, int *err)
...
@@ -265,13 +259,13 @@ extern __inline__ struct socket *sockfd_lookup(int fd, int *err)
}
}
inode
=
file
->
f_dentry
->
d_inode
;
inode
=
file
->
f_dentry
->
d_inode
;
if
(
!
inode
->
i_sock
||
!
socki_lookup
(
inode
)
)
{
if
(
!
inode
->
i_sock
)
{
*
err
=
-
ENOTSOCK
;
*
err
=
-
ENOTSOCK
;
fput
(
file
);
fput
(
file
);
return
NULL
;
return
NULL
;
}
}
return
socki_lookup
(
inode
);
return
SOCKET_I
(
inode
);
}
}
extern
__inline__
void
sockfd_put
(
struct
socket
*
sock
)
extern
__inline__
void
sockfd_put
(
struct
socket
*
sock
)
...
...
arch/sparc64/solaris/socksys.c
View file @
628561a6
...
@@ -6,6 +6,13 @@
...
@@ -6,6 +6,13 @@
* Copyright (C) 1995, 1996 Mike Jagdis (jaggy@purplet.demon.co.uk)
* Copyright (C) 1995, 1996 Mike Jagdis (jaggy@purplet.demon.co.uk)
*/
*/
/*
* Dave, _please_ give me specifications on this fscking mess so that I
* could at least get it into the state when it wouldn't screw the rest of
* the kernel over. socksys.c and timod.c _stink_ and we are not talking
* H2S here, it's isopropilmercaptan in concentrations way over LD50. -- AV
*/
#include <linux/types.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/sched.h>
...
@@ -86,6 +93,9 @@ static int socksys_open(struct inode * inode, struct file * filp)
...
@@ -86,6 +93,9 @@ static int socksys_open(struct inode * inode, struct file * filp)
return
fd
;
return
fd
;
/*
/*
* N.B. The following operations are not legal!
* N.B. The following operations are not legal!
*
* No shit. WTF is it supposed to do, anyway?
*
* Try instead:
* Try instead:
* d_delete(filp->f_dentry), then d_instantiate with sock inode
* d_delete(filp->f_dentry), then d_instantiate with sock inode
*/
*/
...
@@ -93,7 +103,7 @@ static int socksys_open(struct inode * inode, struct file * filp)
...
@@ -93,7 +103,7 @@ static int socksys_open(struct inode * inode, struct file * filp)
filp
->
f_dentry
=
dget
(
fcheck
(
fd
)
->
f_dentry
);
filp
->
f_dentry
=
dget
(
fcheck
(
fd
)
->
f_dentry
);
filp
->
f_dentry
->
d_inode
->
i_rdev
=
inode
->
i_rdev
;
filp
->
f_dentry
->
d_inode
->
i_rdev
=
inode
->
i_rdev
;
filp
->
f_dentry
->
d_inode
->
i_flock
=
inode
->
i_flock
;
filp
->
f_dentry
->
d_inode
->
i_flock
=
inode
->
i_flock
;
filp
->
f_dentry
->
d_inode
->
u
.
socket_i
.
file
=
filp
;
SOCKET_I
(
filp
->
f_dentry
->
d_inode
)
->
file
=
filp
;
filp
->
f_op
=
&
socksys_file_ops
;
filp
->
f_op
=
&
socksys_file_ops
;
sock
=
(
struct
sol_socket_struct
*
)
sock
=
(
struct
sol_socket_struct
*
)
mykmalloc
(
sizeof
(
struct
sol_socket_struct
),
GFP_KERNEL
);
mykmalloc
(
sizeof
(
struct
sol_socket_struct
),
GFP_KERNEL
);
...
...
arch/sparc64/solaris/timod.c
View file @
628561a6
...
@@ -149,7 +149,7 @@ static void timod_wake_socket(unsigned int fd)
...
@@ -149,7 +149,7 @@ static void timod_wake_socket(unsigned int fd)
struct
socket
*
sock
;
struct
socket
*
sock
;
SOLD
(
"wakeing socket"
);
SOLD
(
"wakeing socket"
);
sock
=
&
current
->
files
->
fd
[
fd
]
->
f_dentry
->
d_inode
->
u
.
socket_i
;
sock
=
SOCKET_I
(
current
->
files
->
fd
[
fd
]
->
f_dentry
->
d_inode
)
;
wake_up_interruptible
(
&
sock
->
wait
);
wake_up_interruptible
(
&
sock
->
wait
);
read_lock
(
&
sock
->
sk
->
callback_lock
);
read_lock
(
&
sock
->
sk
->
callback_lock
);
if
(
sock
->
fasync_list
&&
!
test_bit
(
SOCK_ASYNC_WAITDATA
,
&
sock
->
flags
))
if
(
sock
->
fasync_list
&&
!
test_bit
(
SOCK_ASYNC_WAITDATA
,
&
sock
->
flags
))
...
@@ -640,7 +640,7 @@ int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, s32 *ctl_len,
...
@@ -640,7 +640,7 @@ int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, s32 *ctl_len,
ino
=
filp
->
f_dentry
->
d_inode
;
ino
=
filp
->
f_dentry
->
d_inode
;
sock
=
(
struct
sol_socket_struct
*
)
filp
->
private_data
;
sock
=
(
struct
sol_socket_struct
*
)
filp
->
private_data
;
SOLDD
((
"%p %p
\n
"
,
sock
->
pfirst
,
sock
->
pfirst
?
sock
->
pfirst
->
next
:
NULL
));
SOLDD
((
"%p %p
\n
"
,
sock
->
pfirst
,
sock
->
pfirst
?
sock
->
pfirst
->
next
:
NULL
));
if
(
ctl_maxlen
>
0
&&
!
sock
->
pfirst
&&
ino
->
u
.
socket_i
.
type
==
SOCK_STREAM
if
(
ctl_maxlen
>
0
&&
!
sock
->
pfirst
&&
SOCKET_I
(
ino
)
->
type
==
SOCK_STREAM
&&
sock
->
state
==
TS_IDLE
)
{
&&
sock
->
state
==
TS_IDLE
)
{
SOLD
(
"calling LISTEN"
);
SOLD
(
"calling LISTEN"
);
args
[
0
]
=
fd
;
args
[
0
]
=
fd
;
...
@@ -730,7 +730,7 @@ int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, s32 *ctl_len,
...
@@ -730,7 +730,7 @@ int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, s32 *ctl_len,
*
flags_p
=
0
;
*
flags_p
=
0
;
if
(
ctl_maxlen
>=
0
)
{
if
(
ctl_maxlen
>=
0
)
{
SOLD
(
"ACCEPT perhaps?"
);
SOLD
(
"ACCEPT perhaps?"
);
if
(
ino
->
u
.
socket_i
.
type
==
SOCK_STREAM
&&
sock
->
state
==
TS_IDLE
)
{
if
(
SOCKET_I
(
ino
)
->
type
==
SOCK_STREAM
&&
sock
->
state
==
TS_IDLE
)
{
struct
T_conn_ind
ind
;
struct
T_conn_ind
ind
;
char
*
buf
=
getpage
();
char
*
buf
=
getpage
();
int
len
=
BUF_SIZE
;
int
len
=
BUF_SIZE
;
...
...
drivers/block/nbd.c
View file @
628561a6
...
@@ -418,10 +418,13 @@ static int nbd_ioctl(struct inode *inode, struct file *file,
...
@@ -418,10 +418,13 @@ static int nbd_ioctl(struct inode *inode, struct file *file,
file
=
fget
(
arg
);
file
=
fget
(
arg
);
if
(
file
)
{
if
(
file
)
{
inode
=
file
->
f_dentry
->
d_inode
;
inode
=
file
->
f_dentry
->
d_inode
;
/* N.B. Should verify that it's a socket */
if
(
inode
->
i_sock
)
{
lo
->
file
=
file
;
lo
->
file
=
file
;
lo
->
sock
=
&
inode
->
u
.
socket_i
;
lo
->
sock
=
SOCKET_I
(
inode
);
error
=
0
;
error
=
0
;
}
else
{
fput
(
file
);
}
}
}
return
error
;
return
error
;
case
NBD_SET_BLKSIZE
:
case
NBD_SET_BLKSIZE
:
...
...
fs/ncpfs/inode.c
View file @
628561a6
...
@@ -365,7 +365,7 @@ ncp_read_super(struct super_block *sb, void *raw_data, int silent)
...
@@ -365,7 +365,7 @@ ncp_read_super(struct super_block *sb, void *raw_data, int silent)
sock_inode
=
ncp_filp
->
f_dentry
->
d_inode
;
sock_inode
=
ncp_filp
->
f_dentry
->
d_inode
;
if
(
!
S_ISSOCK
(
sock_inode
->
i_mode
))
if
(
!
S_ISSOCK
(
sock_inode
->
i_mode
))
goto
out_bad_file2
;
goto
out_bad_file2
;
sock
=
&
sock_inode
->
u
.
socket_i
;
sock
=
SOCKET_I
(
sock_inode
)
;
if
(
!
sock
)
if
(
!
sock
)
goto
out_bad_file2
;
goto
out_bad_file2
;
...
...
fs/ncpfs/sock.c
View file @
628561a6
...
@@ -101,7 +101,7 @@ static int do_ncp_rpc_call(struct ncp_server *server, int size,
...
@@ -101,7 +101,7 @@ static int do_ncp_rpc_call(struct ncp_server *server, int size,
struct
ncp_reply_header
reply
;
struct
ncp_reply_header
reply
;
file
=
server
->
ncp_filp
;
file
=
server
->
ncp_filp
;
sock
=
&
file
->
f_dentry
->
d_inode
->
u
.
socket_i
;
sock
=
SOCKET_I
(
file
->
f_dentry
->
d_inode
)
;
init_timeout
=
server
->
m
.
time_out
;
init_timeout
=
server
->
m
.
time_out
;
max_timeout
=
NCP_MAX_RPC_TIMEOUT
;
max_timeout
=
NCP_MAX_RPC_TIMEOUT
;
...
@@ -269,7 +269,7 @@ static int do_tcp_rcv(struct ncp_server *server, void *buffer, size_t len) {
...
@@ -269,7 +269,7 @@ static int do_tcp_rcv(struct ncp_server *server, void *buffer, size_t len) {
int
result
=
0
;
int
result
=
0
;
file
=
server
->
ncp_filp
;
file
=
server
->
ncp_filp
;
sock
=
&
file
->
f_dentry
->
d_inode
->
u
.
socket_i
;
sock
=
SOCKET_I
(
file
->
f_dentry
->
d_inode
)
;
dataread
=
0
;
dataread
=
0
;
...
@@ -348,7 +348,7 @@ static int do_ncp_tcp_rpc_call(struct ncp_server *server, int size,
...
@@ -348,7 +348,7 @@ static int do_ncp_tcp_rpc_call(struct ncp_server *server, int size,
*
((
struct
ncp_request_header
*
)
(
server
->
packet
));
*
((
struct
ncp_request_header
*
)
(
server
->
packet
));
file
=
server
->
ncp_filp
;
file
=
server
->
ncp_filp
;
sock
=
&
file
->
f_dentry
->
d_inode
->
u
.
socket_i
;
sock
=
SOCKET_I
(
file
->
f_dentry
->
d_inode
)
;
ncptcp_xmit_hdr
[
0
]
=
htonl
(
NCP_TCP_XMIT_MAGIC
);
ncptcp_xmit_hdr
[
0
]
=
htonl
(
NCP_TCP_XMIT_MAGIC
);
ncptcp_xmit_hdr
[
1
]
=
htonl
(
size
+
16
);
ncptcp_xmit_hdr
[
1
]
=
htonl
(
size
+
16
);
...
@@ -444,7 +444,7 @@ static int ncp_do_request(struct ncp_server *server, int size,
...
@@ -444,7 +444,7 @@ static int ncp_do_request(struct ncp_server *server, int size,
}
}
#endif
/* CONFIG_NCPFS_PACKET_SIGNING */
#endif
/* CONFIG_NCPFS_PACKET_SIGNING */
file
=
server
->
ncp_filp
;
file
=
server
->
ncp_filp
;
sock
=
&
file
->
f_dentry
->
d_inode
->
u
.
socket_i
;
sock
=
SOCKET_I
(
file
->
f_dentry
->
d_inode
)
;
/* N.B. this isn't needed ... check socket type? */
/* N.B. this isn't needed ... check socket type? */
if
(
!
sock
)
{
if
(
!
sock
)
{
printk
(
KERN_ERR
"ncp_rpc_call: socki_lookup failed
\n
"
);
printk
(
KERN_ERR
"ncp_rpc_call: socki_lookup failed
\n
"
);
...
...
fs/smbfs/sock.c
View file @
628561a6
...
@@ -176,7 +176,7 @@ int
...
@@ -176,7 +176,7 @@ int
smb_valid_socket
(
struct
inode
*
inode
)
smb_valid_socket
(
struct
inode
*
inode
)
{
{
return
(
inode
&&
S_ISSOCK
(
inode
->
i_mode
)
&&
return
(
inode
&&
S_ISSOCK
(
inode
->
i_mode
)
&&
inode
->
u
.
socket_i
.
type
==
SOCK_STREAM
);
SOCKET_I
(
inode
)
->
type
==
SOCK_STREAM
);
}
}
static
struct
socket
*
static
struct
socket
*
...
@@ -190,7 +190,7 @@ server_sock(struct smb_sb_info *server)
...
@@ -190,7 +190,7 @@ server_sock(struct smb_sb_info *server)
if
(
!
smb_valid_socket
(
file
->
f_dentry
->
d_inode
))
if
(
!
smb_valid_socket
(
file
->
f_dentry
->
d_inode
))
PARANOIA
(
"bad socket!
\n
"
);
PARANOIA
(
"bad socket!
\n
"
);
#endif
#endif
return
&
file
->
f_dentry
->
d_inode
->
u
.
socket_i
;
return
SOCKET_I
(
file
->
f_dentry
->
d_inode
)
;
}
}
return
NULL
;
return
NULL
;
}
}
...
...
include/linux/fs.h
View file @
628561a6
...
@@ -456,11 +456,25 @@ struct inode {
...
@@ -456,11 +456,25 @@ struct inode {
/* struct umsdos_inode_info umsdos_i; */
/* struct umsdos_inode_info umsdos_i; */
struct
romfs_inode_info
romfs_i
;
struct
romfs_inode_info
romfs_i
;
struct
proc_inode_info
proc_i
;
struct
proc_inode_info
proc_i
;
struct
socket
socket_i
;
void
*
generic_ip
;
void
*
generic_ip
;
}
u
;
}
u
;
};
};
struct
socket_alloc
{
struct
socket
socket
;
struct
inode
vfs_inode
;
};
static
inline
struct
socket
*
SOCKET_I
(
struct
inode
*
inode
)
{
return
&
list_entry
(
inode
,
struct
socket_alloc
,
vfs_inode
)
->
socket
;
}
static
inline
struct
inode
*
SOCK_INODE
(
struct
socket
*
socket
)
{
return
&
list_entry
(
socket
,
struct
socket_alloc
,
socket
)
->
vfs_inode
;
}
#include <linux/shmem_fs.h>
#include <linux/shmem_fs.h>
/* will die */
/* will die */
#include <linux/coda_fs_i.h>
#include <linux/coda_fs_i.h>
...
...
include/linux/net.h
View file @
628561a6
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <linux/wait.h>
#include <linux/wait.h>
struct
poll_table_struct
;
struct
poll_table_struct
;
struct
inode
;
#define NPROTO 32
/* should be enough for now.. */
#define NPROTO 32
/* should be enough for now.. */
...
@@ -68,7 +69,6 @@ struct socket
...
@@ -68,7 +69,6 @@ struct socket
unsigned
long
flags
;
unsigned
long
flags
;
struct
proto_ops
*
ops
;
struct
proto_ops
*
ops
;
struct
inode
*
inode
;
struct
fasync_struct
*
fasync_list
;
/* Asynchronous wake up list */
struct
fasync_struct
*
fasync_list
;
/* Asynchronous wake up list */
struct
file
*
file
;
/* File back pointer for gc */
struct
file
*
file
;
/* File back pointer for gc */
struct
sock
*
sk
;
struct
sock
*
sk
;
...
@@ -78,8 +78,6 @@ struct socket
...
@@ -78,8 +78,6 @@ struct socket
unsigned
char
passcred
;
unsigned
char
passcred
;
};
};
#define SOCK_INODE(S) ((S)->inode)
struct
scm_cookie
;
struct
scm_cookie
;
struct
vm_area_struct
;
struct
vm_area_struct
;
struct
page
;
struct
page
;
...
...
include/net/sock.h
View file @
628561a6
...
@@ -1022,7 +1022,7 @@ static inline int sock_i_uid(struct sock *sk)
...
@@ -1022,7 +1022,7 @@ static inline int sock_i_uid(struct sock *sk)
int
uid
;
int
uid
;
read_lock
(
&
sk
->
callback_lock
);
read_lock
(
&
sk
->
callback_lock
);
uid
=
sk
->
socket
?
sk
->
socket
->
inode
->
i_uid
:
0
;
uid
=
sk
->
socket
?
SOCK_INODE
(
sk
->
socket
)
->
i_uid
:
0
;
read_unlock
(
&
sk
->
callback_lock
);
read_unlock
(
&
sk
->
callback_lock
);
return
uid
;
return
uid
;
}
}
...
@@ -1032,7 +1032,7 @@ static inline unsigned long sock_i_ino(struct sock *sk)
...
@@ -1032,7 +1032,7 @@ static inline unsigned long sock_i_ino(struct sock *sk)
unsigned
long
ino
;
unsigned
long
ino
;
read_lock
(
&
sk
->
callback_lock
);
read_lock
(
&
sk
->
callback_lock
);
ino
=
sk
->
socket
?
sk
->
socket
->
inode
->
i_ino
:
0
;
ino
=
sk
->
socket
?
SOCK_INODE
(
sk
->
socket
)
->
i_ino
:
0
;
read_unlock
(
&
sk
->
callback_lock
);
read_unlock
(
&
sk
->
callback_lock
);
return
ino
;
return
ino
;
}
}
...
...
net/ax25/af_ax25.c
View file @
628561a6
...
@@ -1756,7 +1756,7 @@ static int ax25_get_info(char *buffer, char **start, off_t offset, int length)
...
@@ -1756,7 +1756,7 @@ static int ax25_get_info(char *buffer, char **start, off_t offset, int length)
len
+=
sprintf
(
buffer
+
len
,
" %d %d %ld
\n
"
,
len
+=
sprintf
(
buffer
+
len
,
" %d %d %ld
\n
"
,
atomic_read
(
&
ax25
->
sk
->
wmem_alloc
),
atomic_read
(
&
ax25
->
sk
->
wmem_alloc
),
atomic_read
(
&
ax25
->
sk
->
rmem_alloc
),
atomic_read
(
&
ax25
->
sk
->
rmem_alloc
),
ax25
->
sk
->
socket
!=
NULL
?
ax25
->
sk
->
socket
->
inode
->
i_ino
:
0L
);
ax25
->
sk
->
socket
!=
NULL
?
SOCK_INODE
(
ax25
->
sk
->
socket
)
->
i_ino
:
0L
);
}
else
{
}
else
{
len
+=
sprintf
(
buffer
+
len
,
" * * *
\n
"
);
len
+=
sprintf
(
buffer
+
len
,
" * * *
\n
"
);
}
}
...
...
net/ipv6/icmp.c
View file @
628561a6
...
@@ -637,21 +637,11 @@ int __init icmpv6_init(struct net_proto_family *ops)
...
@@ -637,21 +637,11 @@ int __init icmpv6_init(struct net_proto_family *ops)
struct
sock
*
sk
;
struct
sock
*
sk
;
int
err
;
int
err
;
icmpv6_socket
=
sock_alloc
();
err
=
sock_create
(
PF_INET6
,
SOCK_RAW
,
IPPROTO_ICMPV6
,
&
icmpv6_socket
);
if
(
icmpv6_socket
==
NULL
)
{
if
(
err
<
0
)
{
printk
(
KERN_ERR
"Failed to create the ICMP6 control socket.
\n
"
);
return
-
1
;
}
icmpv6_socket
->
inode
->
i_uid
=
0
;
icmpv6_socket
->
inode
->
i_gid
=
0
;
icmpv6_socket
->
type
=
SOCK_RAW
;
if
((
err
=
ops
->
create
(
icmpv6_socket
,
IPPROTO_ICMPV6
))
<
0
)
{
printk
(
KERN_ERR
printk
(
KERN_ERR
"Failed to initialize the ICMP6 control socket (err %d).
\n
"
,
"Failed to initialize the ICMP6 control socket (err %d).
\n
"
,
err
);
err
);
sock_release
(
icmpv6_socket
);
icmpv6_socket
=
NULL
;
/* for safety */
icmpv6_socket
=
NULL
;
/* for safety */
return
err
;
return
err
;
}
}
...
...
net/ipv6/mcast.c
View file @
628561a6
...
@@ -751,21 +751,11 @@ int __init igmp6_init(struct net_proto_family *ops)
...
@@ -751,21 +751,11 @@ int __init igmp6_init(struct net_proto_family *ops)
struct
sock
*
sk
;
struct
sock
*
sk
;
int
err
;
int
err
;
igmp6_socket
=
sock_alloc
(
);
err
=
sock_create
(
PF_INET6
,
SOCK_RAW
,
IPPROTO_ICMPV6
,
&
igmp6_socket
);
if
(
igmp6_socket
==
NULL
)
{
if
(
err
<
0
)
{
printk
(
KERN_ERR
printk
(
KERN_ERR
"Failed to create the IGMP6 control socket.
\n
"
);
return
-
1
;
}
igmp6_socket
->
inode
->
i_uid
=
0
;
igmp6_socket
->
inode
->
i_gid
=
0
;
igmp6_socket
->
type
=
SOCK_RAW
;
if
((
err
=
ops
->
create
(
igmp6_socket
,
IPPROTO_ICMPV6
))
<
0
)
{
printk
(
KERN_DEBUG
"Failed to initialize the IGMP6 control socket (err %d).
\n
"
,
"Failed to initialize the IGMP6 control socket (err %d).
\n
"
,
err
);
err
);
sock_release
(
igmp6_socket
);
igmp6_socket
=
NULL
;
/* For safety. */
igmp6_socket
=
NULL
;
/* For safety. */
return
err
;
return
err
;
}
}
...
...
net/ipv6/ndisc.c
View file @
628561a6
...
@@ -1214,21 +1214,11 @@ int __init ndisc_init(struct net_proto_family *ops)
...
@@ -1214,21 +1214,11 @@ int __init ndisc_init(struct net_proto_family *ops)
struct
sock
*
sk
;
struct
sock
*
sk
;
int
err
;
int
err
;
ndisc_socket
=
sock_alloc
(
);
err
=
sock_create
(
PF_INET6
,
SOCK_RAW
,
IPPROTO_ICMPV6
,
&
ndisc_socket
);
if
(
ndisc_socket
==
NULL
)
{
if
(
err
<
0
)
{
printk
(
KERN_ERR
printk
(
KERN_ERR
"Failed to create the NDISC control socket.
\n
"
);
return
-
1
;
}
ndisc_socket
->
inode
->
i_uid
=
0
;
ndisc_socket
->
inode
->
i_gid
=
0
;
ndisc_socket
->
type
=
SOCK_RAW
;
if
((
err
=
ops
->
create
(
ndisc_socket
,
IPPROTO_ICMPV6
))
<
0
)
{
printk
(
KERN_DEBUG
"Failed to initialize the NDISC control socket (err %d).
\n
"
,
"Failed to initialize the NDISC control socket (err %d).
\n
"
,
err
);
err
);
sock_release
(
ndisc_socket
);
ndisc_socket
=
NULL
;
/* For safety. */
ndisc_socket
=
NULL
;
/* For safety. */
return
err
;
return
err
;
}
}
...
...
net/netrom/af_netrom.c
View file @
628561a6
...
@@ -1204,7 +1204,7 @@ static int nr_get_info(char *buffer, char **start, off_t offset, int length)
...
@@ -1204,7 +1204,7 @@ static int nr_get_info(char *buffer, char **start, off_t offset, int length)
s
->
protinfo
.
nr
->
window
,
s
->
protinfo
.
nr
->
window
,
atomic_read
(
&
s
->
wmem_alloc
),
atomic_read
(
&
s
->
wmem_alloc
),
atomic_read
(
&
s
->
rmem_alloc
),
atomic_read
(
&
s
->
rmem_alloc
),
s
->
socket
!=
NULL
?
s
->
socket
->
inode
->
i_ino
:
0L
);
s
->
socket
!=
NULL
?
SOCK_INODE
(
s
->
socket
)
->
i_ino
:
0L
);
pos
=
begin
+
len
;
pos
=
begin
+
len
;
...
...
net/packet/af_packet.c
View file @
628561a6
...
@@ -1575,7 +1575,7 @@ static void packet_mm_open(struct vm_area_struct *vma)
...
@@ -1575,7 +1575,7 @@ static void packet_mm_open(struct vm_area_struct *vma)
{
{
struct
file
*
file
=
vma
->
vm_file
;
struct
file
*
file
=
vma
->
vm_file
;
struct
inode
*
inode
=
file
->
f_dentry
->
d_inode
;
struct
inode
*
inode
=
file
->
f_dentry
->
d_inode
;
struct
socket
*
sock
=
&
inode
->
u
.
socket_i
;
struct
socket
*
sock
=
SOCKET_I
(
inode
)
;
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
if
(
sk
)
if
(
sk
)
...
@@ -1586,7 +1586,7 @@ static void packet_mm_close(struct vm_area_struct *vma)
...
@@ -1586,7 +1586,7 @@ static void packet_mm_close(struct vm_area_struct *vma)
{
{
struct
file
*
file
=
vma
->
vm_file
;
struct
file
*
file
=
vma
->
vm_file
;
struct
inode
*
inode
=
file
->
f_dentry
->
d_inode
;
struct
inode
*
inode
=
file
->
f_dentry
->
d_inode
;
struct
socket
*
sock
=
&
inode
->
u
.
socket_i
;
struct
socket
*
sock
=
SOCKET_I
(
inode
)
;
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
if
(
sk
)
if
(
sk
)
...
...
net/rose/af_rose.c
View file @
628561a6
...
@@ -1370,7 +1370,7 @@ static int rose_get_info(char *buffer, char **start, off_t offset, int length)
...
@@ -1370,7 +1370,7 @@ static int rose_get_info(char *buffer, char **start, off_t offset, int length)
s
->
protinfo
.
rose
->
idle
/
(
60
*
HZ
),
s
->
protinfo
.
rose
->
idle
/
(
60
*
HZ
),
atomic_read
(
&
s
->
wmem_alloc
),
atomic_read
(
&
s
->
wmem_alloc
),
atomic_read
(
&
s
->
rmem_alloc
),
atomic_read
(
&
s
->
rmem_alloc
),
s
->
socket
!=
NULL
?
s
->
socket
->
inode
->
i_ino
:
0L
);
s
->
socket
!=
NULL
?
SOCK_INODE
(
s
->
socket
)
->
i_ino
:
0L
);
pos
=
begin
+
len
;
pos
=
begin
+
len
;
...
...
net/socket.c
View file @
628561a6
...
@@ -272,7 +272,47 @@ static int sockfs_statfs(struct super_block *sb, struct statfs *buf)
...
@@ -272,7 +272,47 @@ static int sockfs_statfs(struct super_block *sb, struct statfs *buf)
return
0
;
return
0
;
}
}
static
kmem_cache_t
*
sock_inode_cachep
;
static
struct
inode
*
sock_alloc_inode
(
struct
super_block
*
sb
)
{
struct
socket_alloc
*
ei
;
ei
=
(
struct
socket_alloc
*
)
kmem_cache_alloc
(
sock_inode_cachep
,
SLAB_KERNEL
);
if
(
!
ei
)
return
NULL
;
init_waitqueue_head
(
&
ei
->
socket
.
wait
);
return
&
ei
->
vfs_inode
;
}
static
void
sock_destroy_inode
(
struct
inode
*
inode
)
{
kmem_cache_free
(
sock_inode_cachep
,
list_entry
(
inode
,
struct
socket_alloc
,
vfs_inode
));
}
static
void
init_once
(
void
*
foo
,
kmem_cache_t
*
cachep
,
unsigned
long
flags
)
{
struct
socket_alloc
*
ei
=
(
struct
socket_alloc
*
)
foo
;
if
((
flags
&
(
SLAB_CTOR_VERIFY
|
SLAB_CTOR_CONSTRUCTOR
))
==
SLAB_CTOR_CONSTRUCTOR
)
inode_init_once
(
&
ei
->
vfs_inode
);
}
static
int
init_inodecache
(
void
)
{
sock_inode_cachep
=
kmem_cache_create
(
"sock_inode_cache"
,
sizeof
(
struct
socket_alloc
),
0
,
SLAB_HWCACHE_ALIGN
,
init_once
,
NULL
);
if
(
sock_inode_cachep
==
NULL
)
return
-
ENOMEM
;
return
0
;
}
static
struct
super_operations
sockfs_ops
=
{
static
struct
super_operations
sockfs_ops
=
{
alloc_inode:
sock_alloc_inode
,
destroy_inode:
sock_destroy_inode
,
statfs:
sockfs_statfs
,
statfs:
sockfs_statfs
,
};
};
...
@@ -282,7 +322,7 @@ static struct super_block * sockfs_read_super(struct super_block *sb, void *data
...
@@ -282,7 +322,7 @@ static struct super_block * sockfs_read_super(struct super_block *sb, void *data
sb
->
s_blocksize
=
1024
;
sb
->
s_blocksize
=
1024
;
sb
->
s_blocksize_bits
=
10
;
sb
->
s_blocksize_bits
=
10
;
sb
->
s_magic
=
SOCKFS_MAGIC
;
sb
->
s_magic
=
SOCKFS_MAGIC
;
sb
->
s_op
=
&
sockfs_ops
;
sb
->
s_op
=
&
sockfs_ops
;
root
=
new_inode
(
sb
);
root
=
new_inode
(
sb
);
if
(
!
root
)
if
(
!
root
)
return
NULL
;
return
NULL
;
...
@@ -347,10 +387,10 @@ static int sock_map_fd(struct socket *sock)
...
@@ -347,10 +387,10 @@ static int sock_map_fd(struct socket *sock)
goto
out
;
goto
out
;
}
}
sprintf
(
name
,
"[%lu]"
,
sock
->
inode
->
i_ino
);
sprintf
(
name
,
"[%lu]"
,
SOCK_INODE
(
sock
)
->
i_ino
);
this
.
name
=
name
;
this
.
name
=
name
;
this
.
len
=
strlen
(
name
);
this
.
len
=
strlen
(
name
);
this
.
hash
=
sock
->
inode
->
i_ino
;
this
.
hash
=
SOCK_INODE
(
sock
)
->
i_ino
;
file
->
f_dentry
=
d_alloc
(
sock_mnt
->
mnt_sb
->
s_root
,
&
this
);
file
->
f_dentry
=
d_alloc
(
sock_mnt
->
mnt_sb
->
s_root
,
&
this
);
if
(
!
file
->
f_dentry
)
{
if
(
!
file
->
f_dentry
)
{
...
@@ -360,11 +400,11 @@ static int sock_map_fd(struct socket *sock)
...
@@ -360,11 +400,11 @@ static int sock_map_fd(struct socket *sock)
goto
out
;
goto
out
;
}
}
file
->
f_dentry
->
d_op
=
&
sockfs_dentry_operations
;
file
->
f_dentry
->
d_op
=
&
sockfs_dentry_operations
;
d_add
(
file
->
f_dentry
,
sock
->
inode
);
d_add
(
file
->
f_dentry
,
SOCK_INODE
(
sock
)
);
file
->
f_vfsmnt
=
mntget
(
sock_mnt
);
file
->
f_vfsmnt
=
mntget
(
sock_mnt
);
sock
->
file
=
file
;
sock
->
file
=
file
;
file
->
f_op
=
sock
->
inode
->
i_fop
=
&
socket_file_ops
;
file
->
f_op
=
SOCK_INODE
(
sock
)
->
i_fop
=
&
socket_file_ops
;
file
->
f_mode
=
3
;
file
->
f_mode
=
3
;
file
->
f_flags
=
O_RDWR
;
file
->
f_flags
=
O_RDWR
;
file
->
f_pos
=
0
;
file
->
f_pos
=
0
;
...
@@ -375,11 +415,6 @@ static int sock_map_fd(struct socket *sock)
...
@@ -375,11 +415,6 @@ static int sock_map_fd(struct socket *sock)
return
fd
;
return
fd
;
}
}
extern
__inline__
struct
socket
*
socki_lookup
(
struct
inode
*
inode
)
{
return
&
inode
->
u
.
socket_i
;
}
/**
/**
* sockfd_lookup - Go from a file number to its socket slot
* sockfd_lookup - Go from a file number to its socket slot
* @fd: file handle
* @fd: file handle
...
@@ -406,7 +441,7 @@ struct socket *sockfd_lookup(int fd, int *err)
...
@@ -406,7 +441,7 @@ struct socket *sockfd_lookup(int fd, int *err)
}
}
inode
=
file
->
f_dentry
->
d_inode
;
inode
=
file
->
f_dentry
->
d_inode
;
if
(
!
inode
->
i_sock
||
!
(
sock
=
socki_lookup
(
inode
)))
if
(
!
inode
->
i_sock
||
!
(
sock
=
SOCKET_I
(
inode
)))
{
{
*
err
=
-
ENOTSOCK
;
*
err
=
-
ENOTSOCK
;
fput
(
file
);
fput
(
file
);
...
@@ -443,15 +478,13 @@ struct socket *sock_alloc(void)
...
@@ -443,15 +478,13 @@ struct socket *sock_alloc(void)
return
NULL
;
return
NULL
;
inode
->
i_dev
=
NODEV
;
inode
->
i_dev
=
NODEV
;
sock
=
socki_lookup
(
inode
);
sock
=
SOCKET_I
(
inode
);
inode
->
i_mode
=
S_IFSOCK
|
S_IRWXUGO
;
inode
->
i_mode
=
S_IFSOCK
|
S_IRWXUGO
;
inode
->
i_sock
=
1
;
inode
->
i_sock
=
1
;
inode
->
i_uid
=
current
->
fsuid
;
inode
->
i_uid
=
current
->
fsuid
;
inode
->
i_gid
=
current
->
fsgid
;
inode
->
i_gid
=
current
->
fsgid
;
sock
->
inode
=
inode
;
init_waitqueue_head
(
&
sock
->
wait
);
sock
->
fasync_list
=
NULL
;
sock
->
fasync_list
=
NULL
;
sock
->
state
=
SS_UNCONNECTED
;
sock
->
state
=
SS_UNCONNECTED
;
sock
->
flags
=
0
;
sock
->
flags
=
0
;
...
@@ -493,7 +526,7 @@ void sock_release(struct socket *sock)
...
@@ -493,7 +526,7 @@ void sock_release(struct socket *sock)
sockets_in_use
[
smp_processor_id
()].
counter
--
;
sockets_in_use
[
smp_processor_id
()].
counter
--
;
if
(
!
sock
->
file
)
{
if
(
!
sock
->
file
)
{
iput
(
sock
->
inode
);
iput
(
SOCK_INODE
(
sock
)
);
return
;
return
;
}
}
sock
->
file
=
NULL
;
sock
->
file
=
NULL
;
...
@@ -553,7 +586,7 @@ static ssize_t sock_read(struct file *file, char *ubuf,
...
@@ -553,7 +586,7 @@ static ssize_t sock_read(struct file *file, char *ubuf,
if
(
size
==
0
)
/* Match SYS5 behaviour */
if
(
size
==
0
)
/* Match SYS5 behaviour */
return
0
;
return
0
;
sock
=
socki_lookup
(
file
->
f_dentry
->
d_inode
);
sock
=
SOCKET_I
(
file
->
f_dentry
->
d_inode
);
msg
.
msg_name
=
NULL
;
msg
.
msg_name
=
NULL
;
msg
.
msg_namelen
=
0
;
msg
.
msg_namelen
=
0
;
...
@@ -586,7 +619,7 @@ static ssize_t sock_write(struct file *file, const char *ubuf,
...
@@ -586,7 +619,7 @@ static ssize_t sock_write(struct file *file, const char *ubuf,
if
(
size
==
0
)
/* Match SYS5 behaviour */
if
(
size
==
0
)
/* Match SYS5 behaviour */
return
0
;
return
0
;
sock
=
socki_lookup
(
file
->
f_dentry
->
d_inode
);
sock
=
SOCKET_I
(
file
->
f_dentry
->
d_inode
);
msg
.
msg_name
=
NULL
;
msg
.
msg_name
=
NULL
;
msg
.
msg_namelen
=
0
;
msg
.
msg_namelen
=
0
;
...
@@ -612,7 +645,7 @@ ssize_t sock_sendpage(struct file *file, struct page *page,
...
@@ -612,7 +645,7 @@ ssize_t sock_sendpage(struct file *file, struct page *page,
if
(
ppos
!=
&
file
->
f_pos
)
if
(
ppos
!=
&
file
->
f_pos
)
return
-
ESPIPE
;
return
-
ESPIPE
;
sock
=
socki_lookup
(
file
->
f_dentry
->
d_inode
);
sock
=
SOCKET_I
(
file
->
f_dentry
->
d_inode
);
flags
=
!
(
file
->
f_flags
&
O_NONBLOCK
)
?
0
:
MSG_DONTWAIT
;
flags
=
!
(
file
->
f_flags
&
O_NONBLOCK
)
?
0
:
MSG_DONTWAIT
;
if
(
more
)
if
(
more
)
...
@@ -627,7 +660,7 @@ int sock_readv_writev(int type, struct inode * inode, struct file * file,
...
@@ -627,7 +660,7 @@ int sock_readv_writev(int type, struct inode * inode, struct file * file,
struct
msghdr
msg
;
struct
msghdr
msg
;
struct
socket
*
sock
;
struct
socket
*
sock
;
sock
=
socki_lookup
(
inode
);
sock
=
SOCKET_I
(
inode
);
msg
.
msg_name
=
NULL
;
msg
.
msg_name
=
NULL
;
msg
.
msg_namelen
=
0
;
msg
.
msg_namelen
=
0
;
...
@@ -681,7 +714,7 @@ int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
...
@@ -681,7 +714,7 @@ int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
int
err
;
int
err
;
unlock_kernel
();
unlock_kernel
();
sock
=
socki_lookup
(
inode
);
sock
=
SOCKET_I
(
inode
);
err
=
sock
->
ops
->
ioctl
(
sock
,
cmd
,
arg
);
err
=
sock
->
ops
->
ioctl
(
sock
,
cmd
,
arg
);
lock_kernel
();
lock_kernel
();
...
@@ -697,13 +730,13 @@ static unsigned int sock_poll(struct file *file, poll_table * wait)
...
@@ -697,13 +730,13 @@ static unsigned int sock_poll(struct file *file, poll_table * wait)
/*
/*
* We can't return errors to poll, so it's either yes or no.
* We can't return errors to poll, so it's either yes or no.
*/
*/
sock
=
socki_lookup
(
file
->
f_dentry
->
d_inode
);
sock
=
SOCKET_I
(
file
->
f_dentry
->
d_inode
);
return
sock
->
ops
->
poll
(
file
,
sock
,
wait
);
return
sock
->
ops
->
poll
(
file
,
sock
,
wait
);
}
}
static
int
sock_mmap
(
struct
file
*
file
,
struct
vm_area_struct
*
vma
)
static
int
sock_mmap
(
struct
file
*
file
,
struct
vm_area_struct
*
vma
)
{
{
struct
socket
*
sock
=
socki_lookup
(
file
->
f_dentry
->
d_inode
);
struct
socket
*
sock
=
SOCKET_I
(
file
->
f_dentry
->
d_inode
);
return
sock
->
ops
->
mmap
(
file
,
sock
,
vma
);
return
sock
->
ops
->
mmap
(
file
,
sock
,
vma
);
}
}
...
@@ -721,7 +754,7 @@ int sock_close(struct inode *inode, struct file *filp)
...
@@ -721,7 +754,7 @@ int sock_close(struct inode *inode, struct file *filp)
return
0
;
return
0
;
}
}
sock_fasync
(
-
1
,
filp
,
0
);
sock_fasync
(
-
1
,
filp
,
0
);
sock_release
(
socki_lookup
(
inode
));
sock_release
(
SOCKET_I
(
inode
));
return
0
;
return
0
;
}
}
...
@@ -754,7 +787,7 @@ static int sock_fasync(int fd, struct file *filp, int on)
...
@@ -754,7 +787,7 @@ static int sock_fasync(int fd, struct file *filp, int on)
}
}
sock
=
socki_lookup
(
filp
->
f_dentry
->
d_inode
);
sock
=
SOCKET_I
(
filp
->
f_dentry
->
d_inode
);
if
((
sk
=
sock
->
sk
)
==
NULL
)
if
((
sk
=
sock
->
sk
)
==
NULL
)
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -1521,7 +1554,7 @@ int sock_fcntl(struct file *filp, unsigned int cmd, unsigned long arg)
...
@@ -1521,7 +1554,7 @@ int sock_fcntl(struct file *filp, unsigned int cmd, unsigned long arg)
{
{
struct
socket
*
sock
;
struct
socket
*
sock
;
sock
=
socki_lookup
(
filp
->
f_dentry
->
d_inode
);
sock
=
SOCKET_I
(
filp
->
f_dentry
->
d_inode
);
if
(
sock
&&
sock
->
ops
)
if
(
sock
&&
sock
->
ops
)
return
sock_no_fcntl
(
sock
,
cmd
,
arg
);
return
sock_no_fcntl
(
sock
,
cmd
,
arg
);
return
(
-
EINVAL
);
return
(
-
EINVAL
);
...
@@ -1711,6 +1744,7 @@ void __init sock_init(void)
...
@@ -1711,6 +1744,7 @@ void __init sock_init(void)
* Initialize the protocols module.
* Initialize the protocols module.
*/
*/
init_inodecache
();
register_filesystem
(
&
sock_fs_type
);
register_filesystem
(
&
sock_fs_type
);
sock_mnt
=
kern_mount
(
&
sock_fs_type
);
sock_mnt
=
kern_mount
(
&
sock_fs_type
);
/* The real protocol initialization is performed when
/* The real protocol initialization is performed when
...
...
net/unix/af_unix.c
View file @
628561a6
...
@@ -711,7 +711,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
...
@@ -711,7 +711,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
/*
/*
* All right, let's create it.
* All right, let's create it.
*/
*/
mode
=
S_IFSOCK
|
(
sock
->
inode
->
i_mode
&
~
current
->
fs
->
umask
);
mode
=
S_IFSOCK
|
(
SOCK_INODE
(
sock
)
->
i_mode
&
~
current
->
fs
->
umask
);
err
=
vfs_mknod
(
nd
.
dentry
->
d_inode
,
dentry
,
mode
,
0
);
err
=
vfs_mknod
(
nd
.
dentry
->
d_inode
,
dentry
,
mode
,
0
);
if
(
err
)
if
(
err
)
goto
out_mknod_dput
;
goto
out_mknod_dput
;
...
...
net/unix/garbage.c
View file @
628561a6
...
@@ -101,7 +101,7 @@ extern inline unix_socket *unix_get_socket(struct file *filp)
...
@@ -101,7 +101,7 @@ extern inline unix_socket *unix_get_socket(struct file *filp)
* Socket ?
* Socket ?
*/
*/
if
(
inode
->
i_sock
)
{
if
(
inode
->
i_sock
)
{
struct
socket
*
sock
=
&
inode
->
u
.
socket_i
;
struct
socket
*
sock
=
SOCKET_I
(
inode
)
;
struct
sock
*
s
=
sock
->
sk
;
struct
sock
*
s
=
sock
->
sk
;
/*
/*
...
...
net/x25/af_x25.c
View file @
628561a6
...
@@ -1239,7 +1239,7 @@ static int x25_get_info(char *buffer, char **start, off_t offset, int length)
...
@@ -1239,7 +1239,7 @@ static int x25_get_info(char *buffer, char **start, off_t offset, int length)
s
->
protinfo
.
x25
->
t23
/
HZ
,
s
->
protinfo
.
x25
->
t23
/
HZ
,
atomic_read
(
&
s
->
wmem_alloc
),
atomic_read
(
&
s
->
wmem_alloc
),
atomic_read
(
&
s
->
rmem_alloc
),
atomic_read
(
&
s
->
rmem_alloc
),
s
->
socket
!=
NULL
?
s
->
socket
->
inode
->
i_ino
:
0L
);
s
->
socket
!=
NULL
?
SOCK_INODE
(
s
->
socket
)
->
i_ino
:
0L
);
pos
=
begin
+
len
;
pos
=
begin
+
len
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment