@@ -229,8 +229,7 @@ int ceph_pre_init_acls(struct inode *dir, umode_t *mode,
tmp_buf, val_size1);
if (err < 0)
goto out_err;
- ceph_pagelist_encode_32(pagelist, val_size1);
- ceph_pagelist_append(pagelist, tmp_buf, val_size1);
+ ceph_pagelist_encode_string(pagelist, tmp_buf, val_size1);
}
if (default_acl) {
size_t len = strlen(XATTR_NAME_POSIX_ACL_DEFAULT);
@@ -244,8 +243,7 @@ int ceph_pre_init_acls(struct inode *dir, umode_t *mode,
tmp_buf, val_size2);
if (err < 0)
goto out_err;
- ceph_pagelist_encode_32(pagelist, val_size2);
- ceph_pagelist_append(pagelist, tmp_buf, val_size2);
+ ceph_pagelist_encode_string(pagelist, tmp_buf, val_size2);
}
kfree(tmp_buf);
@@ -4607,12 +4607,10 @@ static int osd_req_op_notify_ack_init(struct ceph_osd_request *req, int which,
ceph_pagelist_init(pl);
ret = ceph_pagelist_encode_64(pl, notify_id);
ret |= ceph_pagelist_encode_64(pl, cookie);
- if (payload) {
- ret |= ceph_pagelist_encode_32(pl, payload_len);
- ret |= ceph_pagelist_append(pl, payload, payload_len);
- } else {
+ if (payload)
+ ret |= ceph_pagelist_encode_string(pl, payload, payload_len);
+ else
ret |= ceph_pagelist_encode_32(pl, 0);
- }
if (ret) {
ceph_pagelist_release(pl);
return -ENOMEM;
@@ -4678,8 +4676,7 @@ static int osd_req_op_notify_init(struct ceph_osd_request *req, int which,
ceph_pagelist_init(pl);
ret = ceph_pagelist_encode_32(pl, 1); /* prot_ver */
ret |= ceph_pagelist_encode_32(pl, timeout);
- ret |= ceph_pagelist_encode_32(pl, payload_len);
- ret |= ceph_pagelist_append(pl, payload, payload_len);
+ ret |= ceph_pagelist_encode_string(pl, payload, payload_len);
if (ret) {
ceph_pagelist_release(pl);
return -ENOMEM;
using ceph_pagelist_encode_string() instead of combination of ceph_pagelist_encode_32() and ceph_pagelist_append() when encoding string. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> --- fs/ceph/acl.c | 6 ++---- net/ceph/osd_client.c | 11 ++++------- 2 files changed, 6 insertions(+), 11 deletions(-)