Commit 245ce991 authored by Jeff Layton's avatar Jeff Layton Committed by Ilya Dryomov

ceph: add btime field to ceph_inode_info

Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Reviewed-by: default avatar"Yan, Zheng" <zyan@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 2c66de56
...@@ -509,6 +509,7 @@ struct inode *ceph_alloc_inode(struct super_block *sb) ...@@ -509,6 +509,7 @@ struct inode *ceph_alloc_inode(struct super_block *sb)
INIT_WORK(&ci->i_work, ceph_inode_work); INIT_WORK(&ci->i_work, ceph_inode_work);
ci->i_work_mask = 0; ci->i_work_mask = 0;
memset(&ci->i_btime, '\0', sizeof(ci->i_btime));
ceph_fscache_inode_init(ci); ceph_fscache_inode_init(ci);
...@@ -813,6 +814,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page, ...@@ -813,6 +814,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_btime, &iinfo->btime);
ceph_decode_timespec64(&ci->i_snap_btime, &iinfo->snap_btime); ceph_decode_timespec64(&ci->i_snap_btime, &iinfo->snap_btime);
} }
......
...@@ -150,14 +150,13 @@ static int parse_reply_info_in(void **p, void *end, ...@@ -150,14 +150,13 @@ static int parse_reply_info_in(void **p, void *end,
info->pool_ns_data = *p; info->pool_ns_data = *p;
*p += info->pool_ns_len; *p += info->pool_ns_len;
} }
/* btime, change_attr */
{ /* btime */
struct ceph_timespec btime; ceph_decode_need(p, end, sizeof(info->btime), bad);
u64 change_attr; ceph_decode_copy(p, &info->btime, sizeof(info->btime));
ceph_decode_need(p, end, sizeof(btime), bad);
ceph_decode_copy(p, &btime, sizeof(btime)); /* change attribute */
ceph_decode_64_safe(p, end, change_attr, bad); ceph_decode_skip_64(p, end, bad);
}
/* dir pin */ /* dir pin */
if (struct_v >= 2) { if (struct_v >= 2) {
...@@ -206,6 +205,12 @@ static int parse_reply_info_in(void **p, void *end, ...@@ -206,6 +205,12 @@ static int parse_reply_info_in(void **p, void *end,
} }
} }
if (features & CEPH_FEATURE_FS_BTIME) {
ceph_decode_need(p, end, sizeof(info->btime), bad);
ceph_decode_copy(p, &info->btime, sizeof(info->btime));
ceph_decode_skip_64(p, end, bad);
}
info->dir_pin = -ENODATA; info->dir_pin = -ENODATA;
/* info->snap_btime remains zero */ /* info->snap_btime remains zero */
} }
......
...@@ -69,6 +69,7 @@ struct ceph_mds_reply_info_in { ...@@ -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 btime;
struct ceph_timespec snap_btime; struct ceph_timespec snap_btime;
}; };
......
...@@ -384,6 +384,7 @@ struct ceph_inode_info { ...@@ -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_btime;
struct timespec64 i_snap_btime; struct timespec64 i_snap_btime;
struct work_struct i_work; struct work_struct i_work;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment