@@ -2824,6 +2824,16 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session,
e.files = i->dirstat.nfiles;
e.subdirs = i->dirstat.nsubdirs;
+ // inline data
+ uint64_t inline_version = 0;
+ bufferlist inline_data;
+ if (!cap || (cap->client_inline_version < i->inline_version)) {
+ inline_version = i->inline_version;
+ inline_data = i->inline_data;
+ if (cap)
+ cap->client_inline_version = i->inline_version;
+ }
+
// nest (do same as file... :/)
i->rstat.rctime.encode_timeval(&e.rctime);
e.rbytes = i->rstat.rbytes;
@@ -2862,6 +2872,7 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session,
bytes += (sizeof(__u32) + sizeof(__u32)) * dirfragtree._splits.size();
bytes += sizeof(__u32) + symlink.length();
bytes += sizeof(__u32) + xbl.length();
+ bytes += sizeof(__u64) + sizeof(__u32) + inline_data.length();
if (bytes > max_bytes)
return -ENOSPC;
}
@@ -2957,6 +2968,10 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session,
::encode(i->dir_layout, bl);
}
::encode(xbl, bl);
+ if (session->connection->has_feature(CEPH_FEATURE_MDS_INLINE_DATA)) {
+ ::encode(inline_version, bl);
+ ::encode(inline_data, bl);
+ }
return valid;
}
@@ -176,6 +176,13 @@ struct InodeStat {
xattr_version = e.xattr_version;
::decode(xattrbl, p);
+
+ if (features & CEPH_FEATURE_MDS_INLINE_DATA) {
+ ::decode(inline_version, p);
+ ::decode(inline_data, p);
+ } else {
+ inline_version = CEPH_INLINE_NONE;
+ }
}
// see CInode::encode_inodestat for encoder.