aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/cluster
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/ocfs2/cluster
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/ocfs2/cluster')
-rw-r--r--fs/ocfs2/cluster/netdebug.c8
-rw-r--r--fs/ocfs2/cluster/nodemanager.c2
-rw-r--r--fs/ocfs2/cluster/tcp.c29
3 files changed, 19 insertions, 20 deletions
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: