[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sanlock-devel
Subject:    src/main.c
From:       David Teigland <teigland () fedoraproject ! org>
Date:       2014-08-19 18:47:12
Message-ID: 20140819184712.C8F1A609C8 () fedorahosted ! org
[Download RAW message or body]

 src/main.c |   22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

New commits:
commit d90efcd4d2595b2af54f998fb9680e4ee560c6ab
Author: David Teigland <teigland@redhat.com>
Date:   Tue Aug 19 13:44:26 2014 -0500

    sanlock: print better names in direct read -s
    
    sanlock direct read -s LOCKSPACE
    was printing "write_id, write_generation, write_timestamp"
    field names which are relevant only for paxos leases.
    Print "extra1, extra2, extra3" as the field names when
    reading a lockspace.
    
    Signed-off-by: David Teigland <teigland@redhat.com>

diff --git a/src/main.c b/src/main.c
index 0f6332a..f729540 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2723,12 +2723,22 @@ static int do_direct(void)
 			 (unsigned long long)leader.timestamp);
 		log_tool("checksum 0x%0x", leader.checksum);
 		log_tool("io_timeout %u", leader.io_timeout);
-		log_tool("write_id %llu",
-			 (unsigned long long)leader.write_id);
-		log_tool("write_generation %llu",
-			 (unsigned long long)leader.write_generation);
-		log_tool("write_timestamp %llu",
-			 (unsigned long long)leader.write_timestamp);
+
+		if (com.res_args[0]) {
+			log_tool("write_id %llu",
+				 (unsigned long long)leader.write_id);
+			log_tool("write_generation %llu",
+				 (unsigned long long)leader.write_generation);
+			log_tool("write_timestamp %llu",
+				 (unsigned long long)leader.write_timestamp);
+		} else {
+			log_tool("extra1 %llu",
+				 (unsigned long long)leader.write_id);
+			log_tool("extra2 %llu",
+				 (unsigned long long)leader.write_generation);
+			log_tool("extra3 %llu",
+				 (unsigned long long)leader.write_timestamp);
+		}
 		break;
 
 	case ACT_ACQUIRE:


_______________________________________________
sanlock-devel mailing list
sanlock-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sanlock-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic