summaryrefslogtreecommitdiff
path: root/src/mds/mdstypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds/mdstypes.h')
-rw-r--r--src/mds/mdstypes.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h
index 32f597277a1..7c6512f4e9e 100644
--- a/src/mds/mdstypes.h
+++ b/src/mds/mdstypes.h
@@ -439,6 +439,15 @@ struct inode_t {
truncate_pending++;
}
+ bool has_layout() const {
+ // why on earth is there no converse of memchr() in string.h?
+ const char *p = (const char *)&layout;
+ for (size_t i = 0; i < sizeof(layout); i++)
+ if (p[i] != '\0')
+ return true;
+ return false;
+ }
+
uint64_t get_layout_size_increment() {
return layout.fl_object_size * layout.fl_stripe_count;
}