/* no need to setattr anymore */
if (la_copy->la_valid == 0) {
- CDEBUG(D_INODE, "%s: no valid attribute on "DFID", previous"
- "valid is %#llx\n", mdd2obd_dev(mdd)->obd_name,
+ CDEBUG(D_INODE,
+ "%s: no valid attribute on "DFID", previous valid is %#llx\n",
+ mdd2obd_dev(mdd)->obd_name,
PFID(mdo2fid(mdd_obj)), la->la_valid);
RETURN(0);
*
* \param[in] xattr_name Full extended attribute name.
*
- * \return The type of changelog to use, or -1 if no changelog is to be emitted.
+ * \return type of changelog to use, or CL_NONE if no changelog is to be emitted
*/
static enum changelog_rec_type
mdd_xattr_changelog_type(const struct lu_env *env, struct mdd_device *mdd,
{
/* Layout changes systematically recorded */
if (strcmp(XATTR_NAME_LOV, xattr_name) == 0 ||
- strncmp(XATTR_LUSTRE_LOV, xattr_name,
- strlen(XATTR_LUSTRE_LOV)) == 0)
+ strcmp(XATTR_LUSTRE_LOV, xattr_name) == 0 ||
+ allowed_lustre_lov(xattr_name))
return CL_LAYOUT;
/* HSM information changes systematically recorded */
/* Read HSM attrs from disk */
current_buf = lu_buf_check_and_alloc(&info->mti_xattr_buf,
- MIN(mdd_obj2mdd_dev(mdd_obj)->mdd_dt_conf.ddp_max_ea_size,
+ min_t(unsigned int,
+ mdd_obj2mdd_dev(mdd_obj)->mdd_dt_conf.ddp_max_ea_size,
XATTR_SIZE_MAX));
rc = mdo_xattr_get(env, mdd_obj, current_buf, XATTR_NAME_HSM);
rc = lustre_buf2hsm(current_buf->lb_buf, rc, current_mh);
ENTRY;
- CLASSERT(ARRAY_SIZE(info->mti_buf) >= 4);
+ BUILD_BUG_ON(ARRAY_SIZE(info->mti_buf) < 4);
memset(info->mti_buf, 0, sizeof(info->mti_buf));
/* we have to sort the 2 obj, so locking will always