From 3e41cfde77ec0a3a223d98dabaae75fd58b55e3b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 1 Mar 2016 10:40:41 -0500 Subject: [PATCH] client/Inode: fix has_dir_layout Compare to default file_layout_t() -- not zeroed memory. Signed-off-by: Sage Weil --- src/client/Inode.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/client/Inode.h b/src/client/Inode.h index 928aaee8818..c92b103a15a 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) { -- 2.47.3