__u32 la_blksize;
/** real device */
__u32 la_rdev;
+ /** project id */
+ __u32 la_projid;
/**
* valid bits
*
LA_BLKSIZE = 1 << 12,
LA_KILL_SUID = 1 << 13,
LA_KILL_SGID = 1 << 14,
+ LA_PROJID = 1 << 15,
};
/**
#define OBD_MD_DEFAULT_MEA (0x0040000000000000ULL) /* default MEA */
#define OBD_MD_FLOSTLAYOUT (0x0080000000000000ULL) /* contain ost_layout */
+#define OBD_MD_FLPROJID (0x0100000000000000ULL) /* project ID */
#define OBD_MD_FLALLQUOTA (OBD_MD_FLUSRQUOTA | \
OBD_MD_FLGRPQUOTA | \
OBD_MD_FLPRJQUOTA)
#define OBD_MD_FLGETATTR (OBD_MD_FLID | OBD_MD_FLATIME | OBD_MD_FLMTIME | \
- OBD_MD_FLCTIME | OBD_MD_FLSIZE | OBD_MD_FLBLKSZ | \
- OBD_MD_FLMODE | OBD_MD_FLTYPE | OBD_MD_FLUID | \
- OBD_MD_FLGID | OBD_MD_FLFLAGS | OBD_MD_FLNLINK | \
- OBD_MD_FLGENER | OBD_MD_FLRDEV | OBD_MD_FLGROUP)
+ OBD_MD_FLCTIME | OBD_MD_FLSIZE | OBD_MD_FLBLKSZ | \
+ OBD_MD_FLMODE | OBD_MD_FLTYPE | OBD_MD_FLUID | \
+ OBD_MD_FLGID | OBD_MD_FLFLAGS | OBD_MD_FLNLINK | \
+ OBD_MD_FLGENER | OBD_MD_FLRDEV | OBD_MD_FLGROUP | \
+ OBD_MD_FLPROJID)
#define OBD_MD_FLXATTRALL (OBD_MD_FLXATTR | OBD_MD_FLXATTRLS)
__u32 mbo_unused3; /* was max_cookiesize until 2.8 */
__u32 mbo_uid_h; /* high 32-bits of uid, for FUID */
__u32 mbo_gid_h; /* high 32-bits of gid, for FUID */
- __u32 mbo_padding_5; /* also fix lustre_swab_mdt_body */
- __u64 mbo_padding_6;
+ __u32 mbo_projid;
+ __u64 mbo_padding_6; /* also fix lustre_swab_mdt_body */
__u64 mbo_padding_7;
__u64 mbo_padding_8;
__u64 mbo_padding_9;
#define MDS_ATTR_CTIME_SET 0x2000ULL /* = 8192 */
#define MDS_ATTR_FROM_OPEN 0x4000ULL /* = 16384, called from open path, ie O_TRUNC */
#define MDS_ATTR_BLOCKS 0x8000ULL /* = 32768 */
+#define MDS_ATTR_PROJID 0x10000ULL /* = 65536 */
#ifndef FMODE_READ
#define FMODE_READ 00000001
struct llog_rec_tail lsr_tail;
} __attribute__((packed));
+/* Extended to support project quota */
+struct llog_setattr64_rec_v2 {
+ struct llog_rec_hdr lsr_hdr;
+ struct ost_id lsr_oi;
+ __u32 lsr_uid;
+ __u32 lsr_uid_h;
+ __u32 lsr_gid;
+ __u32 lsr_gid_h;
+ __u64 lsr_valid;
+ __u32 lsr_projid;
+ __u32 lsr_padding1;
+ __u64 lsr_padding2;
+ __u64 lsr_padding3;
+ struct llog_rec_tail lsr_tail;
+} __attribute__((packed));
+
struct llog_size_change_rec {
struct llog_rec_hdr lsc_hdr;
struct ll_fid lsc_fid;
* each stripe.
* brw: grant space consumed on
* the client for the write */
- __u64 o_padding_4;
+ __u32 o_projid;
+ __u32 o_padding_4;
__u64 o_padding_5;
__u64 o_padding_6;
};
void obdo_from_inode(struct obdo *dst, struct inode *src, u64 valid);
void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent);
+void obdo_set_o_projid(struct obdo *dst, u32 projid);
/* return 1 if client should be resend request */
static inline int client_should_resend(int resend, struct client_obd *cli)
__u32 lli_layout_gen;
spinlock_t lli_layout_lock;
+ __u32 lli_projid; /* project id */
+
struct rw_semaphore lli_xattrs_list_rwsem;
struct mutex lli_xattrs_enq_lock;
struct list_head lli_xattrs; /* ll_xattr_entry->xe_list */
inode->i_uid = make_kuid(&init_user_ns, body->mbo_uid);
if (body->mbo_valid & OBD_MD_FLGID)
inode->i_gid = make_kgid(&init_user_ns, body->mbo_gid);
+ if (body->mbo_valid & OBD_MD_FLPROJID)
+ lli->lli_projid = body->mbo_projid;
if (body->mbo_valid & OBD_MD_FLFLAGS)
inode->i_flags = ll_ext_to_inode_flags(body->mbo_flags);
if (body->mbo_valid & OBD_MD_FLNLINK)
oa = attr->cra_oa;
inode = vvp_object_inode(obj);
- if (attr->cra_type == CRT_WRITE)
+ if (attr->cra_type == CRT_WRITE) {
valid_flags |= OBD_MD_FLMTIME | OBD_MD_FLCTIME |
OBD_MD_FLUID | OBD_MD_FLGID;
+ obdo_set_o_projid(oa, ll_i2info(inode)->lli_projid);
+ }
obdo_from_inode(oa, inode, valid_flags & attr->cra_flags);
obdo_set_parent_fid(oa, &ll_i2info(inode)->lli_fid);
if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_INVALID_PFID))
RETURN(rc);
/* osp_declare_attr_set() ignores all attributes other than
- * UID, GID, and size, and osp_attr_set() ignores all but UID
- * and GID. Declaration of size attr setting happens through
- * lod_declare_init_size(), and not through this function.
+ * UID, GID, PID, and size, and osp_attr_set() ignores all but
+ * UID, GID and PID. Declaration of size attr setting happens
+ * through lod_declare_init_size(), and not through this function.
* Therefore we need not load striping unless ownership is
* changing. This should save memory and (we hope) speed up
* rename(). */
if (!S_ISDIR(dt->do_lu.lo_header->loh_attr)) {
- if (!(attr->la_valid & (LA_UID | LA_GID)))
+ if (!(attr->la_valid & (LA_UID | LA_GID | LA_PROJID)))
RETURN(rc);
if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_OWNER))
RETURN(0);
} else {
- if (!(attr->la_valid & (LA_UID | LA_GID | LA_MODE |
+ if (!(attr->la_valid & (LA_UID | LA_GID | LA_PROJID | LA_MODE |
LA_ATIME | LA_MTIME | LA_CTIME |
LA_FLAGS)))
RETURN(rc);
RETURN(rc);
if (!S_ISDIR(dt->do_lu.lo_header->loh_attr)) {
- if (!(attr->la_valid & (LA_UID | LA_GID)))
+ if (!(attr->la_valid & (LA_UID | LA_GID | LA_PROJID)))
RETURN(rc);
if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_OWNER))
RETURN(0);
} else {
- if (!(attr->la_valid & (LA_UID | LA_GID | LA_MODE |
+ if (!(attr->la_valid & (LA_UID | LA_GID | LA_MODE | LA_PROJID |
LA_ATIME | LA_MTIME | LA_CTIME |
LA_FLAGS)))
RETURN(rc);
RETURN(rc);
attr->la_valid = LA_ATIME | LA_MTIME | LA_CTIME |
- LA_MODE | LA_UID | LA_GID | LA_TYPE;
+ LA_MODE | LA_UID | LA_GID | LA_TYPE | LA_PROJID;
dof->dof_type = DFT_DIR;
rc = lod_prep_lmv_md(env, dt, &lmv_buf);
b->mbo_valid |= OBD_MD_FLGID;
}
+ if (attr->la_valid & LA_PROJID) {
+ /* TODO, nodemap for project id */
+ b->mbo_projid = attr->la_projid;
+ b->mbo_valid |= OBD_MD_FLPROJID;
+ }
+
b->mbo_mode = attr->la_mode;
if (attr->la_valid & LA_MODE)
b->mbo_valid |= OBD_MD_FLMODE;
out |= LA_KILL_SUID;
if (in & MDS_ATTR_KILL_SGID)
out |= LA_KILL_SGID;
+ if (in & MDS_ATTR_PROJID)
+ out |= LA_PROJID;
if (in & MDS_ATTR_FROM_OPEN)
rr->rr_flags |= MRF_OPEN_TRUNC;
if (in & MDS_ATTR_FORCE)
ma->ma_attr_flags |= MDS_PERM_BYPASS;
- in &= ~(MDS_ATTR_MODE | MDS_ATTR_UID | MDS_ATTR_GID |
+ in &= ~(MDS_ATTR_MODE | MDS_ATTR_UID | MDS_ATTR_GID | MDS_ATTR_PROJID |
MDS_ATTR_ATIME | MDS_ATTR_MTIME | MDS_ATTR_CTIME |
MDS_ATTR_ATIME_SET | MDS_ATTR_CTIME_SET | MDS_ATTR_MTIME_SET |
MDS_ATTR_SIZE | MDS_ATTR_BLOCKS | MDS_ATTR_ATTR_FLAG |
struct md_attr *ma)
{
struct mdt_lock_handle *lh;
- int do_vbr = ma->ma_attr.la_valid & (LA_MODE|LA_UID|LA_GID|LA_FLAGS);
+ int do_vbr = ma->ma_attr.la_valid &
+ (LA_MODE|LA_UID|LA_GID|LA_PROJID|LA_FLAGS);
__u64 lockpart = MDS_INODELOCK_UPDATE;
struct ldlm_enqueue_info *einfo = &info->mti_einfo;
struct lu_fid *s0_fid = &info->mti_tmp_fid1;
}
/* Ensure constant striping during chown(). See LU-2789. */
- if (ma->ma_attr.la_valid & (LA_UID|LA_GID))
+ if (ma->ma_attr.la_valid & (LA_UID|LA_GID|LA_PROJID))
mutex_lock(&mo->mot_lov_mutex);
/* all attrs are packed into mti_attr in unpack_setattr */
rc = mo_attr_set(info->mti_env, mdt_object_child(mo), ma);
- if (ma->ma_attr.la_valid & (LA_UID|LA_GID))
+ if (ma->ma_attr.la_valid & (LA_UID|LA_GID|LA_PROJID))
mutex_unlock(&mo->mot_lov_mutex);
if (rc != 0)
dst->o_gid = la->la_gid;
newvalid |= OBD_MD_FLGID;
}
+ if (valid & LA_PROJID) {
+ dst->o_projid = la->la_projid;
+ newvalid |= OBD_MD_FLPROJID;
+ }
if (valid & LA_FLAGS) {
dst->o_flags = la->la_flags;
newvalid |= OBD_MD_FLFLAGS;
dst->la_gid = obdo->o_gid;
newvalid |= LA_GID;
}
+ if (valid & OBD_MD_FLPROJID) {
+ dst->la_projid = obdo->o_projid;
+ newvalid |= LA_PROJID;
+ }
if (valid & OBD_MD_FLFLAGS) {
dst->la_flags = obdo->o_flags;
newvalid |= LA_FLAGS;
__swab32s(&lsr->lsr_gid);
__swab32s(&lsr->lsr_gid_h);
__swab64s(&lsr->lsr_valid);
- tail = &lsr->lsr_tail;
+
+ if (rec->lrh_len > sizeof(struct llog_setattr64_rec)) {
+ struct llog_setattr64_rec_v2 *lsr2 =
+ (struct llog_setattr64_rec_v2 *)rec;
+
+ __swab32s(&lsr2->lsr_projid);
+ tail = &lsr2->lsr_tail;
+ } else {
+ tail = &lsr->lsr_tail;
+ }
break;
}
case OBD_CFG_REC:
}
EXPORT_SYMBOL(obdo_set_parent_fid);
+void obdo_set_o_projid(struct obdo *dst, u32 projid)
+{
+ dst->o_projid = projid;
+ dst->o_valid |= OBD_MD_FLPROJID;
+}
+EXPORT_SYMBOL(obdo_set_o_projid);
+
/* WARNING: the file systems must take care not to tinker with
attributes they don't manage (such as blocks). */
void obdo_from_inode(struct obdo *dst, struct inode *src, u64 valid)
__u64 curr_version;
obdo_from_la(&repbody->oa, &fti->fti_attr,
- OFD_VALID_FLAGS | LA_UID | LA_GID);
+ OFD_VALID_FLAGS | LA_UID | LA_GID | LA_PROJID);
/* Store object version in reply */
curr_version = dt_version_get(tsi->tsi_env,
GOTO(out_put, rc);
obdo_from_la(&repbody->oa, &fti->fti_attr,
- OFD_VALID_FLAGS | LA_UID | LA_GID);
+ OFD_VALID_FLAGS | LA_UID | LA_GID | LA_PROJID);
ofd_counter_incr(tsi->tsi_exp, LPROC_OFD_STATS_SETATTR,
tsi->tsi_jobid, 1);
int ofd_object_destroy(const struct lu_env *, struct ofd_object *, int);
int ofd_attr_get(const struct lu_env *env, struct ofd_object *fo,
struct lu_attr *la);
-int ofd_attr_handle_ugid(const struct lu_env *env, struct ofd_object *fo,
+int ofd_attr_handle_id(const struct lu_env *env, struct ofd_object *fo,
struct lu_attr *la, int is_setattr);
static inline
dt_obj = ofd_object_child(ofd_obj);
LASSERT(dt_obj != NULL);
- la->la_valid &= LA_UID | LA_GID;
+ la->la_valid &= LA_UID | LA_GID | LA_PROJID;
- rc = ofd_attr_handle_ugid(env, ofd_obj, la, 0 /* !is_setattr */);
+ rc = ofd_attr_handle_id(env, ofd_obj, la, 0 /* !is_setattr */);
if (rc != 0)
GOTO(out, rc);
if (rc)
GOTO(out_tx, rc);
- /* set uid/gid */
+ /* set uid/gid/pid */
if (la->la_valid) {
rc = dt_attr_set(env, dt_obj, la, th);
if (rc)
* to be changed to ofd_fmd_get() to create the fmd if it
* doesn't already exist so we can store the reservation handle
* there. */
- valid = OBD_MD_FLUID | OBD_MD_FLGID;
+ valid = OBD_MD_FLUID | OBD_MD_FLGID | OBD_MD_FLPROJID;
fmd = ofd_fmd_find(exp, fid);
if (!fmd || fmd->fmd_mactime_xid < info->fti_xid)
valid |= OBD_MD_FLATIME | OBD_MD_FLMTIME |
oa->o_grant_used, old_rc);
if (rc == 0)
obdo_from_la(oa, &info->fti_attr,
- OFD_VALID_FLAGS | LA_GID | LA_UID);
+ OFD_VALID_FLAGS | LA_GID | LA_UID |
+ LA_PROJID);
else
- obdo_from_la(oa, &info->fti_attr, LA_GID | LA_UID);
+ obdo_from_la(oa, &info->fti_attr, LA_GID | LA_UID |
+ LA_PROJID);
/* don't report overquota flag if we failed before reaching
* commit */
__u64 curr_version;
obdo_from_la(oa, &info->fti_attr,
- OFD_VALID_FLAGS | LA_UID | LA_GID);
+ OFD_VALID_FLAGS | LA_UID | LA_GID | LA_PROJID);
/* Store object version in reply */
curr_version = dt_version_get(env, ofd_object_child(fo));
*
* If the object still has SUID+SGID bits set, meaning that it was precreated
* by the MDT before it was assigned to any file, (see ofd_precreate_objects())
- * then we will accept the UID+GID if sent by the client for initializing the
- * ownership of this object. We only allow this to happen once (so clear these
- * bits) and later only allow setattr.
+ * then we will accept the UID/GID/PROJID if sent by the client for initializing
+ * the ownership of this object. We only allow this to happen once (so clear
+ * these bits) and later only allow setattr.
*
* \param[in] env execution environment
* \param[in] fo OFD object
* \retval 0 if successful
* \retval negative value on error
*/
-int ofd_attr_handle_ugid(const struct lu_env *env, struct ofd_object *fo,
+int ofd_attr_handle_id(const struct lu_env *env, struct ofd_object *fo,
struct lu_attr *la, int is_setattr)
{
struct ofd_thread_info *info = ofd_info(env);
ENTRY;
- if (!(la->la_valid & LA_UID) && !(la->la_valid & LA_GID))
+ if (!(la->la_valid & LA_UID) && !(la->la_valid & LA_GID) &&
+ !(la->la_valid & LA_PROJID))
RETURN(0);
rc = dt_attr_get(env, ofd_object_child(fo), ln);
LASSERT(ln->la_valid & LA_MODE);
+ /*
+ * Only allow setattr to change UID/GID/PROJID, if
+ * SUID+SGID is not set which means this is not
+ * initialization of this objects.
+ */
if (!is_setattr) {
if (!(ln->la_mode & S_ISUID))
- la->la_valid &= ~LA_UID;
+ la->la_valid &= ~(LA_UID | LA_PROJID);
if (!(ln->la_mode & S_ISGID))
- la->la_valid &= ~LA_GID;
+ la->la_valid &= ~(LA_GID | LA_PROJID);
}
+ /* Initialize ownership of this object, clear SUID+SGID bits*/
if ((la->la_valid & LA_UID) && (ln->la_mode & S_ISUID))
mask |= S_ISUID;
if ((la->la_valid & LA_GID) && (ln->la_mode & S_ISGID))
if (rc)
GOTO(unlock, rc);
- rc = ofd_attr_handle_ugid(env, fo, la, 1 /* is_setattr */);
+ rc = ofd_attr_handle_id(env, fo, la, 1 /* is_setattr */);
if (rc != 0)
GOTO(unlock, rc);
if (rc)
GOTO(unlock, rc);
- rc = ofd_attr_handle_ugid(env, fo, la, 0 /* !is_setattr */);
+ rc = ofd_attr_handle_id(env, fo, la, 0 /* !is_setattr */);
if (rc != 0)
GOTO(unlock, rc);
{
attr->la_valid |= LA_ATIME | LA_MTIME | LA_CTIME | LA_MODE |
LA_SIZE | LA_BLOCKS | LA_UID | LA_GID |
- LA_FLAGS | LA_NLINK | LA_RDEV | LA_BLKSIZE |
- LA_TYPE;
+ LA_PROJID | LA_FLAGS | LA_NLINK | LA_RDEV |
+ LA_BLKSIZE | LA_TYPE;
attr->la_atime = LTIME_S(inode->i_atime);
attr->la_mtime = LTIME_S(inode->i_mtime);
attr->la_blocks = inode->i_blocks;
attr->la_uid = i_uid_read(inode);
attr->la_gid = i_gid_read(inode);
+ attr->la_projid = i_projid_read(inode);
attr->la_flags = ll_inode_to_ext_flags(inode->i_flags);
attr->la_nlink = inode->i_nlink;
attr->la_rdev = inode->i_rdev;
return 0;
}
+static int osd_declare_attr_qid(const struct lu_env *env,
+ struct osd_object *obj,
+ struct osd_thandle *oh, long long bspace,
+ qid_t old_id, qid_t new_id, bool enforce,
+ unsigned type)
+{
+ int rc;
+ struct osd_thread_info *info = osd_oti_get(env);
+ struct lquota_id_info *qi = &info->oti_qi;
+
+ qi->lqi_type = type;
+ /* inode accounting */
+ qi->lqi_is_blk = false;
+
+ /* one more inode for the new id ... */
+ qi->lqi_id.qid_uid = new_id;
+ qi->lqi_space = 1;
+ /* Reserve credits for the new id */
+ rc = osd_declare_qid(env, oh, qi, NULL, enforce, NULL);
+ if (rc == -EDQUOT || rc == -EINPROGRESS)
+ rc = 0;
+ if (rc)
+ RETURN(rc);
+
+ /* and one less inode for the current id */
+ qi->lqi_id.qid_uid = old_id;
+ qi->lqi_space = -1;
+ rc = osd_declare_qid(env, oh, qi, obj, enforce, NULL);
+ if (rc == -EDQUOT || rc == -EINPROGRESS)
+ rc = 0;
+ if (rc)
+ RETURN(rc);
+
+ /* block accounting */
+ qi->lqi_is_blk = true;
+
+ /* more blocks for the new uid ... */
+ qi->lqi_id.qid_uid = new_id;
+ qi->lqi_space = bspace;
+ /*
+ * Credits for the new uid has been reserved, re-use "obj"
+ * to save credit reservation.
+ */
+ rc = osd_declare_qid(env, oh, qi, obj, enforce, NULL);
+ if (rc == -EDQUOT || rc == -EINPROGRESS)
+ rc = 0;
+ if (rc)
+ RETURN(rc);
+
+ /* and finally less blocks for the current uid */
+ qi->lqi_id.qid_uid = old_id;
+ qi->lqi_space = -bspace;
+ rc = osd_declare_qid(env, oh, qi, obj, enforce, NULL);
+ if (rc == -EDQUOT || rc == -EINPROGRESS)
+ rc = 0;
+
+ RETURN(rc);
+}
+
static int osd_declare_attr_set(const struct lu_env *env,
struct dt_object *dt,
const struct lu_attr *attr,
{
struct osd_thandle *oh;
struct osd_object *obj;
- struct osd_thread_info *info = osd_oti_get(env);
- struct lquota_id_info *qi = &info->oti_qi;
qid_t uid;
qid_t gid;
long long bspace;
if (attr->la_valid & LA_UID || attr->la_valid & LA_GID) {
/* USERQUOTA */
uid = i_uid_read(obj->oo_inode);
- qi->lqi_type = USRQUOTA;
enforce = (attr->la_valid & LA_UID) && (attr->la_uid != uid);
- /* inode accounting */
- qi->lqi_is_blk = false;
-
- /* one more inode for the new uid ... */
- qi->lqi_id.qid_uid = attr->la_uid;
- qi->lqi_space = 1;
- /* Reserve credits for the new uid */
- rc = osd_declare_qid(env, oh, qi, NULL, enforce, NULL);
- if (rc == -EDQUOT || rc == -EINPROGRESS)
- rc = 0;
+ rc = osd_declare_attr_qid(env, obj, oh, bspace, uid,
+ attr->la_uid, enforce, USRQUOTA);
if (rc)
RETURN(rc);
- /* and one less inode for the current uid */
- qi->lqi_id.qid_uid = uid;
- qi->lqi_space = -1;
- rc = osd_declare_qid(env, oh, qi, obj, enforce, NULL);
- if (rc == -EDQUOT || rc == -EINPROGRESS)
- rc = 0;
- if (rc)
- RETURN(rc);
-
- /* block accounting */
- qi->lqi_is_blk = true;
-
- /* more blocks for the new uid ... */
- qi->lqi_id.qid_uid = attr->la_uid;
- qi->lqi_space = bspace;
- /*
- * Credits for the new uid has been reserved, re-use "obj"
- * to save credit reservation.
- */
- rc = osd_declare_qid(env, oh, qi, obj, enforce, NULL);
- if (rc == -EDQUOT || rc == -EINPROGRESS)
- rc = 0;
- if (rc)
- RETURN(rc);
-
- /* and finally less blocks for the current uid */
- qi->lqi_id.qid_uid = uid;
- qi->lqi_space = -bspace;
- rc = osd_declare_qid(env, oh, qi, obj, enforce, NULL);
- if (rc == -EDQUOT || rc == -EINPROGRESS)
- rc = 0;
- if (rc)
- RETURN(rc);
-
- /* GROUP QUOTA */
gid = i_gid_read(obj->oo_inode);
- qi->lqi_type = GRPQUOTA;
enforce = (attr->la_valid & LA_GID) && (attr->la_gid != gid);
-
- /* inode accounting */
- qi->lqi_is_blk = false;
-
- /* one more inode for the new gid ... */
- qi->lqi_id.qid_gid = attr->la_gid;
- qi->lqi_space = 1;
- rc = osd_declare_qid(env, oh, qi, NULL, enforce, NULL);
- if (rc == -EDQUOT || rc == -EINPROGRESS)
- rc = 0;
+ rc = osd_declare_attr_qid(env, obj, oh, bspace,
+ i_gid_read(obj->oo_inode), attr->la_gid,
+ enforce, GRPQUOTA);
if (rc)
RETURN(rc);
- /* and one less inode for the current gid */
- qi->lqi_id.qid_gid = gid;
- qi->lqi_space = -1;
- rc = osd_declare_qid(env, oh, qi, obj, enforce, NULL);
- if (rc == -EDQUOT || rc == -EINPROGRESS)
- rc = 0;
- if (rc)
- RETURN(rc);
-
- /* block accounting */
- qi->lqi_is_blk = true;
-
- /* more blocks for the new gid ... */
- qi->lqi_id.qid_gid = attr->la_gid;
- qi->lqi_space = bspace;
- rc = osd_declare_qid(env, oh, qi, obj, enforce, NULL);
- if (rc == -EDQUOT || rc == -EINPROGRESS)
- rc = 0;
- if (rc)
- RETURN(rc);
-
- /* and finally less blocks for the current gid */
- qi->lqi_id.qid_gid = gid;
- qi->lqi_space = -bspace;
- rc = osd_declare_qid(env, oh, qi, obj, enforce, NULL);
- if (rc == -EDQUOT || rc == -EINPROGRESS)
- rc = 0;
+ }
+#ifdef HAVE_PROJECT_QUOTA
+ if (attr->la_valid & LA_PROJID) {
+ __u32 projid = i_projid_read(obj->oo_inode);
+ enforce = (attr->la_valid & LA_PROJID) &&
+ (attr->la_projid != projid);
+ rc = osd_declare_attr_qid(env, obj, oh, bspace,
+ (qid_t)projid, (qid_t)attr->la_projid,
+ enforce, PRJQUOTA);
if (rc)
RETURN(rc);
}
-
+#endif
RETURN(rc);
}
i_uid_write(inode, attr->la_uid);
if (bits & LA_GID)
i_gid_write(inode, attr->la_gid);
+ if (bits & LA_PROJID)
+ i_projid_write(inode, attr->la_projid);
if (bits & LA_NLINK)
set_nlink(inode, attr->la_nlink);
if (bits & LA_RDEV)
static int osd_quota_transfer(struct inode *inode, const struct lu_attr *attr)
{
+ int rc;
+
if ((attr->la_valid & LA_UID && attr->la_uid != i_uid_read(inode)) ||
(attr->la_valid & LA_GID && attr->la_gid != i_gid_read(inode))) {
struct iattr iattr;
- int rc;
ll_vfs_dq_init(inode);
iattr.ia_valid = 0;
return rc;
}
}
+
+#ifdef HAVE_PROJECT_QUOTA
+ /* Handle project id Transfer here properly */
+ if (attr->la_valid & LA_PROJID && attr->la_projid !=
+ i_projid_read(inode)) {
+ rc = __ldiskfs_ioctl_setproject(inode, attr->la_projid);
+ if (rc) {
+ CERROR("%s: quota transfer failed: rc = %d. Is quota "
+ "enforcement enabled on the ldiskfs "
+ "filesystem?\n", inode->i_sb->s_id, rc);
+ return rc;
+ }
+ }
+#endif
return 0;
}
if (!attr)
RETURN(0);
- rc = osd_declare_inode_qid(env, attr->la_uid, attr->la_gid, 1, oh,
- osd_dt_obj(dt), false, NULL, false);
+ rc = osd_declare_inode_qid(env, attr->la_uid, attr->la_gid,
+ attr->la_projid, 1, oh, osd_dt_obj(dt),
+ false, NULL, false);
if (rc != 0)
RETURN(rc);
osd_dto_credits_noquota[DTO_INDEX_DELETE] + 3);
/* one less inode */
rc = osd_declare_inode_qid(env, i_uid_read(inode), i_gid_read(inode),
- -1, oh, obj, false, NULL, false);
+ i_projid_read(inode), -1, oh, obj, false,
+ NULL, false);
if (rc)
RETURN(rc);
/* data to be truncated */
rc = osd_declare_inode_qid(env, i_uid_read(inode), i_gid_read(inode),
- 0, oh, obj, true, NULL, false);
+ i_projid_read(inode), 0, oh, obj, true,
+ NULL, false);
if (rc)
RETURN(rc);
RETURN(-ENOENT);
rc = osd_declare_inode_qid(env, i_uid_read(inode), i_gid_read(inode),
- 0, oh, osd_dt_obj(dt), true, NULL, false);
+ i_projid_read(inode), 0, oh, osd_dt_obj(dt),
+ true, NULL, false);
RETURN(rc);
}
* calculate how many blocks will be consumed by this index
* insert */
rc = osd_declare_inode_qid(env, i_uid_read(inode),
- i_gid_read(inode), 0, oh,
- osd_dt_obj(dt), true, NULL, false);
+ i_gid_read(inode),
+ i_projid_read(inode), 0,
+ oh, osd_dt_obj(dt), true,
+ NULL, false);
}
RETURN(rc);
#define OSD_STATFS_RESERVED (1ULL << 23) /* 8MB */
#define OSD_STATFS_RESERVED_SHIFT (7) /* reserve 0.78% of all space */
+/* check if ldiskfs support project quota */
+#ifndef LDISKFS_IOC_FSSETXATTR
+#undef HAVE_PROJECT_QUOTA
+#endif
+
struct osd_directory {
struct iam_container od_container;
struct iam_descr od_descr;
#define FULL_SCRUB_THRESHOLD_RATE_DEFAULT 60
-/* There are at most 10 uid/gids are affected in a transaction, and
+/* There are at most 15 uid/gid/projids are affected in a transaction, and
* that's rename case:
- * - 2 for source parent uid & gid;
- * - 2 for source child uid & gid ('..' entry update when child is directory);
- * - 2 for target parent uid & gid;
- * - 2 for target child uid & gid (if the target child exists);
- * - 2 for root uid & gid (last_rcvd, llog, etc);
+ * - 3 for source parent uid & gid & projid;
+ * - 3 for source child uid & gid & projid ('..' entry update when
+ * child is directory);
+ * - 3 for target parent uid & gid & projid;
+ * - 3 for target child uid & gid & projid(if the target child exists);
+ * - 3 for root uid & gid(last_rcvd, llog, etc);
*
*/
-#define OSD_MAX_UGID_CNT 10
+#define OSD_MAX_UGID_CNT 15
enum osd_op_type {
OSD_OT_ATTR_SET = 0,
struct lquota_id_info *qi, struct osd_object *obj,
bool enforce, int *flags);
int osd_declare_inode_qid(const struct lu_env *env, qid_t uid, qid_t gid,
- long long space, struct osd_thandle *oh,
+ __u32 projid, long long space, struct osd_thandle *oh,
struct osd_object *obj, bool is_blk, int *flags,
bool force);
const struct dt_rec *osd_quota_pack(struct osd_object *obj,
}
#endif
+#ifdef HAVE_PROJECT_QUOTA
+static inline __u32 i_projid_read(struct inode *inode)
+{
+ return (__u32)from_kprojid(&init_user_ns, LDISKFS_I(inode)->i_projid);
+}
+
+static inline void i_projid_write(struct inode *inode, __u32 projid)
+{
+ kprojid_t kprojid;
+ kprojid = make_kprojid(&init_user_ns, (projid_t)projid);
+ LDISKFS_I(inode)->i_projid = kprojid;
+}
+#else
+static inline uid_t i_projid_read(struct inode *inode)
+{
+ return 0;
+}
+static inline void i_projid_write(struct inode *inode, __u32 projid)
+{
+ return;
+}
+#endif
+
#ifdef HAVE_LDISKFS_INFO_JINODE
# define osd_attach_jinode(inode) ldiskfs_inode_attach_jinode(inode)
#else /* HAVE_LDISKFS_INFO_JINODE */
lnb[0].lnb_flags &= ~OBD_BRW_OVER_ALLQUOTA;
rc = osd_declare_inode_qid(env, i_uid_read(inode), i_gid_read(inode),
- quota_space, oh, osd_dt_obj(dt), true,
- &flags, ignore_quota);
+ i_projid_read(inode), quota_space, oh,
+ osd_dt_obj(dt), true, &flags, ignore_quota);
/* we need only to store the overquota flags in the first lnb for
* now, once we support multiple objects BRW, this code needs be
* objects, so always set the lqi_space as 0. */
if (inode != NULL)
rc = osd_declare_inode_qid(env, i_uid_read(inode),
- i_gid_read(inode), 0, oh, obj, true,
- NULL, false);
+ i_gid_read(inode),
+ i_projid_read(inode), 0,
+ oh, obj, true, NULL, false);
RETURN(rc);
}
LASSERT(inode);
rc = osd_declare_inode_qid(env, i_uid_read(inode), i_gid_read(inode),
- 0, oh, osd_dt_obj(dt), true, NULL, false);
+ i_projid_read(inode), 0, oh, osd_dt_obj(dt),
+ true, NULL, false);
RETURN(rc);
}
* \retval -ve - failure
*/
int osd_declare_inode_qid(const struct lu_env *env, qid_t uid, qid_t gid,
- long long space, struct osd_thandle *oh,
+ __u32 projid, long long space, struct osd_thandle *oh,
struct osd_object *obj, bool is_blk, int *flags,
bool force)
{
struct osd_thread_info *info = osd_oti_get(env);
struct lquota_id_info *qi = &info->oti_qi;
- int rcu, rcg; /* user & group rc */
+ int rcu, rcg, rcp; /* user & group & project rc */
ENTRY;
/* let's start with user quota */
if (force && (rcg == -EDQUOT || rcg == -EINPROGRESS))
/* as before, ignore EDQUOT & EINPROGRESS for root */
rcg = 0;
+ if (rcg && (rcg != -EDQUOT || flags == NULL))
+ RETURN(rcg);
- RETURN(rcu ? rcu : rcg);
+ /* and now project quota */
+ qi->lqi_id.qid_gid = projid;
+ qi->lqi_type = PRJQUOTA; /* false now */
+ rcp = osd_declare_qid(env, oh, qi, obj, false, flags);
+
+ if (force && (rcp == -EDQUOT || rcp == -EINPROGRESS))
+ /* as before, ignore EDQUOT & EINPROGRESS for root */
+ rcp = 0;
+
+ if (rcu)
+ RETURN(rcu);
+ if (rcg)
+ RETURN(rcg);
+ if (rcp)
+ RETURN(rcp);
+
+ RETURN(0);
}
int osd_quota_migration(const struct lu_env *env, struct dt_object *dt)
union {
struct llog_rec_hdr osi_hdr;
struct llog_unlink64_rec osi_unlink;
- struct llog_setattr64_rec osi_setattr;
+ struct llog_setattr64_rec_v2 osi_setattr;
struct llog_gen_rec osi_gen;
};
struct llog_cookie osi_cookie;
RETURN(rc);
}
- if (!(attr->la_valid & (LA_UID | LA_GID)))
+ if (!(attr->la_valid & (LA_UID | LA_GID | LA_PROJID)))
RETURN(0);
/* track all UID/GID changes via llog */
int rc = 0;
ENTRY;
- /* we're interested in uid/gid changes only */
- if (!(attr->la_valid & (LA_UID | LA_GID)))
+ /* we're interested in uid/gid/projid changes only */
+ if (!(attr->la_valid & (LA_UID | LA_GID | LA_PROJID)))
RETURN(0);
if (!is_only_remote_trans(th)) {
la->la_gid = attr->la_gid;
la->la_valid |= LA_GID;
}
+ if (attr->la_valid & LA_PROJID) {
+ la->la_gid = attr->la_projid;
+ la->la_valid |= LA_PROJID;
+ }
spin_unlock(&o->opo_lock);
}
osi->osi_hdr.lrh_len = sizeof(struct llog_unlink64_rec);
break;
case MDS_SETATTR64_REC:
- osi->osi_hdr.lrh_len = sizeof(struct llog_setattr64_rec);
+ osi->osi_hdr.lrh_len = sizeof(struct llog_setattr64_rec_v2);
break;
default:
LBUG();
LASSERT(attr);
osi->osi_setattr.lsr_uid = attr->la_uid;
osi->osi_setattr.lsr_gid = attr->la_gid;
+ osi->osi_setattr.lsr_projid = attr->la_projid;
osi->osi_setattr.lsr_valid =
((attr->la_valid & LA_UID) ? OBD_MD_FLUID : 0) |
- ((attr->la_valid & LA_GID) ? OBD_MD_FLGID : 0);
+ ((attr->la_valid & LA_GID) ? OBD_MD_FLGID : 0) |
+ ((attr->la_valid & LA_PROJID) ? OBD_MD_FLPROJID : 0);
break;
default:
LBUG();
if (OBD_FAIL_CHECK(OBD_FAIL_OSP_CHECK_INVALID_REC))
RETURN(1);
- /* lsr_valid can only be 0 or have OBD_MD_{FLUID,FLGID} set,
+
+ /* lsr_valid can only be 0 or HAVE OBD_MD_{FLUID, FLGID, FLPROJID} set,
* so no bits other than these should be set. */
- if ((rec->lsr_valid & ~(OBD_MD_FLUID | OBD_MD_FLGID)) != 0) {
+ if ((rec->lsr_valid & ~(OBD_MD_FLUID | OBD_MD_FLGID |
+ OBD_MD_FLPROJID)) != 0) {
CERROR("%s: invalid setattr record, lsr_valid:%llu\n",
- d->opd_obd->obd_name, rec->lsr_valid);
+ d->opd_obd->obd_name, rec->lsr_valid);
/* return 1 on invalid record */
RETURN(1);
}
body->oa.o_uid = rec->lsr_uid;
body->oa.o_gid = rec->lsr_gid;
body->oa.o_valid = OBD_MD_FLGROUP | OBD_MD_FLID;
+ if (h->lrh_len > sizeof(struct llog_setattr64_rec))
+ body->oa.o_projid = ((struct llog_setattr64_rec_v2 *)
+ rec)->lsr_projid;
+
/* old setattr record (prior 2.6.0) doesn't have 'valid' stored,
* we assume that both UID and GID are valid in that case. */
if (rec->lsr_valid == 0)
__swab32s (&o->o_uid_h);
__swab32s (&o->o_gid_h);
__swab64s (&o->o_data_version);
+ __swab32s(&o->o_projid);
CLASSERT(offsetof(typeof(*o), o_padding_4) != 0);
CLASSERT(offsetof(typeof(*o), o_padding_5) != 0);
CLASSERT(offsetof(typeof(*o), o_padding_6) != 0);
CLASSERT(offsetof(typeof(*b), mbo_unused3) != 0);
__swab32s(&b->mbo_uid_h);
__swab32s(&b->mbo_gid_h);
- CLASSERT(offsetof(typeof(*b), mbo_padding_5) != 0);
+ __swab32s(&b->mbo_projid);
+ CLASSERT(offsetof(typeof(*b), mbo_padding_6) != 0);
}
void lustre_swab_mdt_ioepoch(struct mdt_ioepoch *b)
(long long)MDS_ATTR_FROM_OPEN);
LASSERTF(MDS_ATTR_BLOCKS == 0x0000000000008000ULL, "found 0x%.16llxULL\n",
(long long)MDS_ATTR_BLOCKS);
+
+ LASSERTF(MDS_ATTR_PROJID == 0x0000000000010000ULL, "found 0x%.16llxULL\n",
+ (long long)MDS_ATTR_PROJID);
LASSERTF(FLD_QUERY == 900, "found %lld\n",
(long long)FLD_QUERY);
LASSERTF(FLD_READ == 901, "found %lld\n",
(long long)(int)offsetof(struct obdo, o_data_version));
LASSERTF((int)sizeof(((struct obdo *)0)->o_data_version) == 8, "found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_data_version));
- LASSERTF((int)offsetof(struct obdo, o_padding_4) == 184, "found %lld\n",
+ LASSERTF((int)offsetof(struct obdo, o_projid) == 184, "found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_projid));
+ LASSERTF((int)sizeof(((struct obdo *)0)->o_projid) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct obdo *)0)->o_projid));
+ LASSERTF((int)offsetof(struct obdo, o_padding_4) == 188, "found %lld\n",
(long long)(int)offsetof(struct obdo, o_padding_4));
- LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_4) == 8, "found %lld\n",
+ LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_4) == 4, "found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_padding_4));
LASSERTF((int)offsetof(struct obdo, o_padding_5) == 192, "found %lld\n",
(long long)(int)offsetof(struct obdo, o_padding_5));
OBD_MD_DEFAULT_MEA);
LASSERTF(OBD_MD_FLOSTLAYOUT == (0x0080000000000000ULL), "found 0x%.16llxULL\n",
OBD_MD_FLOSTLAYOUT);
+
+ LASSERTF(OBD_MD_FLPROJID == (0x0100000000000000ULL), "found 0x%.16llxULL\n",
+ OBD_MD_FLPROJID);
CLASSERT(OBD_FL_INLINEDATA == 0x00000001);
CLASSERT(OBD_FL_OBDMDEXISTS == 0x00000002);
CLASSERT(OBD_FL_DELORPHAN == 0x00000004);
(long long)(int)offsetof(struct mdt_body, mbo_gid_h));
LASSERTF((int)sizeof(((struct mdt_body *)0)->mbo_gid_h) == 4, "found %lld\n",
(long long)(int)sizeof(((struct mdt_body *)0)->mbo_gid_h));
- LASSERTF((int)offsetof(struct mdt_body, mbo_padding_5) == 172, "found %lld\n",
- (long long)(int)offsetof(struct mdt_body, mbo_padding_5));
- LASSERTF((int)sizeof(((struct mdt_body *)0)->mbo_padding_5) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct mdt_body *)0)->mbo_padding_5));
+ LASSERTF((int)offsetof(struct mdt_body, mbo_projid) == 172, "found %lld\n",
+ (long long)(int)offsetof(struct mdt_body, mbo_projid));
+ LASSERTF((int)sizeof(((struct mdt_body *)0)->mbo_projid) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct mdt_body *)0)->mbo_projid));
LASSERTF((int)offsetof(struct mdt_body, mbo_padding_6) == 176, "found %lld\n",
(long long)(int)offsetof(struct mdt_body, mbo_padding_6));
LASSERTF((int)sizeof(((struct mdt_body *)0)->mbo_padding_6) == 8, "found %lld\n",
(long long)(int)offsetof(struct llog_setattr64_rec, lsr_valid));
LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_valid) == 8, "found %lld\n",
(long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_valid));
- LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_tail) == 56, "found %lld\n",
- (long long)(int)offsetof(struct llog_setattr64_rec, lsr_tail));
- LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_tail) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_tail));
+ LASSERTF((int)offsetof(struct llog_setattr64_rec_v2, lsr_projid) == 56, "found %lld\n",
+ (long long)(int)offsetof(struct llog_setattr64_rec_v2, lsr_projid));
+ LASSERTF((int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_projid) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_projid));
+ LASSERTF((int)offsetof(struct llog_setattr64_rec_v2, lsr_tail) == 80, "found %lld\n",
+ (long long)(int)offsetof(struct llog_setattr64_rec_v2, lsr_tail));
+ LASSERTF((int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_tail) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_tail));
/* Checks for struct llog_size_change_rec */
LASSERTF((int)sizeof(struct llog_size_change_rec) == 64, "found %lld\n",
ostid_set_id(&data.ioc_obdo1.o_oi, base_id);
data.ioc_obdo1.o_uid = 0;
data.ioc_obdo1.o_gid = 0;
+ data.ioc_obdo1.o_projid = 0;
data.ioc_obdo1.o_valid = OBD_MD_FLTYPE | OBD_MD_FLMODE |
OBD_MD_FLID | OBD_MD_FLUID |
- OBD_MD_FLGID | OBD_MD_FLGROUP;
+ OBD_MD_FLGID | OBD_MD_FLGROUP |
+ OBD_MD_FLPROJID;
memset(buf, 0, sizeof(rawbuf));
rc = obd_ioctl_pack(&data, &buf, sizeof(rawbuf));
CHECK_MEMBER(obdo, o_uid_h);
CHECK_MEMBER(obdo, o_gid_h);
CHECK_MEMBER(obdo, o_data_version);
+ CHECK_MEMBER(obdo, o_projid);
CHECK_MEMBER(obdo, o_padding_4);
CHECK_MEMBER(obdo, o_padding_5);
CHECK_MEMBER(obdo, o_padding_6);
CHECK_DEFINE_64X(OBD_MD_CLOSE_INTENT_EXECED);
CHECK_DEFINE_64X(OBD_MD_DEFAULT_MEA);
CHECK_DEFINE_64X(OBD_MD_FLOSTLAYOUT);
+ CHECK_DEFINE_64X(OBD_MD_FLPROJID);
CHECK_CVALUE_X(OBD_FL_INLINEDATA);
CHECK_CVALUE_X(OBD_FL_OBDMDEXISTS);
CHECK_MEMBER(mdt_body, mbo_unused3);
CHECK_MEMBER(mdt_body, mbo_uid_h);
CHECK_MEMBER(mdt_body, mbo_gid_h);
- CHECK_MEMBER(mdt_body, mbo_padding_5);
+ CHECK_MEMBER(mdt_body, mbo_projid);
CHECK_MEMBER(mdt_body, mbo_padding_6);
CHECK_MEMBER(mdt_body, mbo_padding_7);
CHECK_MEMBER(mdt_body, mbo_padding_8);
CHECK_MEMBER(llog_setattr64_rec, lsr_gid_h);
CHECK_MEMBER(llog_setattr64_rec, lsr_valid);
CHECK_MEMBER(llog_setattr64_rec, lsr_tail);
+ CHECK_MEMBER(llog_setattr64_rec_v2, lsr_projid);
}
static void
CHECK_VALUE_64X(MDS_ATTR_CTIME_SET);
CHECK_VALUE_64X(MDS_ATTR_FROM_OPEN);
CHECK_VALUE_64X(MDS_ATTR_BLOCKS);
+ CHECK_VALUE_64X(MDS_ATTR_PROJID);
CHECK_VALUE(FLD_QUERY);
CHECK_VALUE(FLD_READ);
(long long)MDS_ATTR_FROM_OPEN);
LASSERTF(MDS_ATTR_BLOCKS == 0x0000000000008000ULL, "found 0x%.16llxULL\n",
(long long)MDS_ATTR_BLOCKS);
+ LASSERTF(MDS_ATTR_PROJID == 0x0000000000010000ULL, "found 0x%.16llxULL\n",
+ (long long)MDS_ATTR_PROJID);
LASSERTF(FLD_QUERY == 900, "found %lld\n",
(long long)FLD_QUERY);
LASSERTF(FLD_READ == 901, "found %lld\n",
(long long)(int)offsetof(struct obdo, o_data_version));
LASSERTF((int)sizeof(((struct obdo *)0)->o_data_version) == 8, "found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_data_version));
- LASSERTF((int)offsetof(struct obdo, o_padding_4) == 184, "found %lld\n",
+ LASSERTF((int)offsetof(struct obdo, o_projid) == 184, "found %lld\n",
+ (long long)(int)offsetof(struct obdo, o_projid));
+ LASSERTF((int)sizeof(((struct obdo *)0)->o_projid) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct obdo *)0)->o_projid));
+ LASSERTF((int)offsetof(struct obdo, o_padding_4) == 188, "found %lld\n",
(long long)(int)offsetof(struct obdo, o_padding_4));
- LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_4) == 8, "found %lld\n",
+ LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_4) == 4, "found %lld\n",
(long long)(int)sizeof(((struct obdo *)0)->o_padding_4));
LASSERTF((int)offsetof(struct obdo, o_padding_5) == 192, "found %lld\n",
(long long)(int)offsetof(struct obdo, o_padding_5));
OBD_MD_DEFAULT_MEA);
LASSERTF(OBD_MD_FLOSTLAYOUT == (0x0080000000000000ULL), "found 0x%.16llxULL\n",
OBD_MD_FLOSTLAYOUT);
+ LASSERTF(OBD_MD_FLPROJID == (0x0100000000000000ULL), "found 0x%.16llxULL\n",
+ OBD_MD_FLPROJID);
CLASSERT(OBD_FL_INLINEDATA == 0x00000001);
CLASSERT(OBD_FL_OBDMDEXISTS == 0x00000002);
CLASSERT(OBD_FL_DELORPHAN == 0x00000004);
(long long)(int)offsetof(struct mdt_body, mbo_gid_h));
LASSERTF((int)sizeof(((struct mdt_body *)0)->mbo_gid_h) == 4, "found %lld\n",
(long long)(int)sizeof(((struct mdt_body *)0)->mbo_gid_h));
- LASSERTF((int)offsetof(struct mdt_body, mbo_padding_5) == 172, "found %lld\n",
- (long long)(int)offsetof(struct mdt_body, mbo_padding_5));
- LASSERTF((int)sizeof(((struct mdt_body *)0)->mbo_padding_5) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct mdt_body *)0)->mbo_padding_5));
+ LASSERTF((int)offsetof(struct mdt_body, mbo_projid) == 172, "found %lld\n",
+ (long long)(int)offsetof(struct mdt_body, mbo_projid));
+ LASSERTF((int)sizeof(((struct mdt_body *)0)->mbo_projid) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct mdt_body *)0)->mbo_projid));
LASSERTF((int)offsetof(struct mdt_body, mbo_padding_6) == 176, "found %lld\n",
(long long)(int)offsetof(struct mdt_body, mbo_padding_6));
LASSERTF((int)sizeof(((struct mdt_body *)0)->mbo_padding_6) == 8, "found %lld\n",
(long long)(int)offsetof(struct llog_setattr64_rec, lsr_valid));
LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_valid) == 8, "found %lld\n",
(long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_valid));
- LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_tail) == 56, "found %lld\n",
- (long long)(int)offsetof(struct llog_setattr64_rec, lsr_tail));
- LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_tail) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_tail));
+ LASSERTF((int)offsetof(struct llog_setattr64_rec_v2, lsr_projid) == 56, "found %lld\n",
+ (long long)(int)offsetof(struct llog_setattr64_rec_v2, lsr_projid));
+ LASSERTF((int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_projid) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_projid));
+ LASSERTF((int)offsetof(struct llog_setattr64_rec_v2, lsr_tail) == 80, "found %lld\n",
+ (long long)(int)offsetof(struct llog_setattr64_rec_v2, lsr_tail));
+ LASSERTF((int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_tail) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_tail));
/* Checks for struct llog_size_change_rec */
LASSERTF((int)sizeof(struct llog_size_change_rec) == 64, "found %lld\n",