Whamcloud - gitweb
LU-6142 osd-zfs: convert container_of0() to container_of()
[fs/lustre-release.git] / lustre / osd-zfs / osd_xattr.c
index 67be1b4..0db69f3 100644 (file)
@@ -240,7 +240,7 @@ static int osd_get_pfid_from_lma(const struct lu_env *env,
        int rc;
        ENTRY;
 
-       CLASSERT(sizeof(info->oti_buf) >= sizeof(*loa));
+       BUILD_BUG_ON(sizeof(info->oti_buf) < sizeof(*loa));
        rc = osd_xattr_get_internal(env, obj, &tbuf,
                                    XATTR_NAME_LMA, sizep);
        if (rc)
@@ -414,7 +414,7 @@ int osd_declare_xattr_set(const struct lu_env *env, struct dt_object *dt,
        ENTRY;
 
        LASSERT(handle != NULL);
-       oh = container_of0(handle, struct osd_thandle, ot_super);
+       oh = container_of(handle, struct osd_thandle, ot_super);
 
        down_read(&obj->oo_guard);
        __osd_xattr_declare_set(env, obj, buf->lb_len, name, oh);
@@ -583,8 +583,7 @@ int __osd_sa_xattr_set(const struct lu_env *env, struct osd_object *obj,
                return rc;
 
        LASSERT(obj->oo_sa_xattr);
-       /* Limited to 32k to keep nvpair memory allocations small */
-       if (buf->lb_len > DXATTR_MAX_ENTRY_SIZE) {
+       if (buf->lb_len > OBD_MAX_EA_SIZE) {
                too_big = 1;
        } else {
                /* Prevent the DXATTR SA from consuming the entire SA
@@ -778,7 +777,7 @@ static int osd_xattr_split_pfid(const struct lu_env *env,
        int rc;
        ENTRY;
 
-       CLASSERT(sizeof(info->oti_buf) >= sizeof(*loa));
+       BUILD_BUG_ON(sizeof(info->oti_buf) < sizeof(*loa));
        rc = osd_xattr_get_internal(env, obj, &buf, XATTR_NAME_LMA, &size);
        if (rc)
                RETURN(rc);
@@ -877,7 +876,7 @@ int osd_xattr_set(const struct lu_env *env, struct dt_object *dt,
             strcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0))
                RETURN(-EOPNOTSUPP);
 
-       oh = container_of0(handle, struct osd_thandle, ot_super);
+       oh = container_of(handle, struct osd_thandle, ot_super);
 
        down_write(&obj->oo_guard);
        CDEBUG(D_INODE, "Setting xattr %s with size %d\n",
@@ -947,7 +946,7 @@ int osd_declare_xattr_del(const struct lu_env *env, struct dt_object *dt,
        LASSERT(handle != NULL);
        LASSERT(osd_invariant(obj));
 
-       oh = container_of0(handle, struct osd_thandle, ot_super);
+       oh = container_of(handle, struct osd_thandle, ot_super);
        LASSERT(oh->ot_tx != NULL);
        LASSERT(obj->oo_dn != NULL);
 
@@ -1033,7 +1032,7 @@ int osd_xattr_del(const struct lu_env *env, struct dt_object *dt,
        LASSERT(obj->oo_dn != NULL);
        LASSERT(osd_invariant(obj));
        LASSERT(dt_object_exists(dt));
-       oh = container_of0(handle, struct osd_thandle, ot_super);
+       oh = container_of(handle, struct osd_thandle, ot_super);
        LASSERT(oh->ot_tx != NULL);
 
        if (!osd_obj2dev(obj)->od_posix_acl &&