diff options
author | Jeff Layton <jlayton@kernel.org> | 2019-05-29 11:19:42 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2019-07-08 08:01:43 -0400 |
commit | 245ce991cca55eb16cfc43d1655574121b8ed85f (patch) | |
tree | 32b34cf304d0670ba5ceab89ce0a0e3416c666ba /fs/ceph | |
parent | 2c66de560fa2dda0a600e908897116914db8f500 (diff) |
ceph: add btime field to ceph_inode_info
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/inode.c | 2 | ||||
-rw-r--r-- | fs/ceph/mds_client.c | 21 | ||||
-rw-r--r-- | fs/ceph/mds_client.h | 1 | ||||
-rw-r--r-- | fs/ceph/super.h | 1 |
4 files changed, 17 insertions, 8 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index b2988e9f8e15..909f13d4d664 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -509,6 +509,7 @@ struct inode *ceph_alloc_inode(struct super_block *sb) | |||
509 | 509 | ||
510 | INIT_WORK(&ci->i_work, ceph_inode_work); | 510 | INIT_WORK(&ci->i_work, ceph_inode_work); |
511 | ci->i_work_mask = 0; | 511 | ci->i_work_mask = 0; |
512 | memset(&ci->i_btime, '\0', sizeof(ci->i_btime)); | ||
512 | 513 | ||
513 | ceph_fscache_inode_init(ci); | 514 | ceph_fscache_inode_init(ci); |
514 | 515 | ||
@@ -813,6 +814,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page, | |||
813 | dout("%p mode 0%o uid.gid %d.%d\n", inode, inode->i_mode, | 814 | dout("%p mode 0%o uid.gid %d.%d\n", inode, inode->i_mode, |
814 | from_kuid(&init_user_ns, inode->i_uid), | 815 | from_kuid(&init_user_ns, inode->i_uid), |
815 | from_kgid(&init_user_ns, inode->i_gid)); | 816 | from_kgid(&init_user_ns, inode->i_gid)); |
817 | ceph_decode_timespec64(&ci->i_btime, &iinfo->btime); | ||
816 | ceph_decode_timespec64(&ci->i_snap_btime, &iinfo->snap_btime); | 818 | ceph_decode_timespec64(&ci->i_snap_btime, &iinfo->snap_btime); |
817 | } | 819 | } |
818 | 820 | ||
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 598a3fa280a7..636d3df47df6 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -150,14 +150,13 @@ static int parse_reply_info_in(void **p, void *end, | |||
150 | info->pool_ns_data = *p; | 150 | info->pool_ns_data = *p; |
151 | *p += info->pool_ns_len; | 151 | *p += info->pool_ns_len; |
152 | } | 152 | } |
153 | /* btime, change_attr */ | 153 | |
154 | { | 154 | /* btime */ |
155 | struct ceph_timespec btime; | 155 | ceph_decode_need(p, end, sizeof(info->btime), bad); |
156 | u64 change_attr; | 156 | ceph_decode_copy(p, &info->btime, sizeof(info->btime)); |
157 | ceph_decode_need(p, end, sizeof(btime), bad); | 157 | |
158 | ceph_decode_copy(p, &btime, sizeof(btime)); | 158 | /* change attribute */ |
159 | ceph_decode_64_safe(p, end, change_attr, bad); | 159 | ceph_decode_skip_64(p, end, bad); |
160 | } | ||
161 | 160 | ||
162 | /* dir pin */ | 161 | /* dir pin */ |
163 | if (struct_v >= 2) { | 162 | if (struct_v >= 2) { |
@@ -206,6 +205,12 @@ static int parse_reply_info_in(void **p, void *end, | |||
206 | } | 205 | } |
207 | } | 206 | } |
208 | 207 | ||
208 | if (features & CEPH_FEATURE_FS_BTIME) { | ||
209 | ceph_decode_need(p, end, sizeof(info->btime), bad); | ||
210 | ceph_decode_copy(p, &info->btime, sizeof(info->btime)); | ||
211 | ceph_decode_skip_64(p, end, bad); | ||
212 | } | ||
213 | |||
209 | info->dir_pin = -ENODATA; | 214 | info->dir_pin = -ENODATA; |
210 | /* info->snap_btime remains zero */ | 215 | /* info->snap_btime remains zero */ |
211 | } | 216 | } |
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h index 330769ecb601..da2f53646217 100644 --- a/fs/ceph/mds_client.h +++ b/fs/ceph/mds_client.h | |||
@@ -69,6 +69,7 @@ struct ceph_mds_reply_info_in { | |||
69 | u64 max_bytes; | 69 | u64 max_bytes; |
70 | u64 max_files; | 70 | u64 max_files; |
71 | s32 dir_pin; | 71 | s32 dir_pin; |
72 | struct ceph_timespec btime; | ||
72 | struct ceph_timespec snap_btime; | 73 | struct ceph_timespec snap_btime; |
73 | }; | 74 | }; |
74 | 75 | ||
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 81bbb197fc3c..859d1f3a0d4a 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
@@ -384,6 +384,7 @@ struct ceph_inode_info { | |||
384 | int i_snap_realm_counter; /* snap realm (if caps) */ | 384 | int i_snap_realm_counter; /* snap realm (if caps) */ |
385 | struct list_head i_snap_realm_item; | 385 | struct list_head i_snap_realm_item; |
386 | struct list_head i_snap_flush_item; | 386 | struct list_head i_snap_flush_item; |
387 | struct timespec64 i_btime; | ||
387 | struct timespec64 i_snap_btime; | 388 | struct timespec64 i_snap_btime; |
388 | 389 | ||
389 | struct work_struct i_work; | 390 | struct work_struct i_work; |