xattr.c (aaccf3c97418f169afdbb5855e9cbcbda34e90fd) xattr.c (33165d472310262d8c79c7e4d1a17dc60cea7e35)
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/ceph/ceph_debug.h>
3#include <linux/ceph/pagelist.h>
4
5#include "super.h"
6#include "mds_client.h"
7
8#include <linux/ceph/decode.h>

--- 937 unchanged lines hidden (view full) ---

946 struct ceph_mds_request *req;
947 struct ceph_mds_client *mdsc = fsc->mdsc;
948 struct ceph_pagelist *pagelist = NULL;
949 int op = CEPH_MDS_OP_SETXATTR;
950 int err;
951
952 if (size > 0) {
953 /* copy value into pagelist */
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/ceph/ceph_debug.h>
3#include <linux/ceph/pagelist.h>
4
5#include "super.h"
6#include "mds_client.h"
7
8#include <linux/ceph/decode.h>

--- 937 unchanged lines hidden (view full) ---

946 struct ceph_mds_request *req;
947 struct ceph_mds_client *mdsc = fsc->mdsc;
948 struct ceph_pagelist *pagelist = NULL;
949 int op = CEPH_MDS_OP_SETXATTR;
950 int err;
951
952 if (size > 0) {
953 /* copy value into pagelist */
954 pagelist = kmalloc(sizeof(*pagelist), GFP_NOFS);
954 pagelist = ceph_pagelist_alloc(GFP_NOFS);
955 if (!pagelist)
956 return -ENOMEM;
957
955 if (!pagelist)
956 return -ENOMEM;
957
958 ceph_pagelist_init(pagelist);
959 err = ceph_pagelist_append(pagelist, value, size);
960 if (err)
961 goto out;
962 } else if (!value) {
963 if (flags & CEPH_XATTR_REPLACE)
964 op = CEPH_MDS_OP_RMXATTR;
965 else
966 flags |= CEPH_XATTR_REMOVE;

--- 226 unchanged lines hidden ---
958 err = ceph_pagelist_append(pagelist, value, size);
959 if (err)
960 goto out;
961 } else if (!value) {
962 if (flags & CEPH_XATTR_REPLACE)
963 op = CEPH_MDS_OP_RMXATTR;
964 else
965 flags |= CEPH_XATTR_REMOVE;

--- 226 unchanged lines hidden ---