aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-10-31 03:56:28 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-31 03:56:28 -0400
commitbe859405487324ed548f1ba11dc949b8230ab991 (patch)
tree3893ac2ce3b212b100d9e1e1e3e2fc1fa0c3f47f /fs
parent63779436ab4ad0867bcea53bf853b0004d7b895d (diff)
fs: replace NIPQUAD()
Using NIPQUAD() with NIPQUAD_FMT, %d.%d.%d.%d or %u.%u.%u.%u can be replaced with %pI4 Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/afs/proc.c4
-rw-r--r--fs/afs/server.c9
-rw-r--r--fs/cifs/cifs_spnego.c3
-rw-r--r--fs/cifs/connect.c4
-rw-r--r--fs/lockd/host.c6
-rw-r--r--fs/lockd/mon.c2
-rw-r--r--fs/nfs/nfsroot.c6
-rw-r--r--fs/nfs/super.c3
-rw-r--r--fs/nfsd/nfs4state.c4
-rw-r--r--fs/nfsd/nfsctl.c2
-rw-r--r--fs/ocfs2/cluster/netdebug.c8
-rw-r--r--fs/ocfs2/cluster/nodemanager.c2
-rw-r--r--fs/ocfs2/cluster/tcp.c29
13 files changed, 39 insertions, 43 deletions
diff --git a/fs/afs/proc.c b/fs/afs/proc.c
index 9f7d1ae70269..7578c1ab9e0b 100644
--- a/fs/afs/proc.c
+++ b/fs/afs/proc.c
@@ -646,7 +646,7 @@ static int afs_proc_cell_vlservers_show(struct seq_file *m, void *v)
646 } 646 }
647 647
648 /* display one cell per line on subsequent lines */ 648 /* display one cell per line on subsequent lines */
649 seq_printf(m, "%u.%u.%u.%u\n", NIPQUAD(addr->s_addr)); 649 seq_printf(m, "%pI4\n", &addr->s_addr);
650 return 0; 650 return 0;
651} 651}
652 652
@@ -737,7 +737,7 @@ static int afs_proc_cell_servers_show(struct seq_file *m, void *v)
737 } 737 }
738 738
739 /* display one cell per line on subsequent lines */ 739 /* display one cell per line on subsequent lines */
740 sprintf(ipaddr, "%u.%u.%u.%u", NIPQUAD(server->addr)); 740 sprintf(ipaddr, "%pI4", &server->addr);
741 seq_printf(m, "%3d %-15.15s %5d\n", 741 seq_printf(m, "%3d %-15.15s %5d\n",
742 atomic_read(&server->usage), ipaddr, server->fs_state); 742 atomic_read(&server->usage), ipaddr, server->fs_state);
743 743
diff --git a/fs/afs/server.c b/fs/afs/server.c
index 28f2451419e1..f49099516675 100644
--- a/fs/afs/server.c
+++ b/fs/afs/server.c
@@ -105,7 +105,7 @@ struct afs_server *afs_lookup_server(struct afs_cell *cell,
105{ 105{
106 struct afs_server *server, *candidate; 106 struct afs_server *server, *candidate;
107 107
108 _enter("%p,"NIPQUAD_FMT, cell, NIPQUAD(addr->s_addr)); 108 _enter("%p,%pI4", cell, &addr->s_addr);
109 109
110 /* quick scan of the list to see if we already have the server */ 110 /* quick scan of the list to see if we already have the server */
111 read_lock(&cell->servers_lock); 111 read_lock(&cell->servers_lock);
@@ -168,9 +168,8 @@ found_server:
168server_in_two_cells: 168server_in_two_cells:
169 write_unlock(&cell->servers_lock); 169 write_unlock(&cell->servers_lock);
170 kfree(candidate); 170 kfree(candidate);
171 printk(KERN_NOTICE "kAFS:" 171 printk(KERN_NOTICE "kAFS: Server %pI4 appears to be in two cells\n",
172 " Server "NIPQUAD_FMT" appears to be in two cells\n", 172 addr);
173 NIPQUAD(*addr));
174 _leave(" = -EEXIST"); 173 _leave(" = -EEXIST");
175 return ERR_PTR(-EEXIST); 174 return ERR_PTR(-EEXIST);
176} 175}
@@ -184,7 +183,7 @@ struct afs_server *afs_find_server(const struct in_addr *_addr)
184 struct rb_node *p; 183 struct rb_node *p;
185 struct in_addr addr = *_addr; 184 struct in_addr addr = *_addr;
186 185
187 _enter(NIPQUAD_FMT, NIPQUAD(addr.s_addr)); 186 _enter("%pI4", &addr.s_addr);
188 187
189 read_lock(&afs_servers_lock); 188 read_lock(&afs_servers_lock);
190 189
diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c
index 0e186cd20ad9..359144c510b9 100644
--- a/fs/cifs/cifs_spnego.c
+++ b/fs/cifs/cifs_spnego.c
@@ -121,8 +121,7 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
121 121
122 /* add the server address */ 122 /* add the server address */
123 if (server->addr.sockAddr.sin_family == AF_INET) 123 if (server->addr.sockAddr.sin_family == AF_INET)
124 sprintf(dp, "ip4=" NIPQUAD_FMT, 124 sprintf(dp, "ip4=%pI4", &server->addr.sockAddr.sin_addr);
125 NIPQUAD(server->addr.sockAddr.sin_addr));
126 else if (server->addr.sockAddr.sin_family == AF_INET6) 125 else if (server->addr.sockAddr.sin_family == AF_INET6)
127 sprintf(dp, "ip6=%pi6", &server->addr.sockAddr6.sin6_addr); 126 sprintf(dp, "ip6=%pi6", &server->addr.sockAddr6.sin6_addr);
128 else 127 else
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 71b7661e2260..cd54fee3f05c 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2058,8 +2058,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
2058 rc = -ENOMEM; 2058 rc = -ENOMEM;
2059 else { 2059 else {
2060 pSesInfo->server = srvTcp; 2060 pSesInfo->server = srvTcp;
2061 sprintf(pSesInfo->serverName, "%u.%u.%u.%u", 2061 sprintf(pSesInfo->serverName, "%pI4",
2062 NIPQUAD(sin_server.sin_addr.s_addr)); 2062 &sin_server.sin_addr.s_addr);
2063 } 2063 }
2064 2064
2065 if (!rc) { 2065 if (!rc) {
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index c8ab7d70390d..c48c26380771 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -115,12 +115,12 @@ static void nlm_display_address(const struct sockaddr *sap,
115 snprintf(buf, len, "unspecified"); 115 snprintf(buf, len, "unspecified");
116 break; 116 break;
117 case AF_INET: 117 case AF_INET:
118 snprintf(buf, len, NIPQUAD_FMT, NIPQUAD(sin->sin_addr.s_addr)); 118 snprintf(buf, len, "%pI4", &sin->sin_addr.s_addr);
119 break; 119 break;
120 case AF_INET6: 120 case AF_INET6:
121 if (ipv6_addr_v4mapped(&sin6->sin6_addr)) 121 if (ipv6_addr_v4mapped(&sin6->sin6_addr))
122 snprintf(buf, len, NIPQUAD_FMT, 122 snprintf(buf, len, "%pI4",
123 NIPQUAD(sin6->sin6_addr.s6_addr32[3])); 123 &sin6->sin6_addr.s6_addr32[3]);
124 else 124 else
125 snprintf(buf, len, "%pI6", &sin6->sin6_addr); 125 snprintf(buf, len, "%pI6", &sin6->sin6_addr);
126 break; 126 break;
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index 4e7e958e8f67..ffd3461f75ef 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -179,7 +179,7 @@ static __be32 *xdr_encode_mon_name(__be32 *p, struct nsm_args *argp)
179 179
180 if (!nsm_use_hostnames) { 180 if (!nsm_use_hostnames) {
181 snprintf(buffer, XDR_ADDRBUF_LEN, 181 snprintf(buffer, XDR_ADDRBUF_LEN,
182 NIPQUAD_FMT, NIPQUAD(argp->addr)); 182 "%pI4", &argp->addr);
183 name = buffer; 183 name = buffer;
184 } 184 }
185 185
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index 8478fc25daee..d74d16ce0d49 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -329,7 +329,7 @@ static int __init root_nfs_addr(void)
329 } 329 }
330 330
331 snprintf(nfs_data.hostname, sizeof(nfs_data.hostname), 331 snprintf(nfs_data.hostname, sizeof(nfs_data.hostname),
332 "%u.%u.%u.%u", NIPQUAD(servaddr)); 332 "%pI4", &servaddr);
333 return 0; 333 return 0;
334} 334}
335 335
@@ -421,8 +421,8 @@ static int __init root_nfs_getport(int program, int version, int proto)
421{ 421{
422 struct sockaddr_in sin; 422 struct sockaddr_in sin;
423 423
424 printk(KERN_NOTICE "Looking up port of RPC %d/%d on %u.%u.%u.%u\n", 424 printk(KERN_NOTICE "Looking up port of RPC %d/%d on %pI4\n",
425 program, version, NIPQUAD(servaddr)); 425 program, version, &servaddr);
426 set_sockaddr(&sin, servaddr, 0); 426 set_sockaddr(&sin, servaddr, 0);
427 return rpcb_getport_sync(&sin, program, version, proto); 427 return rpcb_getport_sync(&sin, program, version, proto);
428} 428}
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index eb391d8d70ba..bb0313ac9e1f 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -462,8 +462,7 @@ static void nfs_show_mountd_options(struct seq_file *m, struct nfs_server *nfss,
462 switch (sap->sa_family) { 462 switch (sap->sa_family) {
463 case AF_INET: { 463 case AF_INET: {
464 struct sockaddr_in *sin = (struct sockaddr_in *)sap; 464 struct sockaddr_in *sin = (struct sockaddr_in *)sap;
465 seq_printf(m, ",mountaddr=" NIPQUAD_FMT, 465 seq_printf(m, ",mountaddr=%pI4", &sin->sin_addr.s_addr);
466 NIPQUAD(sin->sin_addr.s_addr));
467 break; 466 break;
468 } 467 }
469 case AF_INET6: { 468 case AF_INET6: {
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index b0bebc552a11..16efb8f8e062 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -719,8 +719,8 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
719 status = nfserr_clid_inuse; 719 status = nfserr_clid_inuse;
720 if (!same_creds(&conf->cl_cred, &rqstp->rq_cred) 720 if (!same_creds(&conf->cl_cred, &rqstp->rq_cred)
721 || conf->cl_addr != sin->sin_addr.s_addr) { 721 || conf->cl_addr != sin->sin_addr.s_addr) {
722 dprintk("NFSD: setclientid: string in use by client" 722 dprintk("NFSD: setclientid: string in use by clientat %pI4\n",
723 "at %u.%u.%u.%u\n", NIPQUAD(conf->cl_addr)); 723 &conf->cl_addr);
724 goto out; 724 goto out;
725 } 725 }
726 } 726 }
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index e3f9783fdcf7..77d7b8c531a6 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -330,7 +330,7 @@ static ssize_t failover_unlock_ip(struct file *file, char *buf, size_t size)
330 return -EINVAL; 330 return -EINVAL;
331 331
332 /* get ipv4 address */ 332 /* get ipv4 address */
333 if (sscanf(fo_path, NIPQUAD_FMT "%c", &b1, &b2, &b3, &b4, &c) != 4) 333 if (sscanf(fo_path, "%u.%u.%u.%u%c", &b1, &b2, &b3, &b4, &c) != 4)
334 return -EINVAL; 334 return -EINVAL;
335 if (b1 > 255 || b2 > 255 || b3 > 255 || b4 > 255) 335 if (b1 > 255 || b2 > 255 || b3 > 255 || b4 > 255)
336 return -EINVAL; 336 return -EINVAL;
diff --git a/fs/ocfs2/cluster/netdebug.c b/fs/ocfs2/cluster/netdebug.c
index 52276c02f710..f8424874fa07 100644
--- a/fs/ocfs2/cluster/netdebug.c
+++ b/fs/ocfs2/cluster/netdebug.c
@@ -304,8 +304,8 @@ static int sc_seq_show(struct seq_file *seq, void *v)
304 * use of it here generates a warning with -Wbitwise */ 304 * use of it here generates a warning with -Wbitwise */
305 seq_printf(seq, "%p:\n" 305 seq_printf(seq, "%p:\n"
306 " krefs: %d\n" 306 " krefs: %d\n"
307 " sock: %u.%u.%u.%u:%u -> " 307 " sock: %pI4:%u -> "
308 "%u.%u.%u.%u:%u\n" 308 "%pI4:%u\n"
309 " remote node: %s\n" 309 " remote node: %s\n"
310 " page off: %zu\n" 310 " page off: %zu\n"
311 " handshake ok: %u\n" 311 " handshake ok: %u\n"
@@ -319,8 +319,8 @@ static int sc_seq_show(struct seq_file *seq, void *v)
319 " func type: %u\n", 319 " func type: %u\n",
320 sc, 320 sc,
321 atomic_read(&sc->sc_kref.refcount), 321 atomic_read(&sc->sc_kref.refcount),
322 NIPQUAD(saddr), inet ? ntohs(sport) : 0, 322 &saddr, inet ? ntohs(sport) : 0,
323 NIPQUAD(daddr), inet ? ntohs(dport) : 0, 323 &daddr, inet ? ntohs(dport) : 0,
324 sc->sc_node->nd_name, 324 sc->sc_node->nd_name,
325 sc->sc_page_off, 325 sc->sc_page_off,
326 sc->sc_handshake_ok, 326 sc->sc_handshake_ok,
diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c
index 816a3f61330c..70e8fa9e2539 100644
--- a/fs/ocfs2/cluster/nodemanager.c
+++ b/fs/ocfs2/cluster/nodemanager.c
@@ -250,7 +250,7 @@ static ssize_t o2nm_node_ipv4_port_write(struct o2nm_node *node,
250 250
251static ssize_t o2nm_node_ipv4_address_read(struct o2nm_node *node, char *page) 251static ssize_t o2nm_node_ipv4_address_read(struct o2nm_node *node, char *page)
252{ 252{
253 return sprintf(page, "%u.%u.%u.%u\n", NIPQUAD(node->nd_ipv4_address)); 253 return sprintf(page, "%pI4\n", &node->nd_ipv4_address);
254} 254}
255 255
256static ssize_t o2nm_node_ipv4_address_write(struct o2nm_node *node, 256static ssize_t o2nm_node_ipv4_address_write(struct o2nm_node *node,
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index 2bcf706d9dd3..9fbe849f6344 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -1597,8 +1597,8 @@ static void o2net_start_connect(struct work_struct *work)
1597 ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr, 1597 ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr,
1598 sizeof(myaddr)); 1598 sizeof(myaddr));
1599 if (ret) { 1599 if (ret) {
1600 mlog(ML_ERROR, "bind failed with %d at address %u.%u.%u.%u\n", 1600 mlog(ML_ERROR, "bind failed with %d at address %pI4\n",
1601 ret, NIPQUAD(mynode->nd_ipv4_address)); 1601 ret, &mynode->nd_ipv4_address);
1602 goto out; 1602 goto out;
1603 } 1603 }
1604 1604
@@ -1790,17 +1790,16 @@ static int o2net_accept_one(struct socket *sock)
1790 1790
1791 node = o2nm_get_node_by_ip(sin.sin_addr.s_addr); 1791 node = o2nm_get_node_by_ip(sin.sin_addr.s_addr);
1792 if (node == NULL) { 1792 if (node == NULL) {
1793 mlog(ML_NOTICE, "attempt to connect from unknown node at " 1793 mlog(ML_NOTICE, "attempt to connect from unknown node at %pI4:%d\n",
1794 "%u.%u.%u.%u:%d\n", NIPQUAD(sin.sin_addr.s_addr), 1794 &sin.sin_addr.s_addr, ntohs(sin.sin_port));
1795 ntohs(sin.sin_port));
1796 ret = -EINVAL; 1795 ret = -EINVAL;
1797 goto out; 1796 goto out;
1798 } 1797 }
1799 1798
1800 if (o2nm_this_node() > node->nd_num) { 1799 if (o2nm_this_node() > node->nd_num) {
1801 mlog(ML_NOTICE, "unexpected connect attempted from a lower " 1800 mlog(ML_NOTICE, "unexpected connect attempted from a lower "
1802 "numbered node '%s' at " "%u.%u.%u.%u:%d with num %u\n", 1801 "numbered node '%s' at " "%pI4:%d with num %u\n",
1803 node->nd_name, NIPQUAD(sin.sin_addr.s_addr), 1802 node->nd_name, &sin.sin_addr.s_addr,
1804 ntohs(sin.sin_port), node->nd_num); 1803 ntohs(sin.sin_port), node->nd_num);
1805 ret = -EINVAL; 1804 ret = -EINVAL;
1806 goto out; 1805 goto out;
@@ -1810,8 +1809,8 @@ static int o2net_accept_one(struct socket *sock)
1810 * and tries to connect before we see their heartbeat */ 1809 * and tries to connect before we see their heartbeat */
1811 if (!o2hb_check_node_heartbeating_from_callback(node->nd_num)) { 1810 if (!o2hb_check_node_heartbeating_from_callback(node->nd_num)) {
1812 mlog(ML_CONN, "attempt to connect from node '%s' at " 1811 mlog(ML_CONN, "attempt to connect from node '%s' at "
1813 "%u.%u.%u.%u:%d but it isn't heartbeating\n", 1812 "%pI4:%d but it isn't heartbeating\n",
1814 node->nd_name, NIPQUAD(sin.sin_addr.s_addr), 1813 node->nd_name, &sin.sin_addr.s_addr,
1815 ntohs(sin.sin_port)); 1814 ntohs(sin.sin_port));
1816 ret = -EINVAL; 1815 ret = -EINVAL;
1817 goto out; 1816 goto out;
@@ -1827,8 +1826,8 @@ static int o2net_accept_one(struct socket *sock)
1827 spin_unlock(&nn->nn_lock); 1826 spin_unlock(&nn->nn_lock);
1828 if (ret) { 1827 if (ret) {
1829 mlog(ML_NOTICE, "attempt to connect from node '%s' at " 1828 mlog(ML_NOTICE, "attempt to connect from node '%s' at "
1830 "%u.%u.%u.%u:%d but it already has an open connection\n", 1829 "%pI4:%d but it already has an open connection\n",
1831 node->nd_name, NIPQUAD(sin.sin_addr.s_addr), 1830 node->nd_name, &sin.sin_addr.s_addr,
1832 ntohs(sin.sin_port)); 1831 ntohs(sin.sin_port));
1833 goto out; 1832 goto out;
1834 } 1833 }
@@ -1924,15 +1923,15 @@ static int o2net_open_listening_sock(__be32 addr, __be16 port)
1924 sock->sk->sk_reuse = 1; 1923 sock->sk->sk_reuse = 1;
1925 ret = sock->ops->bind(sock, (struct sockaddr *)&sin, sizeof(sin)); 1924 ret = sock->ops->bind(sock, (struct sockaddr *)&sin, sizeof(sin));
1926 if (ret < 0) { 1925 if (ret < 0) {
1927 mlog(ML_ERROR, "unable to bind socket at %u.%u.%u.%u:%u, " 1926 mlog(ML_ERROR, "unable to bind socket at %pI4:%u, "
1928 "ret=%d\n", NIPQUAD(addr), ntohs(port), ret); 1927 "ret=%d\n", &addr, ntohs(port), ret);
1929 goto out; 1928 goto out;
1930 } 1929 }
1931 1930
1932 ret = sock->ops->listen(sock, 64); 1931 ret = sock->ops->listen(sock, 64);
1933 if (ret < 0) { 1932 if (ret < 0) {
1934 mlog(ML_ERROR, "unable to listen on %u.%u.%u.%u:%u, ret=%d\n", 1933 mlog(ML_ERROR, "unable to listen on %pI4:%u, ret=%d\n",
1935 NIPQUAD(addr), ntohs(port), ret); 1934 &addr, ntohs(port), ret);
1936 } 1935 }
1937 1936
1938out: 1937out: