From: Sage Weil Date: Wed, 3 Nov 2010 16:51:15 +0000 (-0700) Subject: mds: scatter_info_t ancestor for nest_info_t and frag_info_t X-Git-Tag: v0.23~43^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=14f4d22cde182f381e2eddeeadeb9bb78d74b4d8;p=ceph.git mds: scatter_info_t ancestor for nest_info_t and frag_info_t This will facilitate using generic code for the inest and ifile scatterlocks. Signed-off-by: Sage Weil --- diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index 151b83d81d5f..42b27189bb88 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -101,16 +101,19 @@ inline string ccap_string(int cap) } - -struct frag_info_t { +struct scatter_info_t { version_t version; + scatter_info_t() : version(0) {} +}; + +struct frag_info_t : public scatter_info_t { // this frag utime_t mtime; int64_t nfiles; // files int64_t nsubdirs; // subdirs - frag_info_t() : version(0), nfiles(0), nsubdirs(0) {} + frag_info_t() : nfiles(0), nsubdirs(0) {} int64_t size() const { return nfiles + nsubdirs; } @@ -167,9 +170,7 @@ inline ostream& operator<<(ostream &out, const frag_info_t &f) { return out; } -struct nest_info_t { - version_t version; - +struct nest_info_t : public scatter_info_t { // this frag + children utime_t rctime; int64_t rbytes; @@ -180,8 +181,7 @@ struct nest_info_t { int64_t ranchors; // for dirstat, includes inode's anchored flag. int64_t rsnaprealms; - nest_info_t() : version(0), - rbytes(0), rfiles(0), rsubdirs(0), + nest_info_t() : rbytes(0), rfiles(0), rsubdirs(0), ranchors(0), rsnaprealms(0) {} void zero() {