]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mdstypes: dentry_key_t: add an is_valid() function
authorGreg Farnum <gfarnum@redhat.com>
Tue, 11 Nov 2014 18:38:20 +0000 (10:38 -0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 4 Nov 2015 09:17:24 +0000 (17:17 +0800)
Wrap up checks for whether the dentry has actually been initialized
to contain any data.

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/mds/mdstypes.h

index 33bd671400103e90a732a5ec7297e6f70f675cd5..b3c639f44337223a50b629f5008268b0c12e0e84 100644 (file)
@@ -674,6 +674,8 @@ struct dentry_key_t {
   dentry_key_t() : snapid(0), name(0) {}
   dentry_key_t(snapid_t s, const char *n) : snapid(s), name(n) {}
 
+  bool is_valid() { return name || snapid; }
+
   // encode into something that can be decoded as a string.
   // name_ (head) or name_%x (!head)
   void encode(bufferlist& bl) const {