obd_time sa_ctime;
__u32 sa_attr_flags;
__u32 sa_mode;
- __u32 sa_padding_2;
+ __u32 sa_bias; /* some operation flags */
__u32 sa_padding_3;
__u32 sa_padding_4;
__u32 sa_padding_5;
MDS_CLOSE_CLEANUP = 1 << 6,
MDS_KEEP_ORPHAN = 1 << 7,
MDS_RECOV_OPEN = 1 << 8,
+ MDS_DATA_MODIFIED = 1 << 9,
};
/* instance of mdt_reint_rec */
if (fh)
op_data->op_handle = *fh;
op_data->op_capa1 = ll_mdscapa_get(inode);
+
+ if (LLIF_DATA_MODIFIED & ll_i2info(inode)->lli_flags)
+ op_data->op_bias |= MDS_DATA_MODIFIED;
}
/**
CERROR("inode %lu mdc close failed: rc = %d\n",
inode->i_ino, rc);
}
+
+ /* DATA_MODIFIED flag was successfully sent on close, cancel data
+ * modification flag. */
+ if (rc == 0 && (op_data->op_bias & MDS_DATA_MODIFIED)) {
+ struct ll_inode_info *lli = ll_i2info(inode);
+
+ spin_lock(&lli->lli_lock);
+ lli->lli_flags &= ~LLIF_DATA_MODIFIED;
+ spin_unlock(&lli->lli_lock);
+ }
+
ll_finish_md_op_data(op_data);
if (rc == 0) {
ENTRY;
spin_lock(&lli->lli_lock);
lli->lli_flags |= LLIF_SOM_DIRTY;
+ lli->lli_flags |= LLIF_DATA_MODIFIED;
if (page != NULL && cfs_list_empty(&page->cpg_pending_linkage))
cfs_list_add(&page->cpg_pending_linkage,
&club->cob_pending_list);
LLIF_CONTENDED = (1 << 4),
/* Truncate uses server lock for this file */
LLIF_SRVLOCK = (1 << 5),
-
+ /* File data is modified. */
+ LLIF_DATA_MODIFIED = (1 << 6),
};
struct ll_inode_info {
LTIME_S(attr->ia_mtime), LTIME_S(attr->ia_ctime),
cfs_time_current_sec());
+ /* If we are changing file size, file content is modified, flag it. */
+ if (attr->ia_valid & ATTR_SIZE) {
+ spin_lock(&lli->lli_lock);
+ lli->lli_flags |= LLIF_DATA_MODIFIED;
+ spin_unlock(&lli->lli_lock);
+ }
+
/* We always do an MDS RPC, even if we're only changing the size;
* only the MDS knows whether truncate() should fail with -ETXTBUSY */
if (rc)
GOTO(out, rc);
+ /* RPC to MDT is sent, cancel data modification flag */
+ if (rc == 0 && (op_data->op_bias & MDS_DATA_MODIFIED)) {
+ spin_lock(&lli->lli_lock);
+ lli->lli_flags &= ~LLIF_DATA_MODIFIED;
+ spin_unlock(&lli->lli_lock);
+ }
+
ll_ioepoch_open(lli, op_data->op_ioepoch);
if (!S_ISREG(inode->i_mode))
GOTO(out, rc = 0);
/** We ignore parent's capability temporary. */
}
+ /* When called by ll_setattr_raw, file is i1. */
+ if (LLIF_DATA_MODIFIED & ll_i2info(i1)->lli_flags)
+ op_data->op_bias |= MDS_DATA_MODIFIED;
+
return op_data;
}
vma->vm_flags, io->u.ci_fault.ft_index, vmpage);
if (result == 0 || result == -ENODATA) {
+ struct inode *inode = vma->vm_file->f_dentry->d_inode;
+ struct ll_inode_info *lli = ll_i2info(inode);
+
lock_page(vmpage);
if (vmpage->mapping == NULL) {
unlock_page(vmpage);
*retry = true;
result = -EAGAIN;
}
+
+ if (result == 0) {
+ spin_lock(&lli->lli_lock);
+ lli->lli_flags |= LLIF_DATA_MODIFIED;
+ spin_unlock(&lli->lli_lock);
+ }
}
EXIT;
rec->sa_suppgid = op_data->op_attr.ia_gid;
else
rec->sa_suppgid = op_data->op_suppgids[0];
+
+ rec->sa_bias = op_data->op_bias;
}
static void mdc_ioepoch_pack(struct mdt_ioepoch *epoch,
return rc;
/* Only record user xattr changes */
- if ((strncmp("user.", name, 5) == 0))
+ if ((strncmp("user.", name, 5) == 0)) {
+ rc = mdd_declare_changelog_store(env, mdd, NULL, handle);
+ if (rc)
+ return rc;
+ }
+
+ /* If HSM data is modified, this could add a changelog */
+ if (strncmp(XATTR_NAME_HSM, name, sizeof(XATTR_NAME_HSM) - 1) == 0)
rc = mdd_declare_changelog_store(env, mdd, NULL, handle);
rc = mdd_declare_changelog_store(env, mdd, NULL, handle);
return rc;
}
+/*
+ * Compare current and future data of HSM EA and add a changelog if needed.
+ *
+ * Caller should have write-locked \param obj.
+ *
+ * \param buf - Future HSM EA content.
+ * \retval 0 if no changelog is needed or changelog was added properly.
+ * \retval -ve errno if there was a problem
+ */
+static int mdd_hsm_update_locked(const struct lu_env *env,
+ struct md_object *obj,
+ const struct lu_buf *buf,
+ struct thandle *handle)
+{
+ struct mdd_thread_info *info = mdd_env_info(env);
+ struct mdd_device *mdd = mdo2mdd(obj);
+ struct mdd_object *mdd_obj = md2mdd_obj(obj);
+ struct lu_buf *current_buf = &info->mti_buf;
+ struct md_hsm *current_mh;
+ struct md_hsm *new_mh;
+ int rc;
+ ENTRY;
+
+ OBD_ALLOC_PTR(current_mh);
+ if (current_mh == NULL)
+ RETURN(-ENOMEM);
+
+ /* Read HSM attrs from disk */
+ current_buf->lb_buf = info->mti_xattr_buf;
+ current_buf->lb_len = sizeof(info->mti_xattr_buf);
+ CLASSERT(sizeof(struct hsm_attrs) <= sizeof(info->mti_xattr_buf));
+ rc = mdo_xattr_get(env, mdd_obj, current_buf, XATTR_NAME_HSM,
+ mdd_object_capa(env, mdd_obj));
+ rc = lustre_buf2hsm(info->mti_xattr_buf, rc, current_mh);
+ if (rc < 0 && rc != -ENODATA)
+ GOTO(free, rc);
+ else if (rc == -ENODATA)
+ current_mh->mh_flags = 0;
+
+ /* Map future HSM xattr */
+ OBD_ALLOC_PTR(new_mh);
+ if (new_mh == NULL)
+ GOTO(free, rc = -ENOMEM);
+ lustre_buf2hsm(buf->lb_buf, buf->lb_len, new_mh);
+
+ /* If HSM flags are different, add a changelog */
+ rc = 0;
+ if (current_mh->mh_flags != new_mh->mh_flags) {
+ int flags = 0;
+ hsm_set_cl_event(&flags, HE_STATE);
+ if (new_mh->mh_flags & HS_DIRTY)
+ hsm_set_cl_flags(&flags, CLF_HSM_DIRTY);
+
+ rc = mdd_changelog_data_store(env, mdd, CL_HSM, flags, mdd_obj,
+ handle);
+ }
+
+ OBD_FREE_PTR(new_mh);
+free:
+ OBD_FREE_PTR(current_mh);
+ return(rc);
+}
+
+
/**
* The caller should guarantee to update the object ctime
* after xattr_set if needed.
handle->th_sync |= !!mdd->mdd_sync_permission;
mdd_write_lock(env, mdd_obj, MOR_TGT_CHILD);
+
+ if (strncmp(XATTR_NAME_HSM, name, sizeof(XATTR_NAME_HSM) - 1) == 0) {
+ rc = mdd_hsm_update_locked(env, obj, buf, handle);
+ if (rc) {
+ mdd_write_unlock(env, mdd_obj);
+ GOTO(stop, rc);
+ }
+ }
+
rc = mdo_xattr_set(env, mdd_obj, buf, name, fl, handle,
mdd_object_capa(env, mdd_obj));
mdd_write_unlock(env, mdd_obj);
int mdt_close(struct mdt_thread_info *info);
int mdt_attr_set(struct mdt_thread_info *info, struct mdt_object *mo,
struct md_attr *ma, int flags);
+int mdt_add_dirty_flag(struct mdt_thread_info *info, struct mdt_object *mo,
+ struct md_attr *ma);
int mdt_done_writing(struct mdt_thread_info *info);
int mdt_fix_reply(struct mdt_thread_info *info);
int mdt_handle_last_unlink(struct mdt_thread_info *, struct mdt_object *,
extern struct lprocfs_vars lprocfs_mds_module_vars[];
extern struct lprocfs_vars lprocfs_mds_obd_vars[];
+int mdt_hsm_attr_set(struct mdt_thread_info *info, struct mdt_object *obj,
+ struct md_hsm *mh);
+
/* mdt_idmap.c */
int mdt_init_sec_level(struct mdt_thread_info *);
int mdt_init_idmap(struct mdt_thread_info *);
la->la_mtime = rec->sa_mtime;
ma->ma_valid = MA_INODE;
+ if (rec->sa_bias & MDS_DATA_MODIFIED)
+ ma->ma_attr_flags |= MDS_DATA_MODIFIED;
+ else
+ ma->ma_attr_flags &= ~MDS_DATA_MODIFIED;
+
if (req_capsule_get_size(pill, &RMF_CAPA1, RCL_CLIENT))
mdt_set_capainfo(info, 0, rr->rr_fid1,
req_capsule_client_get(pill, &RMF_CAPA1));
rc = mo_attr_set(info->mti_env, next, ma);
}
+ /* If file data is modified, add the dirty flag.
+ *
+ * If MDS_CLOSE_CLEANUP is set, this file is being closed due to an
+ * eviction, file could have been modified and now dirty
+ * regarding to HSM archive, check this!
+ * The logic here is to mark a file dirty if there's a chance it was
+ * dirtied before the client was evicted, so that we don't have to wait
+ * for a release attempt before finding out the file was actually dirty
+ * and fail the release. Aggressively marking it dirty here will cause
+ * the policy engine to attempt to re-archive it; when rearchiving, we
+ * can compare the current version to the LMA data_version and make the
+ * archive request into a noop if it's not actually dirty.
+ */
+ if ((ma->ma_attr_flags & MDS_DATA_MODIFIED) ||
+ ((ma->ma_attr_flags & MDS_CLOSE_CLEANUP) &&
+ (mode & (FMODE_WRITE|MDS_FMODE_TRUNC))))
+ rc = mdt_add_dirty_flag(info, o, ma);
+
ma->ma_need |= MA_INODE;
ma->ma_valid &= ~MA_INODE;
return rc;
}
+/**
+ * Check HSM flags and add HS_DIRTY flag if relevant.
+ *
+ * A file could be set dirty only if it has a copy in the backend (HS_EXISTS)
+ * and is not RELEASED.
+ */
+int mdt_add_dirty_flag(struct mdt_thread_info *info, struct mdt_object *mo,
+ struct md_attr *ma)
+{
+ int rc;
+ ENTRY;
+
+ /* If the file was modified, add the dirty flag */
+ ma->ma_need = MA_HSM;
+ rc = mdt_attr_get_complex(info, mo, ma);
+ if (rc) {
+ CERROR("file attribute read error for "DFID": %d.\n",
+ PFID(lu_object_fid(&mo->mot_obj.mo_lu)), rc);
+ RETURN(rc);
+ }
+
+ /* If an up2date copy exists in the backend, add dirty flag */
+ if ((ma->ma_valid & MA_HSM) && (ma->ma_hsm.mh_flags & HS_EXISTS)
+ && !(ma->ma_hsm.mh_flags & (HS_DIRTY|HS_RELEASED))) {
+
+ ma->ma_hsm.mh_flags |= HS_DIRTY;
+ rc = mdt_hsm_attr_set(info, mo, &ma->ma_hsm);
+ if (rc) {
+ CERROR("file attribute change error for "DFID": %d\n",
+ PFID(lu_object_fid(&mo->mot_obj.mo_lu)), rc);
+ RETURN(rc);
+ }
+ }
+
+ RETURN(rc);
+}
+
static int mdt_reint_setattr(struct mdt_thread_info *info,
struct mdt_lock_handle *lhc)
{
} else
LBUG();
+ /* If file data is modified, add the dirty flag */
+ if (ma->ma_attr_flags & MDS_DATA_MODIFIED)
+ rc = mdt_add_dirty_flag(info, mo, ma);
+
ma->ma_need = MA_INODE;
ma->ma_valid = 0;
rc = mdt_attr_get_complex(info, mo, ma);
(long long)LU_SEQ_RANGE_OST);
/* Checks for struct lustre_mdt_attrs */
- LASSERTF((int)sizeof(struct lustre_mdt_attrs) == 32, "found %lld\n",
- (long long)(int)sizeof(struct lustre_mdt_attrs));
+ LASSERTF((int)sizeof(struct lustre_mdt_attrs) == 32, "found %lld\n",
+ (long long)(int)sizeof(struct lustre_mdt_attrs));
LASSERTF((int)offsetof(struct lustre_mdt_attrs, lma_compat) == 0, "found %lld\n",
(long long)(int)offsetof(struct lustre_mdt_attrs, lma_compat));
LASSERTF((int)sizeof(((struct lustre_mdt_attrs *)0)->lma_compat) == 4, "found %lld\n",
(long long)(int)sizeof(((struct lustre_mdt_attrs *)0)->lma_flags));
LASSERTF(LMA_INCOMPAT_SUPP == 0x0, "found %lld\n",
(long long)LMA_INCOMPAT_SUPP);
- LASSERTF(LMAI_RELEASED == 0x00000001UL, "found 0x%.8xUL\n",
- (unsigned)LMAI_RELEASED);
+ LASSERTF(LMAI_RELEASED == 0x00000001UL, "found 0x%.8xUL\n",
+ (unsigned)LMAI_RELEASED);
LASSERTF(LMAC_HSM == 0x00000001UL, "found 0x%.8xUL\n",
(unsigned)LMAC_HSM);
LASSERTF(LMAC_SOM == 0x00000002UL, "found 0x%.8xUL\n",
(unsigned)LMAC_SOM);
- /* Checks for struct som_attrs */
- LASSERTF((int)sizeof(struct som_attrs) == 40, "found %lld\n",
- (long long)(int)sizeof(struct som_attrs));
- LASSERTF((int)offsetof(struct som_attrs, som_compat) == 0, "found %lld\n",
- (long long)(int)offsetof(struct som_attrs, som_compat));
- LASSERTF((int)sizeof(((struct som_attrs *)0)->som_compat) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct som_attrs *)0)->som_compat));
- LASSERTF((int)offsetof(struct som_attrs, som_incompat) == 4, "found %lld\n",
- (long long)(int)offsetof(struct som_attrs, som_incompat));
- LASSERTF((int)sizeof(((struct som_attrs *)0)->som_incompat) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct som_attrs *)0)->som_incompat));
- LASSERTF((int)offsetof(struct som_attrs, som_ioepoch) == 8, "found %lld\n",
- (long long)(int)offsetof(struct som_attrs, som_ioepoch));
- LASSERTF((int)sizeof(((struct som_attrs *)0)->som_ioepoch) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct som_attrs *)0)->som_ioepoch));
- LASSERTF((int)offsetof(struct som_attrs, som_size) == 16, "found %lld\n",
- (long long)(int)offsetof(struct som_attrs, som_size));
- LASSERTF((int)sizeof(((struct som_attrs *)0)->som_size) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct som_attrs *)0)->som_size));
- LASSERTF((int)offsetof(struct som_attrs, som_blocks) == 24, "found %lld\n",
- (long long)(int)offsetof(struct som_attrs, som_blocks));
- LASSERTF((int)sizeof(((struct som_attrs *)0)->som_blocks) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct som_attrs *)0)->som_blocks));
- LASSERTF((int)offsetof(struct som_attrs, som_mountid) == 32, "found %lld\n",
- (long long)(int)offsetof(struct som_attrs, som_mountid));
- LASSERTF((int)sizeof(((struct som_attrs *)0)->som_mountid) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct som_attrs *)0)->som_mountid));
+ /* Checks for struct som_attrs */
+ LASSERTF((int)sizeof(struct som_attrs) == 40, "found %lld\n",
+ (long long)(int)sizeof(struct som_attrs));
+ LASSERTF((int)offsetof(struct som_attrs, som_compat) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct som_attrs, som_compat));
+ LASSERTF((int)sizeof(((struct som_attrs *)0)->som_compat) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct som_attrs *)0)->som_compat));
+ LASSERTF((int)offsetof(struct som_attrs, som_incompat) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct som_attrs, som_incompat));
+ LASSERTF((int)sizeof(((struct som_attrs *)0)->som_incompat) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct som_attrs *)0)->som_incompat));
+ LASSERTF((int)offsetof(struct som_attrs, som_ioepoch) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct som_attrs, som_ioepoch));
+ LASSERTF((int)sizeof(((struct som_attrs *)0)->som_ioepoch) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct som_attrs *)0)->som_ioepoch));
+ LASSERTF((int)offsetof(struct som_attrs, som_size) == 16, "found %lld\n",
+ (long long)(int)offsetof(struct som_attrs, som_size));
+ LASSERTF((int)sizeof(((struct som_attrs *)0)->som_size) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct som_attrs *)0)->som_size));
+ LASSERTF((int)offsetof(struct som_attrs, som_blocks) == 24, "found %lld\n",
+ (long long)(int)offsetof(struct som_attrs, som_blocks));
+ LASSERTF((int)sizeof(((struct som_attrs *)0)->som_blocks) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct som_attrs *)0)->som_blocks));
+ LASSERTF((int)offsetof(struct som_attrs, som_mountid) == 32, "found %lld\n",
+ (long long)(int)offsetof(struct som_attrs, som_mountid));
+ LASSERTF((int)sizeof(((struct som_attrs *)0)->som_mountid) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct som_attrs *)0)->som_mountid));
- /* Checks for struct hsm_attrs */
- LASSERTF((int)sizeof(struct hsm_attrs) == 24, "found %lld\n",
- (long long)(int)sizeof(struct hsm_attrs));
- LASSERTF((int)offsetof(struct hsm_attrs, hsm_compat) == 0, "found %lld\n",
- (long long)(int)offsetof(struct hsm_attrs, hsm_compat));
- LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_compat) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_compat));
- LASSERTF((int)offsetof(struct hsm_attrs, hsm_flags) == 4, "found %lld\n",
- (long long)(int)offsetof(struct hsm_attrs, hsm_flags));
- LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_flags) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_flags));
- LASSERTF((int)offsetof(struct hsm_attrs, hsm_arch_id) == 8, "found %lld\n",
- (long long)(int)offsetof(struct hsm_attrs, hsm_arch_id));
- LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_arch_id) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_arch_id));
- LASSERTF((int)offsetof(struct hsm_attrs, hsm_arch_ver) == 16, "found %lld\n",
- (long long)(int)offsetof(struct hsm_attrs, hsm_arch_ver));
- LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver));
+ /* Checks for struct hsm_attrs */
+ LASSERTF((int)sizeof(struct hsm_attrs) == 24, "found %lld\n",
+ (long long)(int)sizeof(struct hsm_attrs));
+ LASSERTF((int)offsetof(struct hsm_attrs, hsm_compat) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct hsm_attrs, hsm_compat));
+ LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_compat) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_compat));
+ LASSERTF((int)offsetof(struct hsm_attrs, hsm_flags) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct hsm_attrs, hsm_flags));
+ LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_flags) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_flags));
+ LASSERTF((int)offsetof(struct hsm_attrs, hsm_arch_id) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct hsm_attrs, hsm_arch_id));
+ LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_arch_id) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_arch_id));
+ LASSERTF((int)offsetof(struct hsm_attrs, hsm_arch_ver) == 16, "found %lld\n",
+ (long long)(int)offsetof(struct hsm_attrs, hsm_arch_ver));
+ LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver));
/* Checks for struct ost_id */
LASSERTF((int)sizeof(struct ost_id) == 16, "found %lld\n",
(long long)(int)offsetof(struct mdt_rec_setattr, sa_mode));
LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_mode) == 4, "found %lld\n",
(long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_mode));
- LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_padding_2) == 120, "found %lld\n",
- (long long)(int)offsetof(struct mdt_rec_setattr, sa_padding_2));
- LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_2) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_2));
+ LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_bias) == 120, "found %lld\n",
+ (long long)(int)offsetof(struct mdt_rec_setattr, sa_bias));
+ LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_bias) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_bias));
LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_padding_3) == 124, "found %lld\n",
(long long)(int)offsetof(struct mdt_rec_setattr, sa_padding_3));
LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_3) == 4, "found %lld\n",
CHECK_MEMBER(mdt_rec_setattr, sa_ctime);
CHECK_MEMBER(mdt_rec_setattr, sa_attr_flags);
CHECK_MEMBER(mdt_rec_setattr, sa_mode);
- CHECK_MEMBER(mdt_rec_setattr, sa_padding_2);
+ CHECK_MEMBER(mdt_rec_setattr, sa_bias);
CHECK_MEMBER(mdt_rec_setattr, sa_padding_3);
CHECK_MEMBER(mdt_rec_setattr, sa_padding_4);
CHECK_MEMBER(mdt_rec_setattr, sa_padding_5);
(long long)LU_SEQ_RANGE_OST);
/* Checks for struct lustre_mdt_attrs */
- LASSERTF((int)sizeof(struct lustre_mdt_attrs) == 32, "found %lld\n",
- (long long)(int)sizeof(struct lustre_mdt_attrs));
+ LASSERTF((int)sizeof(struct lustre_mdt_attrs) == 32, "found %lld\n",
+ (long long)(int)sizeof(struct lustre_mdt_attrs));
LASSERTF((int)offsetof(struct lustre_mdt_attrs, lma_compat) == 0, "found %lld\n",
(long long)(int)offsetof(struct lustre_mdt_attrs, lma_compat));
LASSERTF((int)sizeof(((struct lustre_mdt_attrs *)0)->lma_compat) == 4, "found %lld\n",
(long long)(int)sizeof(((struct lustre_mdt_attrs *)0)->lma_flags));
LASSERTF(LMA_INCOMPAT_SUPP == 0x0, "found %lld\n",
(long long)LMA_INCOMPAT_SUPP);
- LASSERTF(LMAI_RELEASED == 0x00000001UL, "found 0x%.8xUL\n",
- (unsigned)LMAI_RELEASED);
+ LASSERTF(LMAI_RELEASED == 0x00000001UL, "found 0x%.8xUL\n",
+ (unsigned)LMAI_RELEASED);
LASSERTF(LMAC_HSM == 0x00000001UL, "found 0x%.8xUL\n",
(unsigned)LMAC_HSM);
LASSERTF(LMAC_SOM == 0x00000002UL, "found 0x%.8xUL\n",
(unsigned)LMAC_SOM);
- /* Checks for struct som_attrs */
- LASSERTF((int)sizeof(struct som_attrs) == 40, "found %lld\n",
- (long long)(int)sizeof(struct som_attrs));
- LASSERTF((int)offsetof(struct som_attrs, som_compat) == 0, "found %lld\n",
- (long long)(int)offsetof(struct som_attrs, som_compat));
- LASSERTF((int)sizeof(((struct som_attrs *)0)->som_compat) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct som_attrs *)0)->som_compat));
- LASSERTF((int)offsetof(struct som_attrs, som_incompat) == 4, "found %lld\n",
- (long long)(int)offsetof(struct som_attrs, som_incompat));
- LASSERTF((int)sizeof(((struct som_attrs *)0)->som_incompat) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct som_attrs *)0)->som_incompat));
- LASSERTF((int)offsetof(struct som_attrs, som_ioepoch) == 8, "found %lld\n",
- (long long)(int)offsetof(struct som_attrs, som_ioepoch));
- LASSERTF((int)sizeof(((struct som_attrs *)0)->som_ioepoch) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct som_attrs *)0)->som_ioepoch));
- LASSERTF((int)offsetof(struct som_attrs, som_size) == 16, "found %lld\n",
- (long long)(int)offsetof(struct som_attrs, som_size));
- LASSERTF((int)sizeof(((struct som_attrs *)0)->som_size) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct som_attrs *)0)->som_size));
- LASSERTF((int)offsetof(struct som_attrs, som_blocks) == 24, "found %lld\n",
- (long long)(int)offsetof(struct som_attrs, som_blocks));
- LASSERTF((int)sizeof(((struct som_attrs *)0)->som_blocks) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct som_attrs *)0)->som_blocks));
- LASSERTF((int)offsetof(struct som_attrs, som_mountid) == 32, "found %lld\n",
- (long long)(int)offsetof(struct som_attrs, som_mountid));
- LASSERTF((int)sizeof(((struct som_attrs *)0)->som_mountid) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct som_attrs *)0)->som_mountid));
+ /* Checks for struct som_attrs */
+ LASSERTF((int)sizeof(struct som_attrs) == 40, "found %lld\n",
+ (long long)(int)sizeof(struct som_attrs));
+ LASSERTF((int)offsetof(struct som_attrs, som_compat) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct som_attrs, som_compat));
+ LASSERTF((int)sizeof(((struct som_attrs *)0)->som_compat) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct som_attrs *)0)->som_compat));
+ LASSERTF((int)offsetof(struct som_attrs, som_incompat) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct som_attrs, som_incompat));
+ LASSERTF((int)sizeof(((struct som_attrs *)0)->som_incompat) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct som_attrs *)0)->som_incompat));
+ LASSERTF((int)offsetof(struct som_attrs, som_ioepoch) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct som_attrs, som_ioepoch));
+ LASSERTF((int)sizeof(((struct som_attrs *)0)->som_ioepoch) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct som_attrs *)0)->som_ioepoch));
+ LASSERTF((int)offsetof(struct som_attrs, som_size) == 16, "found %lld\n",
+ (long long)(int)offsetof(struct som_attrs, som_size));
+ LASSERTF((int)sizeof(((struct som_attrs *)0)->som_size) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct som_attrs *)0)->som_size));
+ LASSERTF((int)offsetof(struct som_attrs, som_blocks) == 24, "found %lld\n",
+ (long long)(int)offsetof(struct som_attrs, som_blocks));
+ LASSERTF((int)sizeof(((struct som_attrs *)0)->som_blocks) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct som_attrs *)0)->som_blocks));
+ LASSERTF((int)offsetof(struct som_attrs, som_mountid) == 32, "found %lld\n",
+ (long long)(int)offsetof(struct som_attrs, som_mountid));
+ LASSERTF((int)sizeof(((struct som_attrs *)0)->som_mountid) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct som_attrs *)0)->som_mountid));
- /* Checks for struct hsm_attrs */
- LASSERTF((int)sizeof(struct hsm_attrs) == 24, "found %lld\n",
- (long long)(int)sizeof(struct hsm_attrs));
- LASSERTF((int)offsetof(struct hsm_attrs, hsm_compat) == 0, "found %lld\n",
- (long long)(int)offsetof(struct hsm_attrs, hsm_compat));
- LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_compat) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_compat));
- LASSERTF((int)offsetof(struct hsm_attrs, hsm_flags) == 4, "found %lld\n",
- (long long)(int)offsetof(struct hsm_attrs, hsm_flags));
- LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_flags) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_flags));
- LASSERTF((int)offsetof(struct hsm_attrs, hsm_arch_id) == 8, "found %lld\n",
- (long long)(int)offsetof(struct hsm_attrs, hsm_arch_id));
- LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_arch_id) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_arch_id));
- LASSERTF((int)offsetof(struct hsm_attrs, hsm_arch_ver) == 16, "found %lld\n",
- (long long)(int)offsetof(struct hsm_attrs, hsm_arch_ver));
- LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver));
+ /* Checks for struct hsm_attrs */
+ LASSERTF((int)sizeof(struct hsm_attrs) == 24, "found %lld\n",
+ (long long)(int)sizeof(struct hsm_attrs));
+ LASSERTF((int)offsetof(struct hsm_attrs, hsm_compat) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct hsm_attrs, hsm_compat));
+ LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_compat) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_compat));
+ LASSERTF((int)offsetof(struct hsm_attrs, hsm_flags) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct hsm_attrs, hsm_flags));
+ LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_flags) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_flags));
+ LASSERTF((int)offsetof(struct hsm_attrs, hsm_arch_id) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct hsm_attrs, hsm_arch_id));
+ LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_arch_id) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_arch_id));
+ LASSERTF((int)offsetof(struct hsm_attrs, hsm_arch_ver) == 16, "found %lld\n",
+ (long long)(int)offsetof(struct hsm_attrs, hsm_arch_ver));
+ LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver));
/* Checks for struct ost_id */
LASSERTF((int)sizeof(struct ost_id) == 16, "found %lld\n",
(long long)(int)offsetof(struct mdt_rec_setattr, sa_mode));
LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_mode) == 4, "found %lld\n",
(long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_mode));
- LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_padding_2) == 120, "found %lld\n",
- (long long)(int)offsetof(struct mdt_rec_setattr, sa_padding_2));
- LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_2) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_2));
+ LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_bias) == 120, "found %lld\n",
+ (long long)(int)offsetof(struct mdt_rec_setattr, sa_bias));
+ LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_bias) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_bias));
LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_padding_3) == 124, "found %lld\n",
(long long)(int)offsetof(struct mdt_rec_setattr, sa_padding_3));
LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_3) == 4, "found %lld\n",