Skip to content

Commit 3af5ae2

Browse files
lxbszidryomov
authored andcommitted
ceph: make members in struct ceph_mds_request_args_ext a union
In ceph mainline it will allow to set the btime in the setattr request and just add a 'btime' member in the union 'ceph_mds_request_args' and then bump up the header version to 4. That means the total size of union 'ceph_mds_request_args' will increase sizeof(struct ceph_timespec) bytes, but in kclient it will increase the sizeof(setattr_ext) bytes for each request. Since the MDS will always depend on the header's vesion and front_len members to decode the 'ceph_mds_request_head' struct, at the same time kclient hasn't supported the 'btime' feature yet in setattr request, so it's safe to do this change here. This will save 48 bytes memories for each request. Fixes: 4f1ddb1 ("ceph: implement updated ceph_mds_request_head structure") Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Milind Changire <mchangir@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent cd59cde commit 3af5ae2

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

include/linux/ceph/ceph_fs.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -467,17 +467,19 @@ union ceph_mds_request_args {
467467
} __attribute__ ((packed));
468468

469469
union ceph_mds_request_args_ext {
470-
union ceph_mds_request_args old;
471-
struct {
472-
__le32 mode;
473-
__le32 uid;
474-
__le32 gid;
475-
struct ceph_timespec mtime;
476-
struct ceph_timespec atime;
477-
__le64 size, old_size; /* old_size needed by truncate */
478-
__le32 mask; /* CEPH_SETATTR_* */
479-
struct ceph_timespec btime;
480-
} __attribute__ ((packed)) setattr_ext;
470+
union {
471+
union ceph_mds_request_args old;
472+
struct {
473+
__le32 mode;
474+
__le32 uid;
475+
__le32 gid;
476+
struct ceph_timespec mtime;
477+
struct ceph_timespec atime;
478+
__le64 size, old_size; /* old_size needed by truncate */
479+
__le32 mask; /* CEPH_SETATTR_* */
480+
struct ceph_timespec btime;
481+
} __attribute__ ((packed)) setattr_ext;
482+
};
481483
};
482484

483485
#define CEPH_MDS_FLAG_REPLAY 1 /* this is a replayed op */

0 commit comments

Comments
 (0)