*/
int (*coo_inode_ops)(const struct lu_env *env, struct cl_object *obj,
enum coo_inode_opc opc, void *data);
+ /**
+ * Get ProjID for a request.
+ */
+ void (*coo_req_projid_set)(const struct lu_env *env,
+ struct cl_object *obj, __u32 *projid);
};
/**
/** Generic attributes for the server consumption. */
struct obdo *cra_oa;
/** process jobid/uid/gid performing the io */
- struct job_info cra_jobinfo;
+ struct job_info cra_jobinfo;
};
enum cache_stats_item {
struct ldlm_lock *lock);
int cl_object_inode_ops(const struct lu_env *env, struct cl_object *obj,
enum coo_inode_opc opc, void *data);
-
+void cl_req_projid_set(const struct lu_env *env, struct cl_object *obj,
+ __u32 *projid);
/**
* Returns true, iff \a o0 and \a o1 are slices of the same object.
__u32 lustre_msg_get_magic(struct lustre_msg *msg);
timeout_t lustre_msg_get_timeout(struct lustre_msg *msg);
timeout_t lustre_msg_get_service_timeout(struct lustre_msg *msg);
+int lustre_msg_get_projid(struct lustre_msg *msg, __u32 *projid);
int lustre_msg_get_uid_gid(struct lustre_msg *msg, __u32 *uid, __u32 *gid);
char *lustre_msg_get_jobid(struct lustre_msg *msg);
__u32 lustre_msg_get_cksum(struct lustre_msg *msg);
};
void lustre_msg_set_jobinfo(struct lustre_msg *msg, const struct job_info *ji);
+void lustre_msg_set_projid(struct lustre_msg *msg, __u32 projid);
void lustre_msg_set_cksum(struct lustre_msg *msg, __u32 cksum);
void lustre_msg_set_mbits(struct lustre_msg *msg, __u64 mbits);
int (*m_setxattr)(struct obd_export *exp, const struct lu_fid *fid,
u64 obd_md_valid, const char *name, const void *value,
size_t value_size, unsigned int xattr_flags,
- u32 suppgid, struct ptlrpc_request **req);
+ u32 suppgid, u32 projid, struct ptlrpc_request **req);
int (*m_getxattr)(struct obd_export *exp, const struct lu_fid *fid,
u64 obd_md_valid, const char *name, size_t buf_size,
- struct ptlrpc_request **req);
+ u32 projid, struct ptlrpc_request **req);
int (*m_intent_getattr_async)(struct obd_export *exp,
struct md_op_item *item);
static inline int md_setxattr(struct obd_export *exp, const struct lu_fid *fid,
u64 obd_md_valid, const char *name,
const void *value, size_t value_size,
- unsigned int xattr_flags, u32 suppgid,
+ unsigned int xattr_flags, u32 suppgid, u32 projid,
struct ptlrpc_request **req)
{
int rc;
name, value,
value_size,
xattr_flags,
- suppgid,
+ suppgid, projid,
req);
}
static inline int md_getxattr(struct obd_export *exp, const struct lu_fid *fid,
u64 obd_md_valid, const char *name,
- size_t buf_size, struct ptlrpc_request **req)
+ size_t buf_size, u32 projid,
+ struct ptlrpc_request **req)
{
int rc;
return exp->exp_obd->obd_type->typ_md_ops->m_getxattr(exp, fid,
obd_md_valid,
name, buf_size,
- req);
+ projid, req);
}
static inline int md_set_open_replay_data(struct obd_export *exp,
#define MSG_CONNECT_NEXT_VER 0x00000080 /* use next version of lustre_msg */
#define MSG_CONNECT_TRANSNO 0x00000100 /* client sent transno in replay */
#define MSG_PACK_UID_GID 0x00000200 /* thread UID/GID in ptlrpc_body */
+#define MSG_PACK_PROJID 0x00000400 /* thread PROJID in ptlrpc_body */
/* number of previous object versions in pb_pre_versions[] */
#define PTLRPC_NUM_VERSIONS 4
__u64 pb_last_xid; /* highest replied XID w/o lower unreplied XID*/
__u16 pb_tag; /* multiple modifying RPCs virtual slot index */
__u16 pb_padding0;
- __u32 pb_padding1;
+ __u32 pb_projid; /* req: inode projid, use by tbf rules */
__u64 pb_last_committed;/* rep: highest pb_transno committed to disk */
__u64 pb_transno; /* server-assigned transno for modifying RPCs */
__u32 pb_flags; /* req: MSG_* flags */
__u64 pb_last_xid; /* highest replied XID without lower unreplied XID */
__u16 pb_tag; /* virtual slot idx for multiple modifying RPCs */
__u16 pb_padding0;
- __u32 pb_padding1;
+ __u32 pb_projid; /* req: inode projid, use by tbf rules */
__u64 pb_last_committed;
__u64 pb_transno;
__u32 pb_flags;
# define __USE_GNU 1
# define __USE_XOPEN2K8 1
# define FILEID_LUSTRE 0x97 /* for name_to_handle_at() (and llapi_fd2fid()) */
+# define U32_MAX UINT32_MAX
#endif /* !__KERNEL__ */
#include <linux/fs.h>
#define FS_XFLAG_PROJINHERIT 0x00000200
#endif
+#define MDT_INVALID_UID U32_MAX
+#define MDT_INVALID_GID U32_MAX
+#define MDT_INVALID_PROJID U32_MAX
#define LL_STATFS_LMV 1
#define LL_STATFS_LOV 2
rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode),
value ? OBD_MD_FLXATTR : OBD_MD_FLXATTRRM,
- name, value, value_size, 0, 0, &req);
+ name, value, value_size, 0, 0, ll_i2projid(inode),
+ &req);
+
if (!rc)
ll_i2info(inode)->lli_synced_to_mds = false;
void *fs_data)
{
struct ptlrpc_request *req = NULL;
- struct ll_sb_info *sbi;
int rc;
if (inode == NULL) {
if (is_root_inode(inode))
return -EPERM;
- sbi = ll_i2sbi(inode);
/* Send setxattr request to lower layers directly instead of going
* through the VFS, as there is no xattr handler for "encryption.".
*/
- rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode),
- OBD_MD_FLXATTR, xattr_for_enc(inode),
- ctx, len, XATTR_CREATE, ll_i2suppgid(inode), &req);
+ rc = md_setxattr(ll_i2mdexp(inode), ll_inode2fid(inode), OBD_MD_FLXATTR,
+ xattr_for_enc(inode), ctx, len, XATTR_CREATE,
+ ll_i2suppgid(inode), ll_i2projid(inode), &req);
+
if (rc)
return rc;
ptlrpc_req_put(req);
RETURN(rc);
rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode), OBD_MD_FLXATTR,
- XATTR_NAME_LOV, lmmsize, &req);
+ XATTR_NAME_LOV, lmmsize, ll_i2projid(inode), &req);
if (rc < 0) {
if (rc == -ENODATA)
GOTO(out, rc = 0); /* empty layout */
return &lli->lli_vfs_inode;
}
+static inline __u32 ll_i2projid(struct inode *inode)
+{
+ return ll_i2info(inode)->lli_projid;
+}
+
__u32 ll_i2suppgid(struct inode *i);
void ll_i2gids(__u32 *suppgids, struct inode *i1, struct inode *i2);
lmv_stripe_object_put(&op_data->op_default_lso1);
}
+
+/*
+ * This function determines projid value to pack in metadata requests. This
+ * value is used to "tag" the requests (for TBF purpose).
+ */
+static inline __u32 ll_get_inode_projid(struct inode *i1, struct inode *i2)
+{
+ struct ll_inode_info *lli = NULL;
+
+ if (i2) {
+ lli = ll_i2info(i2);
+ } else if (i1 && S_ISDIR(i1->i_mode)) {
+ /* lookup case, this is a guess (not always true) */
+ if (test_bit(LLIF_PROJECT_INHERIT, &ll_i2info(i1)->lli_flags))
+ lli = ll_i2info(i1);
+ } else if (i1) {
+ lli = ll_i2info(i1);
+ }
+
+ return lli ? lli->lli_projid : 0;
+}
+
/* this function prepares md_op_data hint for passing it down to MD stack. */
struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data,
struct inode *i1, struct inode *i2,
op_data->op_fsgid = from_kgid(&init_user_ns, current_fsgid());
op_data->op_cap = current_cap();
op_data->op_mds = 0;
+ op_data->op_projid = ll_get_inode_projid(i1, i2);
if ((opc == LUSTRE_OPC_CREATE) && (name != NULL) &&
filename_is_volatile(name, namelen, &op_data->op_mds)) {
op_data->op_bias |= MDS_CREATE_VOLATILE;
if (attr->cra_type == CRT_WRITE) {
valid_flags |= OBD_MD_FLMTIME | OBD_MD_FLCTIME;
- obdo_set_o_projid(oa, ll_i2info(inode)->lli_projid);
+ obdo_set_o_projid(oa, lli->lli_projid);
} else if (attr->cra_type == CRT_READ) {
valid_flags |= OBD_MD_FLATIME;
}
if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_INVALID_PFID))
oa->o_parent_oid++;
+ /* Store ProjID any way for server-side TBF schedule. */
+ oa->o_projid = lli->lli_projid;
lli_jobinfo_cpy(lli, &attr->cra_jobinfo);
}
RETURN(rc);
}
+static void vvp_req_projid_set(const struct lu_env *env, struct cl_object *obj,
+ __u32 *projid)
+{
+ struct inode *inode = vvp_object_inode(obj);
+
+ *projid = ll_i2projid(inode);
+}
+
static const struct cl_object_operations vvp_ops = {
.coo_page_init = vvp_page_init,
.coo_io_init = vvp_io_init,
.coo_glimpse = vvp_object_glimpse,
.coo_req_attr_set = vvp_req_attr_set,
.coo_inode_ops = vvp_inode_ops,
+ .coo_req_projid_set = vvp_req_projid_set,
};
static int vvp_object_init0(const struct lu_env *env,
GOTO(out, rc = -ENOMEM);
rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode), valid, fullname,
- pv, size, flags, ll_i2suppgid(inode), &req);
+ pv, size, flags, ll_i2suppgid(inode),
+ ll_i2projid(inode), &req);
kfree(fullname);
if (rc) {
if (rc == -EOPNOTSUPP && handler->flags == XATTR_USER_T) {
} else {
getxattr_nocache:
rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode), valid,
- name, size, &req);
+ name, size, ll_i2projid(inode), &req);
if (rc < 0)
GOTO(out_xattr, rc);
static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid,
u64 obd_md_valid, const char *name, size_t buf_size,
- struct ptlrpc_request **req)
+ u32 projid, struct ptlrpc_request **req)
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
if (IS_ERR(tgt))
RETURN(PTR_ERR(tgt));
- rc = md_getxattr(tgt->ltd_exp, fid, obd_md_valid, name, buf_size, req);
+ rc = md_getxattr(tgt->ltd_exp, fid, obd_md_valid, name, buf_size,
+ projid, req);
RETURN(rc);
}
static int lmv_setxattr(struct obd_export *exp, const struct lu_fid *fid,
- u64 obd_md_valid, const char *name,
- const void *value, size_t value_size,
- unsigned int xattr_flags, u32 suppgid,
- struct ptlrpc_request **req)
+ u64 obd_md_valid, const char *name, const void *value,
+ size_t value_size, unsigned int xattr_flags,
+ u32 suppgid, u32 projid, struct ptlrpc_request **req)
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
if (IS_ERR(tgt))
RETURN(PTR_ERR(tgt));
- rc = md_setxattr(tgt->ltd_exp, fid, obd_md_valid, name,
- value, value_size, xattr_flags, suppgid, req);
+ rc = md_setxattr(tgt->ltd_exp, fid, obd_md_valid, name, value,
+ value_size, xattr_flags, suppgid, projid, req);
RETURN(rc);
}
EXIT;
}
+static void lovsub_req_projid_set(const struct lu_env *env,
+ struct cl_object *obj, __u32 *projid)
+{
+ struct lovsub_object *subobj = cl2lovsub(obj);
+
+ ENTRY;
+ cl_req_projid_set(env, &subobj->lso_super->lo_cl, projid);
+ EXIT;
+}
+
static const struct cl_object_operations lovsub_ops = {
- .coo_attr_update = lovsub_attr_update,
- .coo_glimpse = lovsub_object_glimpse,
- .coo_req_attr_set = lovsub_req_attr_set
+ .coo_attr_update = lovsub_attr_update,
+ .coo_glimpse = lovsub_object_glimpse,
+ .coo_req_attr_set = lovsub_req_attr_set,
+ .coo_req_projid_set = lovsub_req_projid_set,
};
static const struct lu_object_operations lovsub_lu_obj_ops = {
int mdc_tunables_init(struct obd_device *obd);
void mdc_pack_body(struct req_capsule *pill, const struct lu_fid *fid,
- u64 valid, size_t ea_size, u32 suppgid, u32 flags);
+ u64 valid, size_t ea_size, u32 suppgid, u32 flags,
+ u32 projid);
void mdc_swap_layouts_pack(struct req_capsule *pill,
struct md_op_data *op_data);
void mdc_readdir_pack(struct req_capsule *pill, __u64 pgoff, size_t size,
}
void mdc_pack_body(struct req_capsule *pill, const struct lu_fid *fid,
- u64 valid, size_t ea_size, u32 suppgid, u32 flags)
+ u64 valid, size_t ea_size, u32 suppgid, u32 flags,
+ u32 projid)
{
struct mdt_body *b = req_capsule_client_get(pill, &RMF_MDT_BODY);
+
LASSERT(b);
b->mbo_valid = valid;
b->mbo_eadatasize = ea_size;
b->mbo_fid1 = *fid;
b->mbo_valid |= OBD_MD_FLID;
}
+
+ if (projid != MDT_INVALID_PROJID && req_capsule_ptlreq(pill))
+ lustre_msg_set_projid(pill->rc_reqmsg, projid);
}
/**
/* pack the intended request */
mdc_pack_body(&req->rq_pill, &op_data->op_fid1, op_data->op_valid,
- ea_vals_buf_size, -1, 0);
+ ea_vals_buf_size, -1, 0, op_data->op_projid);
/* get SELinux policy info if any */
mdc_file_sepol_pack(&req->rq_pill, sepol);
if (IS_ERR(req))
RETURN(PTR_ERR(req));
+ lustre_msg_set_projid(req->rq_reqmsg, op_data->op_projid);
+
if (resends) {
req->rq_generation_set = 1;
req->rq_import_generation = generation;
ptlrpc_request_free(req);
RETURN(rc);
}
- mdc_pack_body(&req->rq_pill, NULL, 0, 0, -1, 0);
+ mdc_pack_body(&req->rq_pill, NULL, 0, 0, -1, 0, MDT_INVALID_PROJID);
if (fileset != NULL) {
char *name = req_capsule_client_get(&req->rq_pill, &RMF_NAME);
again:
mdc_pack_body(&req->rq_pill, &op_data->op_fid1, op_data->op_valid,
- op_data->op_mode, -1, 0);
+ op_data->op_mode, -1, 0, op_data->op_projid);
req_capsule_set_size(&req->rq_pill, &RMF_ACL, RCL_SERVER, acl_bufsize);
req_capsule_set_size(&req->rq_pill, &RMF_MDT_MD, RCL_SERVER,
op_data->op_mode);
again:
mdc_pack_body(&req->rq_pill, &op_data->op_fid1, op_data->op_valid,
- op_data->op_mode, op_data->op_suppgids[0], 0);
+ op_data->op_mode, op_data->op_suppgids[0], 0,
+ op_data->op_projid);
req_capsule_set_size(&req->rq_pill, &RMF_MDT_MD, RCL_SERVER,
op_data->op_mode);
req_capsule_set_size(&req->rq_pill, &RMF_ACL, RCL_SERVER, acl_bufsize);
const struct lu_fid *fid, int opcode, u64 valid,
const char *xattr_name, const char *input,
int input_size, int output_size, int flags,
- __u32 suppgid, struct ptlrpc_request **request)
+ __u32 suppgid, __u32 projid,
+ struct ptlrpc_request **request)
{
struct ptlrpc_request *req;
struct sptlrpc_sepol *sepol;
rec->sx_time = ktime_get_real_seconds();
rec->sx_size = output_size;
rec->sx_flags = flags;
+ lustre_msg_set_projid(req->rq_reqmsg, projid);
} else {
mdc_pack_body(&req->rq_pill, fid, valid, output_size,
- suppgid, flags);
+ suppgid, flags, projid);
/* Avoid deadlock with modifying RPCs on MDS_REQUEST_PORTAL.
* See LU-15245.
*/
}
static int mdc_setxattr(struct obd_export *exp, const struct lu_fid *fid,
- u64 obd_md_valid, const char *name,
- const void *value, size_t value_size,
- unsigned int xattr_flags, u32 suppgid,
- struct ptlrpc_request **req)
+ u64 obd_md_valid, const char *name, const void *value,
+ size_t value_size, unsigned int xattr_flags,
+ u32 suppgid, u32 projid, struct ptlrpc_request **req)
{
LASSERT(obd_md_valid == OBD_MD_FLXATTR ||
obd_md_valid == OBD_MD_FLXATTRRM);
return mdc_xattr_common(exp, &RQF_MDS_REINT_SETXATTR,
fid, MDS_REINT, obd_md_valid, name,
value, value_size, 0, xattr_flags, suppgid,
- req);
+ projid, req);
}
static int mdc_getxattr(struct obd_export *exp, const struct lu_fid *fid,
u64 obd_md_valid, const char *name, size_t buf_size,
- struct ptlrpc_request **req)
+ u32 projid, struct ptlrpc_request **req)
{
struct mdt_body *body;
int rc;
exp->exp_obd->obd_name, name, PFID(fid));
rc = mdc_xattr_common(exp, &RQF_MDS_GETXATTR, fid, MDS_GETXATTR,
obd_md_valid, name, NULL, 0, buf_size, 0, -1,
- req);
+ projid, req);
if (rc < 0)
GOTO(out, rc);
*/
req->rq_request_portal = MDS_READPAGE_PORTAL;
ptlrpc_at_set_req_timeout(req);
+ lustre_msg_set_projid(req->rq_reqmsg, op_data->op_projid);
if (!obd->u.cli.cl_lsom_update ||
!(exp_connect_flags2(exp) & OBD_CONNECT2_LSOM))
static int mdc_getpage(struct obd_export *exp, const struct lu_fid *fid,
u64 offset, struct page **pages, int npages,
- struct ptlrpc_request **request)
+ __u32 projid, struct ptlrpc_request **request)
{
struct ptlrpc_request *req;
struct ptlrpc_bulk_desc *desc;
req->rq_request_portal = MDS_READPAGE_PORTAL;
ptlrpc_at_set_req_timeout(req);
+ lustre_msg_set_projid(req->rq_reqmsg, projid);
desc = ptlrpc_prep_bulk_imp(req, npages, 1,
PTLRPC_BULK_PUT_SINK,
page_pool[npages] = page;
}
- rc = mdc_getpage(rp->rp_exp, fid, rp->rp_off, page_pool, npages, &req);
+ rc = mdc_getpage(rp->rp_exp, fid, rp->rp_off, page_pool, npages,
+ op_data->op_projid, &req);
if (rc < 0) {
/* page0 is special, which was added into page cache early */
cfs_delete_from_page_cache(page0);
if (IS_ERR(req))
RETURN(PTR_ERR(req));
- mdc_pack_body(&req->rq_pill, NULL, 0, 0, -1, 0);
+ mdc_pack_body(&req->rq_pill, NULL, 0, 0, -1, 0, MDT_INVALID_PROJID);
/* Copy hsm_progress struct */
req_hpk = req_capsule_client_get(&req->rq_pill, &RMF_MDS_HSM_PROGRESS);
RETURN(-ENOMEM);
}
- mdc_pack_body(&req->rq_pill, NULL, 0, 0, -1, 0);
+ mdc_pack_body(&req->rq_pill, NULL, 0, 0, -1, 0, MDT_INVALID_PROJID);
archive_array = req_capsule_client_get(&req->rq_pill,
&RMF_MDS_HSM_ARCHIVE);
}
mdc_pack_body(&req->rq_pill, &op_data->op_fid1, 0, 0,
- op_data->op_suppgids[0], 0);
+ op_data->op_suppgids[0], 0, op_data->op_projid);
ptlrpc_request_set_replen(req);
if (IS_ERR(req))
RETURN(PTR_ERR(req));
- mdc_pack_body(&req->rq_pill, NULL, 0, 0, -1, 0);
+ mdc_pack_body(&req->rq_pill, NULL, 0, 0, -1, 0, MDT_INVALID_PROJID);
ptlrpc_request_set_replen(req);
}
mdc_pack_body(&req->rq_pill, &op_data->op_fid1, 0, 0,
- op_data->op_suppgids[0], 0);
+ op_data->op_suppgids[0], 0, op_data->op_projid);
ptlrpc_request_set_replen(req);
}
mdc_pack_body(&req->rq_pill, &op_data->op_fid1, 0, 0,
- op_data->op_suppgids[0], 0);
+ op_data->op_suppgids[0], 0, op_data->op_projid);
/* Copy states */
req_hss = req_capsule_client_get(&req->rq_pill, &RMF_HSM_STATE_SET);
/* Cancel existing locks */
count = mdc_hsm_request_lock_to_cancel(exp, hur, &cancels);
ldlm_cli_cancel_list(&cancels, count, NULL, NULL, 0);
- mdc_pack_body(&req->rq_pill, NULL, 0, 0, -1, 0);
+ mdc_pack_body(&req->rq_pill, NULL, 0, 0, -1, 0, MDT_INVALID_PROJID);
/* Copy hsm_request struct */
req_hr = req_capsule_client_get(&req->rq_pill, &RMF_MDS_HSM_REQUEST);
}
mdc_pack_body(&req->rq_pill, &op_data->op_fid1, 0, 0,
- op_data->op_suppgids[0], 0);
+ op_data->op_suppgids[0], 0, op_data->op_projid);
b = req_capsule_client_get(&req->rq_pill, &RMF_MDT_BODY);
LASSERT(b);
RETURN(rc);
}
- mdc_pack_body(&req->rq_pill, fid, 0, 0, -1, 0);
+ mdc_pack_body(&req->rq_pill, fid, 0, 0, -1, 0, MDT_INVALID_PROJID);
ptlrpc_request_set_replen(req);
tmp = req_capsule_client_get(&req->rq_pill, &RMF_FID_ARRAY);
memcpy(tmp, fa->fa_fids, flen);
- mdc_pack_body(&req->rq_pill, NULL, 0, 0, -1, 0);
+ mdc_pack_body(&req->rq_pill, NULL, 0, 0, -1, 0, MDT_INVALID_PROJID);
b = req_capsule_client_get(&req->rq_pill, &RMF_MDT_BODY);
b->mbo_ctime = ktime_get_real_seconds();
}
EXPORT_SYMBOL(cl_object_inode_ops);
+void cl_req_projid_set(const struct lu_env *env, struct cl_object *top,
+ __u32 *projid)
+{
+ struct cl_object *obj;
+
+ ENTRY;
+
+ cl_object_for_each(obj, top) {
+ if (obj->co_ops->coo_req_projid_set)
+ obj->co_ops->coo_req_projid_set(env, obj, projid);
+ }
+ EXIT;
+}
+EXPORT_SYMBOL(cl_req_projid_set);
+
/**
* Helper function removing all object locks, and marking object for
* deletion. All object pages must have been deleted at this point.
struct ost_lvb *lvb, osc_enqueue_upcall_f upcall,
void *cookie, struct ldlm_enqueue_info *einfo,
struct ptlrpc_request_set *rqset, int async,
- bool speculative);
+ bool speculative, __u32 projid);
int osc_match_base(const struct lu_env *env, struct obd_export *exp,
struct ldlm_res_id *res_id, enum ldlm_type type,
}
EXPORT_SYMBOL(osc_punch_start);
+static inline void osc_set_projid_info(const struct lu_env *env,
+ struct cl_object *obj, struct obdo *oa)
+{
+ if (!(oa->o_valid & OBD_MD_FLPROJID))
+ cl_req_projid_set(env, obj, &oa->o_projid);
+}
+
static int osc_io_setattr_start(const struct lu_env *env,
const struct cl_io_slice *slice)
{
memset(oa, 0, sizeof(*oa));
if (result == 0) {
oa->o_oi = loi->loi_oi;
+ osc_set_projid_info(env, obj, oa);
obdo_set_parent_fid(oa, io->u.ci_setattr.sa_parent_fid);
oa->o_stripe_idx = io->u.ci_setattr.sa_stripe_index;
oa->o_layout = io->u.ci_setattr.sa_layout;
memset(oa, 0, sizeof(*oa));
oa->o_oi = loi->loi_oi;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
+ osc_set_projid_info(env, slice->cis_obj, oa);
if (dv->dv_flags & (LL_DV_RD_FLUSH | LL_DV_WR_FLUSH)) {
oa->o_valid |= OBD_MD_FLFLAGS;
memset(oa, 0, sizeof(*oa));
oa->o_oi = loi->loi_oi;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
+ osc_set_projid_info(env, osc2cl(obj), oa);
/* reload size abd blocks for start and end of sync range */
oa->o_size = fio->fi_start;
memset(oa, 0, sizeof(*oa));
oa->o_oi = loi->loi_oi;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
+ osc_set_projid_info(env, obj, oa);
obdo_set_parent_fid(oa, lio->lio_fid);
ladvise = ladvise_hdr->lah_advise;
memset(oa, 0, sizeof(*oa));
oa->o_oi = loi->loi_oi;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
+ osc_set_projid_info(env, obj, oa);
oa->o_size = lsio->ls_start;
oa->o_mode = lsio->ls_whence;
if (oio->oi_lockless) {
osc_enqueue_upcall_f upcall = osc_lock_upcall;
void *cookie = oscl;
bool async = false;
- int result;
+ __u32 projid;
+ int result;
ENTRY;
upcall = osc_lock_upcall_speculative;
cookie = osc;
}
+
+ cl_req_projid_set(env, osc2cl(osc), &projid);
result = osc_enqueue_base(exp, resname, &oscl->ols_flags,
policy, &oscl->ols_lvb,
upcall, cookie,
&oscl->ols_einfo, PTLRPCD_SET, async,
- oscl->ols_speculative);
+ oscl->ols_speculative, projid);
if (result == 0) {
if (osc_lock_is_lockless(oscl)) {
oio->oi_lockless = 1;
static int brw_interpret(const struct lu_env *env, struct ptlrpc_request *req,
void *data, int rc);
-static void osc_pack_req_body(struct ptlrpc_request *req, struct obdo *oa)
+static inline
+struct ost_body *osc_pack_req_body(struct ptlrpc_request *req, struct obdo *oa)
{
struct ost_body *body;
LASSERT(body);
lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa, oa);
+ lustre_msg_set_projid(req->rq_reqmsg, oa->o_projid);
+
+ return body;
}
static int osc_getattr(const struct lu_env *env, struct obd_export *exp,
}
osc_pack_req_body(req, oa);
-
ptlrpc_request_set_replen(req);
rc = ptlrpc_queue_wait(req);
}
osc_pack_req_body(req, oa);
-
ptlrpc_request_set_replen(req);
rc = ptlrpc_queue_wait(req);
struct ptlrpc_request_set *rqset)
{
struct ptlrpc_request *req;
- struct ost_body *body;
struct osc_ladvise_args *la;
struct lu_ladvise *req_ladvise;
struct lu_ladvise *ladvise = ladvise_hdr->lah_advise;
req->rq_request_portal = OST_IO_PORTAL;
ptlrpc_at_set_req_timeout(req);
- body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
- LASSERT(body);
- lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa,
- oa);
+ osc_pack_req_body(req, oa);
req_ladvise_hdr = req_capsule_client_get(&req->rq_pill,
&RMF_OST_LADVISE_HDR);
GOTO(out, rc);
}
- body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
- LASSERT(body);
-
- lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa, oa);
+ osc_pack_req_body(req, oa);
ptlrpc_request_set_replen(req);
struct ptlrpc_request *req;
struct osc_setattr_args *sa;
struct obd_import *imp = class_exp2cliimp(exp);
- struct ost_body *body;
int rc;
ENTRY;
ptlrpc_at_set_req_timeout(req);
- body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
-
- lustre_set_wire_obdo(&imp->imp_connect_data, &body->oa, oa);
+ osc_pack_req_body(req, oa);
ptlrpc_request_set_replen(req);
{
struct ptlrpc_request *req;
struct osc_setattr_args *sa;
- struct ost_body *body;
- struct obd_import *imp = class_exp2cliimp(exp);
int rc;
ENTRY;
RETURN(rc);
}
- body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
- LASSERT(body);
-
- lustre_set_wire_obdo(&imp->imp_connect_data, &body->oa, oa);
-
+ osc_pack_req_body(req, oa);
ptlrpc_request_set_replen(req);
req->rq_interpret_reply = osc_setattr_interpret;
{
struct obd_export *exp = osc_export(obj);
struct ptlrpc_request *req;
- struct ost_body *body;
struct osc_fsync_args *fa;
int rc;
}
/* overload the size and blocks fields in the oa with start/end */
- body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
- LASSERT(body);
- lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa, oa);
-
+ osc_pack_req_body(req, oa);
ptlrpc_request_set_replen(req);
req->rq_interpret_reply = osc_sync_interpret;
{
struct client_obd *cli = &exp->exp_obd->u.cli;
struct ptlrpc_request *req;
- struct ost_body *body;
LIST_HEAD(cancels);
int rc, count;
req->rq_request_portal = OST_IO_PORTAL; /* bug 7198 */
ptlrpc_at_set_req_timeout(req);
- body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
- LASSERT(body);
- lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa, oa);
-
+ osc_pack_req_body(req, oa);
ptlrpc_request_set_replen(req);
req->rq_interpret_reply = osc_destroy_interpret;
desc->bd_md_offset = iop_pages;
no_bulk:
- body = req_capsule_client_get(pill, &RMF_OST_BODY);
+ body = osc_pack_req_body(req, oa);
ioobj = req_capsule_client_get(pill, &RMF_OBD_IOOBJ);
niobuf = req_capsule_client_get(pill, &RMF_NIOBUF_REMOTE);
- LASSERT(body != NULL && ioobj != NULL && niobuf != NULL);
-
- lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa, oa);
+ LASSERT(ioobj != NULL && niobuf != NULL);
/* For READ and WRITE, we can't fill o_uid and o_gid using from_kuid()
* and from_kgid(), because they are asynchronous. Fortunately, variable
crattr->cra_flags = OBD_MD_FLMTIME | OBD_MD_FLCTIME | OBD_MD_FLATIME;
cl_req_attr_set(env, osc2cl(obj), crattr);
lustre_msg_set_jobinfo(req->rq_reqmsg, &crattr->cra_jobinfo);
+ lustre_msg_set_projid(req->rq_reqmsg, body->oa.o_projid);
aa = ptlrpc_req_async_args(aa, req);
INIT_LIST_HEAD(&aa->aa_oaps);
struct ost_lvb *lvb, osc_enqueue_upcall_f upcall,
void *cookie, struct ldlm_enqueue_info *einfo,
struct ptlrpc_request_set *rqset, int async,
- bool speculative)
+ bool speculative, __u32 projid)
{
struct obd_device *obd = exp->exp_obd;
struct lustre_handle lockh = { 0 };
- struct ptlrpc_request *req = NULL;
+ struct ptlrpc_request *req;
int intent = *flags & LDLM_FL_HAS_INTENT;
__u64 search_flags = *flags;
__u64 match_flags = 0;
/* users of osc_enqueue() can pass this flag for ldlm_lock_match() */
*flags &= ~LDLM_FL_BLOCK_GRANTED;
+ req = ldlm_enqueue_pack(exp, sizeof(*lvb));
+ if (IS_ERR(req))
+ RETURN(PTR_ERR(req));
+
+ lustre_msg_set_projid(req->rq_reqmsg, projid);
rc = ldlm_cli_enqueue(exp, &req, einfo, res_id, policy, flags, lvb,
sizeof(*lvb), LVB_T_OST, &lockh, async);
+ if (rc)
+ GOTO(out_put, rc);
+
if (async) {
- if (!rc) {
- struct osc_enqueue_args *aa;
-
- aa = ptlrpc_req_async_args(aa, req);
- aa->oa_exp = exp;
- aa->oa_mode = einfo->ei_mode;
- aa->oa_type = einfo->ei_type;
- lustre_handle_copy(&aa->oa_lockh, &lockh);
- aa->oa_upcall = upcall;
- aa->oa_cookie = cookie;
- aa->oa_speculative = speculative;
- if (!speculative) {
- aa->oa_flags = flags;
- aa->oa_lvb = lvb;
- } else {
- /* speculative locks are essentially to enqueue
- * a DLM lock in advance, so we don't care
- * about the result of the enqueue.
- */
- aa->oa_lvb = NULL;
- aa->oa_flags = NULL;
- }
+ struct osc_enqueue_args *aa;
- req->rq_interpret_reply = osc_enqueue_interpret;
- ptlrpc_set_add_req(rqset, req);
+ aa = ptlrpc_req_async_args(aa, req);
+ aa->oa_exp = exp;
+ aa->oa_mode = einfo->ei_mode;
+ aa->oa_type = einfo->ei_type;
+ lustre_handle_copy(&aa->oa_lockh, &lockh);
+ aa->oa_upcall = upcall;
+ aa->oa_cookie = cookie;
+ aa->oa_speculative = speculative;
+ if (!speculative) {
+ aa->oa_flags = flags;
+ aa->oa_lvb = lvb;
+ } else {
+ /* speculative locks are essentially to enqueue a DLM
+ * lock in advance, so we don't care about the result of
+ * the enqueue.
+ */
+ aa->oa_lvb = NULL;
+ aa->oa_flags = NULL;
}
+
+ req->rq_interpret_reply = osc_enqueue_interpret;
+ ptlrpc_set_add_req(rqset, req);
RETURN(rc);
}
rc = osc_enqueue_fini(req, upcall, cookie, &lockh, einfo->ei_mode,
flags, speculative, rc);
+out_put:
+ ptlrpc_req_put(req);
+
RETURN(rc);
}
}
}
+int lustre_msg_get_projid(struct lustre_msg *msg, __u32 *projid)
+{
+ switch (msg->lm_magic) {
+ case LUSTRE_MSG_MAGIC_V2: {
+ struct ptlrpc_body *pb;
+
+ if (msg->lm_buflens[MSG_PTLRPC_BODY_OFF] <
+ sizeof(struct ptlrpc_body))
+ return -EOPNOTSUPP;
+
+ pb = lustre_msg_buf_v2(msg, MSG_PTLRPC_BODY_OFF,
+ sizeof(struct ptlrpc_body));
+
+ if (!pb || !(pb->pb_flags & MSG_PACK_PROJID))
+ return -EOPNOTSUPP;
+
+ if (projid)
+ *projid = pb->pb_projid;
+
+ return 0;
+ }
+ default:
+ CERROR("incorrect message magic: %08x\n", msg->lm_magic);
+ return -EOPNOTSUPP;
+ }
+}
+EXPORT_SYMBOL(lustre_msg_get_projid);
+
int lustre_msg_get_uid_gid(struct lustre_msg *msg, __u32 *uid, __u32 *gid)
{
switch (msg->lm_magic) {
}
EXPORT_SYMBOL(lustre_msg_set_jobinfo);
+void lustre_msg_set_projid(struct lustre_msg *msg, __u32 projid)
+{
+ switch (msg->lm_magic) {
+ case LUSTRE_MSG_MAGIC_V2: {
+ __u32 opc = lustre_msg_get_opc(msg);
+ struct ptlrpc_body *pb;
+
+ /* Don't set projid for ldlm ast RPCs */
+ if (!opc || opc == LDLM_BL_CALLBACK ||
+ opc == LDLM_CP_CALLBACK || opc == LDLM_GL_CALLBACK)
+ return;
+
+ pb = lustre_msg_buf_v2(msg, MSG_PTLRPC_BODY_OFF,
+ sizeof(struct ptlrpc_body));
+ LASSERTF(pb, "invalid msg %px: no ptlrpc body!\n", msg);
+
+ pb->pb_projid = projid;
+ pb->pb_flags |= MSG_PACK_PROJID;
+
+ return;
+ }
+ default:
+ LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic);
+ }
+}
+EXPORT_SYMBOL(lustre_msg_set_projid);
+
void lustre_msg_set_cksum(struct lustre_msg *msg, __u32 cksum)
{
switch (msg->lm_magic) {
__swab64s(&body->pb_last_xid);
__swab16s(&body->pb_tag);
BUILD_BUG_ON(offsetof(typeof(*body), pb_padding0) == 0);
- BUILD_BUG_ON(offsetof(typeof(*body), pb_padding1) == 0);
+ __swab32s(&body->pb_projid);
__swab64s(&body->pb_last_committed);
__swab64s(&body->pb_transno);
__swab32s(&body->pb_flags);
__u64 req_transno = 0;
int req_opc = -1;
__u32 req_flags = (__u32) -1;
- __u32 req_uid = (__u32) -1;
- __u32 req_gid = (__u32) -1;
+ __u32 req_uid = MDT_INVALID_UID;
+ __u32 req_gid = MDT_INVALID_GID;
+ __u32 req_projid = MDT_INVALID_PROJID;
char *req_jobid = NULL;
spin_lock(&req->rq_early_free_lock);
req_opc = lustre_msg_get_opc(req->rq_reqmsg);
req_jobid = lustre_msg_get_jobid(req->rq_reqmsg);
lustre_msg_get_uid_gid(req->rq_reqmsg, &req_uid, &req_gid);
+ lustre_msg_get_projid(req->rq_reqmsg, &req_projid);
req_flags = lustre_msg_get_flags(req->rq_reqmsg);
}
vaf.fmt = fmt;
vaf.va = &args;
libcfs_debug_msg(msgdata,
- "%pV req@%p x%llu/t%lld(%llu) o%d->%s@%s:%d/%d lens %d/%d e %d to %lld dl %lld ref %d fl " REQ_FLAGS_FMT "/%x/%x rc %d/%d job:'%s' uid:%u gid:%u\n",
+ "%pV req@%p x%llu/t%lld(%llu) o%d->%s@%s:%d/%d lens %d/%d e %d to %lld dl %lld ref %d fl " REQ_FLAGS_FMT "/%x/%x rc %d/%d job:'%s' uid:%u gid:%u projid:%u\n",
&vaf,
req, req->rq_xid, req->rq_transno, req_transno,
req_opc,
atomic_read(&req->rq_refcount),
DEBUG_REQ_FLAGS(req), req_flags, rep_flags,
req->rq_status, rep_status,
- req_jobid ?: "", req_uid, req_gid);
+ req_jobid ?: "", req_uid, req_gid, req_projid);
va_end(args);
}
EXPORT_SYMBOL(_debug_req);
(long long)(int)offsetof(struct ptlrpc_body_v3, pb_padding0));
LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding0) == 2, "found %lld\n",
(long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding0));
- LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_padding1) == 36, "found %lld\n",
- (long long)(int)offsetof(struct ptlrpc_body_v3, pb_padding1));
- LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding1) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding1));
+ LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_projid) == 36, "found %lld\n",
+ (long long)(int)offsetof(struct ptlrpc_body_v3, pb_projid));
+ LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_projid) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_projid));
LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_committed) == 40, "found %lld\n",
(long long)(int)offsetof(struct ptlrpc_body_v3, pb_last_committed));
LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_committed) == 8, "found %lld\n",
(int)offsetof(struct ptlrpc_body_v3, pb_padding0), (int)offsetof(struct ptlrpc_body_v2, pb_padding0));
LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding0) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding0), "%d != %d\n",
(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding0), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding0));
- LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_padding1) == (int)offsetof(struct ptlrpc_body_v2, pb_padding1), "%d != %d\n",
- (int)offsetof(struct ptlrpc_body_v3, pb_padding1), (int)offsetof(struct ptlrpc_body_v2, pb_padding1));
- LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding1) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding1), "%d != %d\n",
- (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding1), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding1));
+ LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_projid) == (int)offsetof(struct ptlrpc_body_v2, pb_projid), "%d != %d\n",
+ (int)offsetof(struct ptlrpc_body_v3, pb_projid), (int)offsetof(struct ptlrpc_body_v2, pb_projid));
+ LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_projid) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_projid), "%d != %d\n",
+ (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_projid), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_projid));
LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_committed) == (int)offsetof(struct ptlrpc_body_v2, pb_last_committed), "%d != %d\n",
(int)offsetof(struct ptlrpc_body_v3, pb_last_committed), (int)offsetof(struct ptlrpc_body_v2, pb_last_committed));
LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_committed) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_last_committed), "%d != %d\n",
if (*endptr != '\0')
return -EINVAL;
/* UINT32_MAX is not allowed - see projid_valid()/INVALID_PROJID */
- if (projid_tmp >= UINT32_MAX)
+ if (projid_tmp >= MDT_INVALID_PROJID)
return -ERANGE;
*id = projid_tmp;
CHECK_MEMBER(ptlrpc_body, pb_last_xid);
CHECK_MEMBER(ptlrpc_body, pb_tag);
CHECK_MEMBER(ptlrpc_body, pb_padding0);
- CHECK_MEMBER(ptlrpc_body, pb_padding1);
+ CHECK_MEMBER(ptlrpc_body, pb_projid);
CHECK_MEMBER(ptlrpc_body, pb_last_committed);
CHECK_MEMBER(ptlrpc_body, pb_transno);
CHECK_MEMBER(ptlrpc_body, pb_flags);
CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_last_xid);
CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_tag);
CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_padding0);
- CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_padding1);
+ CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_projid);
CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_last_committed);
CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_transno);
CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_flags);
(long long)(int)offsetof(struct ptlrpc_body_v3, pb_padding0));
LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding0) == 2, "found %lld\n",
(long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding0));
- LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_padding1) == 36, "found %lld\n",
- (long long)(int)offsetof(struct ptlrpc_body_v3, pb_padding1));
- LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding1) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding1));
+ LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_projid) == 36, "found %lld\n",
+ (long long)(int)offsetof(struct ptlrpc_body_v3, pb_projid));
+ LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_projid) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_projid));
LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_committed) == 40, "found %lld\n",
(long long)(int)offsetof(struct ptlrpc_body_v3, pb_last_committed));
LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_committed) == 8, "found %lld\n",
(int)offsetof(struct ptlrpc_body_v3, pb_padding0), (int)offsetof(struct ptlrpc_body_v2, pb_padding0));
LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding0) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding0), "%d != %d\n",
(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding0), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding0));
- LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_padding1) == (int)offsetof(struct ptlrpc_body_v2, pb_padding1), "%d != %d\n",
- (int)offsetof(struct ptlrpc_body_v3, pb_padding1), (int)offsetof(struct ptlrpc_body_v2, pb_padding1));
- LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding1) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding1), "%d != %d\n",
- (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding1), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding1));
+ LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_projid) == (int)offsetof(struct ptlrpc_body_v2, pb_projid), "%d != %d\n",
+ (int)offsetof(struct ptlrpc_body_v3, pb_projid), (int)offsetof(struct ptlrpc_body_v2, pb_projid));
+ LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_projid) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_projid), "%d != %d\n",
+ (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_projid), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_projid));
LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_committed) == (int)offsetof(struct ptlrpc_body_v2, pb_last_committed), "%d != %d\n",
(int)offsetof(struct ptlrpc_body_v3, pb_last_committed), (int)offsetof(struct ptlrpc_body_v2, pb_last_committed));
LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_committed) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_last_committed), "%d != %d\n",