]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: scatter_info_t ancestor for nest_info_t and frag_info_t
authorSage Weil <sage@newdream.net>
Wed, 3 Nov 2010 16:51:15 +0000 (09:51 -0700)
committerSage Weil <sage@newdream.net>
Wed, 3 Nov 2010 16:51:15 +0000 (09:51 -0700)
This will facilitate using generic code for the inest and ifile
scatterlocks.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/mdstypes.h

index 151b83d81d5fe365b46cb4a2dd158b349f3acabe..42b27189bb882f31b728c266ba479b273bb3f4dd 100644 (file)
@@ -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() {