From 2539d16a19f4752682fb7ec502834fe1293afe4e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 12 Jul 2011 20:56:14 -0700 Subject: [PATCH] mds: print cur+nested auth_pins on inode And clean up a bit. Signed-off-by: Sage Weil --- src/mds/CDir.h | 1 - src/mds/CInode.cc | 2 +- src/mds/CInode.h | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mds/CDir.h b/src/mds/CDir.h index 52cc983d7e843..2222418cc5759 100644 --- a/src/mds/CDir.h +++ b/src/mds/CDir.h @@ -548,7 +548,6 @@ public: // -- auth pins -- bool can_auth_pin() { return is_auth() && !(is_frozen() || is_freezing()); } - int is_auth_pinned() { return auth_pins; } int get_cum_auth_pins() { return auth_pins + nested_auth_pins; } int get_auth_pins() { return auth_pins; } int get_nested_auth_pins() { return nested_auth_pins; } diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 2c6cdd1bac14c..2299da24a1a13 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -116,7 +116,7 @@ ostream& operator<<(ostream& out, CInode& in) out << " pv" << in.get_projected_version(); if (in.is_auth_pinned()) { - out << " ap=" << in.get_num_auth_pins(); + out << " ap=" << in.get_num_auth_pins() << "+" << in.get_num_nested_auth_pins(); #ifdef MDS_AUTHPIN_SET out << "(" << in.auth_pin_set << ")"; #endif diff --git a/src/mds/CInode.h b/src/mds/CInode.h index db9285f99cc15..e02f86b607e33 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -1081,8 +1081,9 @@ public: // -- auth pins -- - int is_auth_pinned() { return auth_pins; } + bool is_auth_pinned() { return auth_pins || nested_auth_pins; } int get_num_auth_pins() { return auth_pins; } + int get_num_nested_auth_pins() { return nested_auth_pins; } void adjust_nested_auth_pins(int a, void *by); bool can_auth_pin(); void auth_pin(void *by); -- 2.39.5