]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client/Inode: fix has_dir_layout 7098/head
authorSage Weil <sage@redhat.com>
Tue, 1 Mar 2016 15:40:41 +0000 (10:40 -0500)
committerSage Weil <sage@redhat.com>
Wed, 2 Mar 2016 17:29:12 +0000 (12:29 -0500)
Compare to default file_layout_t() -- not zeroed memory.

Signed-off-by: Sage Weil <sage@redhat.com>
src/client/Inode.h

index 928aaee88187dccbeb795aee1aba5369c4a52875..c92b103a15af88e04233c494f8a430e95dc94b3e 100644 (file)
@@ -205,10 +205,7 @@ struct Inode {
   bool is_file()    const { return (mode & S_IFMT) == S_IFREG; }
 
   bool has_dir_layout() const {
-    for (unsigned c = 0; c < sizeof(layout); c++)
-      if (*((const char *)&layout + c))
-       return true;
-    return false;
+    return layout != file_layout_t();
   }
 
   __u32 hash_dentry_name(const string &dn) {