mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00:00
ceph: carry snapshot creation time with inodes
MDS InodeStat v3 wire structures include a trailing snapshot creation time member. Unmarshall this and retain it for a future vxattr. Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
e1b8143914
commit
193e7b3762
4 changed files with 13 additions and 0 deletions
|
@ -813,6 +813,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page,
|
||||||
dout("%p mode 0%o uid.gid %d.%d\n", inode, inode->i_mode,
|
dout("%p mode 0%o uid.gid %d.%d\n", inode, inode->i_mode,
|
||||||
from_kuid(&init_user_ns, inode->i_uid),
|
from_kuid(&init_user_ns, inode->i_uid),
|
||||||
from_kgid(&init_user_ns, inode->i_gid));
|
from_kgid(&init_user_ns, inode->i_gid));
|
||||||
|
ceph_decode_timespec64(&ci->i_snap_btime, &iinfo->snap_btime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((new_version || (new_issued & CEPH_CAP_LINK_SHARED)) &&
|
if ((new_version || (new_issued & CEPH_CAP_LINK_SHARED)) &&
|
||||||
|
|
|
@ -166,6 +166,15 @@ static int parse_reply_info_in(void **p, void *end,
|
||||||
info->dir_pin = -ENODATA;
|
info->dir_pin = -ENODATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* snapshot birth time, remains zero for v<=2 */
|
||||||
|
if (struct_v >= 3) {
|
||||||
|
ceph_decode_need(p, end, sizeof(info->snap_btime), bad);
|
||||||
|
ceph_decode_copy(p, &info->snap_btime,
|
||||||
|
sizeof(info->snap_btime));
|
||||||
|
} else {
|
||||||
|
memset(&info->snap_btime, 0, sizeof(info->snap_btime));
|
||||||
|
}
|
||||||
|
|
||||||
*p = end;
|
*p = end;
|
||||||
} else {
|
} else {
|
||||||
if (features & CEPH_FEATURE_MDS_INLINE_DATA) {
|
if (features & CEPH_FEATURE_MDS_INLINE_DATA) {
|
||||||
|
@ -198,6 +207,7 @@ static int parse_reply_info_in(void **p, void *end,
|
||||||
}
|
}
|
||||||
|
|
||||||
info->dir_pin = -ENODATA;
|
info->dir_pin = -ENODATA;
|
||||||
|
/* info->snap_btime remains zero */
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
bad:
|
bad:
|
||||||
|
|
|
@ -69,6 +69,7 @@ struct ceph_mds_reply_info_in {
|
||||||
u64 max_bytes;
|
u64 max_bytes;
|
||||||
u64 max_files;
|
u64 max_files;
|
||||||
s32 dir_pin;
|
s32 dir_pin;
|
||||||
|
struct ceph_timespec snap_btime;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ceph_mds_reply_dir_entry {
|
struct ceph_mds_reply_dir_entry {
|
||||||
|
|
|
@ -384,6 +384,7 @@ struct ceph_inode_info {
|
||||||
int i_snap_realm_counter; /* snap realm (if caps) */
|
int i_snap_realm_counter; /* snap realm (if caps) */
|
||||||
struct list_head i_snap_realm_item;
|
struct list_head i_snap_realm_item;
|
||||||
struct list_head i_snap_flush_item;
|
struct list_head i_snap_flush_item;
|
||||||
|
struct timespec64 i_snap_btime;
|
||||||
|
|
||||||
struct work_struct i_work;
|
struct work_struct i_work;
|
||||||
unsigned long i_work_mask;
|
unsigned long i_work_mask;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue