From: Sage Weil Date: Tue, 1 Mar 2016 15:40:41 +0000 (-0500) Subject: client/Inode: fix has_dir_layout X-Git-Tag: v10.1.0~241^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F7098%2Fhead;p=ceph.git client/Inode: fix has_dir_layout Compare to default file_layout_t() -- not zeroed memory. Signed-off-by: Sage Weil --- diff --git a/src/client/Inode.h b/src/client/Inode.h index 928aaee88187..c92b103a15af 100644 --- a/src/client/Inode.h +++ b/src/client/Inode.h @@ -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) {