[PATCH 2/7] messenger: add some clarifying comments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In con_sock_closed() we test *and* clear the socket closed connection
flag.  It's not immediately obvious why the flag needs to be cleared.
Add a comment so that's a little clearer.

Similarly, we only want to do backoff processing once each time the
backoff flag is set.  Add a comment about that as well.

Signed-off-by: Alex Elder <elder@xxxxxxxxxx>
---
 net/ceph/messenger.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 9dfdb20..37b0fa7 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2733,6 +2733,10 @@ static void cancel_con(struct ceph_connection *con)
 
 static bool con_sock_closed(struct ceph_connection *con)
 {
+	/*
+	 * We want to handle the event of the socket being
+	 * closed once, so clear the flag in case it is set.
+	 */
 	if (!con_flag_test_and_clear(con, CON_FLAG_SOCK_CLOSED))
 		return false;
 
@@ -2764,6 +2768,11 @@ static bool con_backoff(struct ceph_connection *con)
 {
 	int ret;
 
+	/*
+	 * See if we need to back off.  We only want to do this
+	 * processing once each time the flag is set, so clear the
+	 * flag after it's tested.
+	 */
 	if (!con_flag_test_and_clear(con, CON_FLAG_BACKOFF))
 		return false;
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux