Commit 5a874db4 authored by Al Viro's avatar Al Viro Committed by David S. Miller

[NET]: ipconfig and nfsroot annotations

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3e6c8cd5
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
static char nfs_root_name[256] __initdata = ""; static char nfs_root_name[256] __initdata = "";
/* Address of NFS server */ /* Address of NFS server */
static __u32 servaddr __initdata = 0; static __be32 servaddr __initdata = 0;
/* Name of directory to mount */ /* Name of directory to mount */
static char nfs_path[NFS_MAXPATHLEN] __initdata = { 0, }; static char nfs_path[NFS_MAXPATHLEN] __initdata = { 0, };
...@@ -327,7 +327,7 @@ static int __init root_nfs_name(char *name) ...@@ -327,7 +327,7 @@ static int __init root_nfs_name(char *name)
*/ */
static int __init root_nfs_addr(void) static int __init root_nfs_addr(void)
{ {
if ((servaddr = root_server_addr) == INADDR_NONE) { if ((servaddr = root_server_addr) == htonl(INADDR_NONE)) {
printk(KERN_ERR "Root-NFS: No NFS server available, giving up.\n"); printk(KERN_ERR "Root-NFS: No NFS server available, giving up.\n");
return -1; return -1;
} }
...@@ -411,7 +411,7 @@ __setup("nfsroot=", nfs_root_setup); ...@@ -411,7 +411,7 @@ __setup("nfsroot=", nfs_root_setup);
* Construct sockaddr_in from address and port number. * Construct sockaddr_in from address and port number.
*/ */
static inline void static inline void
set_sockaddr(struct sockaddr_in *sin, __u32 addr, __u16 port) set_sockaddr(struct sockaddr_in *sin, __be32 addr, __be16 port)
{ {
sin->sin_family = AF_INET; sin->sin_family = AF_INET;
sin->sin_addr.s_addr = addr; sin->sin_addr.s_addr = addr;
...@@ -468,14 +468,13 @@ static int __init root_nfs_ports(void) ...@@ -468,14 +468,13 @@ static int __init root_nfs_ports(void)
dprintk("Root-NFS: Portmapper on server returned %d " dprintk("Root-NFS: Portmapper on server returned %d "
"as nfsd port\n", port); "as nfsd port\n", port);
} }
nfs_port = htons(nfs_port);
if ((port = root_nfs_getport(NFS_MNT_PROGRAM, mountd_ver, proto)) < 0) { if ((port = root_nfs_getport(NFS_MNT_PROGRAM, mountd_ver, proto)) < 0) {
printk(KERN_ERR "Root-NFS: Unable to get mountd port " printk(KERN_ERR "Root-NFS: Unable to get mountd port "
"number from server, using default\n"); "number from server, using default\n");
port = mountd_port; port = mountd_port;
} }
mount_port = htons(port); mount_port = port;
dprintk("Root-NFS: mountd port is %d\n", port); dprintk("Root-NFS: mountd port is %d\n", port);
return 0; return 0;
...@@ -496,7 +495,7 @@ static int __init root_nfs_get_handle(void) ...@@ -496,7 +495,7 @@ static int __init root_nfs_get_handle(void)
int version = (nfs_data.flags & NFS_MOUNT_VER3) ? int version = (nfs_data.flags & NFS_MOUNT_VER3) ?
NFS_MNT3_VERSION : NFS_MNT_VERSION; NFS_MNT3_VERSION : NFS_MNT_VERSION;
set_sockaddr(&sin, servaddr, mount_port); set_sockaddr(&sin, servaddr, htons(mount_port));
status = nfsroot_mount(&sin, nfs_path, &fh, version, protocol); status = nfsroot_mount(&sin, nfs_path, &fh, version, protocol);
if (status < 0) if (status < 0)
printk(KERN_ERR "Root-NFS: Server returned error %d " printk(KERN_ERR "Root-NFS: Server returned error %d "
...@@ -519,6 +518,6 @@ void * __init nfs_root_data(void) ...@@ -519,6 +518,6 @@ void * __init nfs_root_data(void)
|| root_nfs_ports() < 0 || root_nfs_ports() < 0
|| root_nfs_get_handle() < 0) || root_nfs_get_handle() < 0)
return NULL; return NULL;
set_sockaddr((struct sockaddr_in *) &nfs_data.addr, servaddr, nfs_port); set_sockaddr((struct sockaddr_in *) &nfs_data.addr, servaddr, htons(nfs_port));
return (void*)&nfs_data; return (void*)&nfs_data;
} }
...@@ -318,7 +318,7 @@ extern void put_nfs_open_context(struct nfs_open_context *ctx); ...@@ -318,7 +318,7 @@ extern void put_nfs_open_context(struct nfs_open_context *ctx);
extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode);
/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
extern u32 root_nfs_parse_addr(char *name); /*__init*/ extern __be32 root_nfs_parse_addr(char *name); /*__init*/
static inline void nfs_fattr_init(struct nfs_fattr *fattr) static inline void nfs_fattr_init(struct nfs_fattr *fattr)
{ {
......
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
extern int ic_proto_enabled; /* Protocols enabled (see IC_xxx) */ extern int ic_proto_enabled; /* Protocols enabled (see IC_xxx) */
extern int ic_set_manually; /* IPconfig parameters set manually */ extern int ic_set_manually; /* IPconfig parameters set manually */
extern u32 ic_myaddr; /* My IP address */ extern __be32 ic_myaddr; /* My IP address */
extern u32 ic_gateway; /* Gateway IP address */ extern __be32 ic_gateway; /* Gateway IP address */
extern u32 ic_servaddr; /* Boot server IP address */ extern __be32 ic_servaddr; /* Boot server IP address */
extern u32 root_server_addr; /* Address of NFS server */ extern __be32 root_server_addr; /* Address of NFS server */
extern u8 root_server_path[]; /* Path to mount as root */ extern u8 root_server_path[]; /* Path to mount as root */
......
This diff is collapsed.
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