From: Greg Farnum Date: Fri, 26 Sep 2014 01:02:58 +0000 (-0700) Subject: mdstypes: add a same_sums() function to nest_info_t X-Git-Tag: v0.89~50^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f8db040c46bdd4385bb7af369e3b7e9c4181c955;p=ceph.git mdstypes: add a same_sums() function to nest_info_t operator== is checking equality of the version as well, but I want something I can use to check that the internal sums match. This is useful for eg comparing the sums of a set of dirfrags to the tally stored in the inode. Signed-off-by: Greg Farnum --- diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index 59d79cf0b318..d9106fe75c59 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -202,6 +202,14 @@ struct nest_info_t : public scatter_info_t { rsnaprealms += cur.rsnaprealms - acc.rsnaprealms; } + bool same_sums(const nest_info_t &o) const { + return rctime == o.rctime && + rbytes == o.rbytes && + rfiles == o.rfiles && + rsubdirs == o.rsubdirs && + rsnaprealms == o.rsnaprealms; + } + void encode(bufferlist &bl) const; void decode(bufferlist::iterator& bl); void dump(Formatter *f) const;