Skip to content

Commit 245ce99

Browse files
jtlaytonidryomov
authored andcommitted
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>
1 parent 2c66de5 commit 245ce99

4 files changed

Lines changed: 17 additions & 8 deletions

File tree

‎fs/ceph/inode.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ struct inode *ceph_alloc_inode(struct super_block *sb)
509509

510510
INIT_WORK(&ci->i_work, ceph_inode_work);
511511
ci->i_work_mask = 0;
512+
memset(&ci->i_btime, '\0', sizeof(ci->i_btime));
512513

513514
ceph_fscache_inode_init(ci);
514515

@@ -813,6 +814,7 @@ static int fill_inode(struct inode *inode, struct page *locked_page,
813814
dout("%p mode 0%o uid.gid %d.%d\n", inode, inode->i_mode,
814815
from_kuid(&init_user_ns, inode->i_uid),
815816
from_kgid(&init_user_ns, inode->i_gid));
817+
ceph_decode_timespec64(&ci->i_btime, &iinfo->btime);
816818
ceph_decode_timespec64(&ci->i_snap_btime, &iinfo->snap_btime);
817819
}
818820

‎fs/ceph/mds_client.c‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,13 @@ static int parse_reply_info_in(void **p, void *end,
150150
info->pool_ns_data = *p;
151151
*p += info->pool_ns_len;
152152
}
153-
/* btime, change_attr */
154-
{
155-
struct ceph_timespec btime;
156-
u64 change_attr;
157-
ceph_decode_need(p, end, sizeof(btime), bad);
158-
ceph_decode_copy(p, &btime, sizeof(btime));
159-
ceph_decode_64_safe(p, end, change_attr, bad);
160-
}
153+
154+
/* btime */
155+
ceph_decode_need(p, end, sizeof(info->btime), bad);
156+
ceph_decode_copy(p, &info->btime, sizeof(info->btime));
157+
158+
/* change attribute */
159+
ceph_decode_skip_64(p, end, bad);
161160

162161
/* dir pin */
163162
if (struct_v >= 2) {
@@ -206,6 +205,12 @@ static int parse_reply_info_in(void **p, void *end,
206205
}
207206
}
208207

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+
209214
info->dir_pin = -ENODATA;
210215
/* info->snap_btime remains zero */
211216
}

‎fs/ceph/mds_client.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ struct ceph_mds_reply_info_in {
6969
u64 max_bytes;
7070
u64 max_files;
7171
s32 dir_pin;
72+
struct ceph_timespec btime;
7273
struct ceph_timespec snap_btime;
7374
};
7475

‎fs/ceph/super.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ struct ceph_inode_info {
384384
int i_snap_realm_counter; /* snap realm (if caps) */
385385
struct list_head i_snap_realm_item;
386386
struct list_head i_snap_flush_item;
387+
struct timespec64 i_btime;
387388
struct timespec64 i_snap_btime;
388389

389390
struct work_struct i_work;

0 commit comments

Comments
 (0)