linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, Oleg Drokin <oleg.drokin@intel.com>,
	Andreas Dilger <andreas.dilger@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	HPDD-discuss@ml01.01.org, lustre-devel@lists.lustre.org,
	James Simmons <jsimmons@infradead.org>
Subject: [PATCH 1/6] staging:lustre:remove useless libcfs_sock_release
Date: Fri, 22 May 2015 14:32:27 -0400	[thread overview]
Message-ID: <1432319552-10479-2-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <uja.ornl@gmail.com>

There is no reason to have a one line exported function
libcfs_sock_release. Instead we can call sock_release directly.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 .../staging/lustre/include/linux/libcfs/libcfs.h   |    1 -
 .../staging/lustre/lnet/klnds/socklnd/socklnd.c    |    2 +-
 .../staging/lustre/lnet/klnds/socklnd/socklnd.h    |    2 +-
 drivers/staging/lustre/lnet/lnet/acceptor.c        |    8 ++++----
 drivers/staging/lustre/lnet/lnet/lib-socket.c      |    8 --------
 5 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index 947df7e..7a7a525 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -103,7 +103,6 @@ int libcfs_sock_getbuf(struct socket *socket, int *txbufsize, int *rxbufsize);
 int libcfs_sock_getaddr(struct socket *socket, int remote, __u32 *ip, int *port);
 int libcfs_sock_write(struct socket *sock, void *buffer, int nob, int timeout);
 int libcfs_sock_read(struct socket *sock, void *buffer, int nob, int timeout);
-void libcfs_sock_release(struct socket *sock);
 
 /* need both kernel and user-land acceptor */
 #define LNET_ACCEPTOR_MIN_RESERVED_PORT    512
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
index 7586b7e..e642752 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
@@ -1386,7 +1386,7 @@ ksocknal_create_conn(lnet_ni_t *ni, ksock_route_t *route,
 	LIBCFS_FREE(conn, sizeof(*conn));
 
  failed_0:
-	libcfs_sock_release(sock);
+	sock_release(sock);
 	return rc;
 }
 
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
index c54c995..f3b4923 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
@@ -453,7 +453,7 @@ ksocknal_connsock_decref(ksock_conn_t *conn)
 	LASSERT(atomic_read(&conn->ksnc_sock_refcount) > 0);
 	if (atomic_dec_and_test(&conn->ksnc_sock_refcount)) {
 		LASSERT(conn->ksnc_closing);
-		libcfs_sock_release(conn->ksnc_sock);
+		sock_release(conn->ksnc_sock);
 		conn->ksnc_sock = NULL;
 		ksocknal_finalize_zcreq(conn);
 	}
diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c
index 72fd1bf..14673ef 100644
--- a/drivers/staging/lustre/lnet/lnet/acceptor.c
+++ b/drivers/staging/lustre/lnet/lnet/acceptor.c
@@ -197,7 +197,7 @@ lnet_connect(struct socket **sockp, lnet_nid_t peer_nid,
 	goto failed;
 
  failed_sock:
-	libcfs_sock_release(sock);
+	sock_release(sock);
  failed:
 	lnet_connect_console_error(rc, peer_nid, peer_ip, peer_port);
 	return rc;
@@ -379,7 +379,7 @@ lnet_acceptor(void *arg)
 
 		/* maybe we're waken up with libcfs_sock_abort_accept() */
 		if (lnet_acceptor_state.pta_shutdown) {
-			libcfs_sock_release(newsock);
+			sock_release(newsock);
 			break;
 		}
 
@@ -410,10 +410,10 @@ lnet_acceptor(void *arg)
 		continue;
 
 failed:
-		libcfs_sock_release(newsock);
+		sock_release(newsock);
 	}
 
-	libcfs_sock_release(lnet_acceptor_state.pta_sock);
+	sock_release(lnet_acceptor_state.pta_sock);
 	lnet_acceptor_state.pta_sock = NULL;
 
 	CDEBUG(D_NET, "Acceptor stopping\n");
diff --git a/drivers/staging/lustre/lnet/lnet/lib-socket.c b/drivers/staging/lustre/lnet/lnet/lib-socket.c
index 7f80612..259db61 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-socket.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-socket.c
@@ -614,11 +614,3 @@ libcfs_sock_connect (struct socket **sockp, int *fatal,
 }
 
 EXPORT_SYMBOL(libcfs_sock_connect);
-
-void
-libcfs_sock_release (struct socket *sock)
-{
-	sock_release(sock);
-}
-
-EXPORT_SYMBOL(libcfs_sock_release);
-- 
1.7.1


  parent reply	other threads:[~2015-05-22 18:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <uja.ornl@gmail.com>
2015-05-21 22:46 ` [PATCH 0/3] First set of Intel branch merger for libcfs/lnet James Simmons
2015-05-22 18:32 ` James Simmons [this message]
2015-05-22 18:32 ` [PATCH 2/6] staging:lustre:remove useless libcfs_sock_abort_accept James Simmons
2015-05-22 18:32 ` [PATCH 3/6] staging:lustre: rename tcpip handling functions to lnet_* prefix James Simmons
2015-05-22 18:32 ` [PATCH 4/6] staging:lustre: use available kernel wrappers in lib-socket.c James Simmons
2015-05-22 18:32 ` [PATCH 5/6] staging:lustre: style cleanups for lib-socket.c James Simmons
2015-05-25  9:37   ` Dan Carpenter
2015-05-27 15:01     ` [lustre-devel] " Simmons, James A.
2015-05-27 15:24       ` Dan Carpenter
2015-05-27 21:04         ` Simmons, James A.
2015-05-22 18:32 ` [PATCH 6/6] staging:lustre: Update license and copyright " James Simmons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432319552-10479-2-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=HPDD-discuss@ml01.01.org \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).