Whamcloud - gitweb
LU-18461 osd: pass lu_attr to declare_xattr_set 89/57189/10
authorAlexey Lyashkov <alexey.lyashkov@hpe.com>
Wed, 20 Nov 2024 08:56:48 +0000 (11:56 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 8 Jul 2025 03:55:30 +0000 (03:55 +0000)
Pass the lu_attr to dt_declare_xattr_set() and do_declare_xattr_set()
OSD API methods for later use by file join to pass the object offset.

This patch only adds the "attr" parameter but does not use it,
so there is no functional change to the code.

Test-Parameters: trivial
Signed-off-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Change-Id: Ie43bb37cbd93f7eaabab2b4ef1f1fc0e6d7e7567
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57189
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
21 files changed:
lustre/include/dt_object.h
lustre/lfsck/lfsck_layout.c
lustre/lfsck/lfsck_lib.c
lustre/lfsck/lfsck_namespace.c
lustre/lfsck/lfsck_striped_dir.c
lustre/lod/lod_object.c
lustre/lod/lod_sub_object.c
lustre/mdd/mdd_device.c
lustre/mdd/mdd_dir.c
lustre/mdd/mdd_internal.h
lustre/obdclass/dt_object.c
lustre/obdclass/local_storage.c
lustre/obdclass/scrub.c
lustre/ofd/ofd_io.c
lustre/ofd/ofd_objects.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-zfs/osd_internal.h
lustre/osd-zfs/osd_xattr.c
lustre/osp/osp_internal.h
lustre/osp/osp_object.c
lustre/target/out_lib.c

index 21d70f5..982ff1f 100644 (file)
@@ -661,6 +661,7 @@ struct dt_object_operations {
         */
        int   (*do_declare_xattr_set)(const struct lu_env *env,
                                      struct dt_object *dt,
+                                     const struct lu_attr *attr,
                                      const struct lu_buf *buf,
                                      const char *name,
                                      int fl,
@@ -2912,6 +2913,7 @@ static inline int dt_xattr_del(const struct lu_env *env,
 
 static inline int dt_declare_xattr_set(const struct lu_env *env,
                                      struct dt_object *dt,
+                                     const struct lu_attr *attr,
                                      const struct lu_buf *buf,
                                      const char *name, int fl,
                                      struct thandle *th)
@@ -2925,7 +2927,8 @@ static inline int dt_declare_xattr_set(const struct lu_env *env,
        if (!dt->do_ops->do_declare_xattr_set)
                return 0;
 
-       return dt->do_ops->do_declare_xattr_set(env, dt, buf, name, fl, th);
+       return dt->do_ops->do_declare_xattr_set(env, dt, attr, buf, name,
+                                               fl, th);
 }
 
 static inline int dt_xattr_set(const struct lu_env *env,
index ddbdf46..e2bf1e6 100644 (file)
@@ -2248,7 +2248,8 @@ static int __lfsck_layout_update_pfid(const struct lu_env *env,
        if (IS_ERR(handle))
                RETURN(PTR_ERR(handle));
 
-       rc = dt_declare_xattr_set(env, child, &buf, XATTR_NAME_FID, 0, handle);
+       rc = dt_declare_xattr_set(env, child, NULL, &buf, XATTR_NAME_FID, 0,
+                                 handle);
        if (rc != 0)
                GOTO(stop, rc);
 
@@ -2493,7 +2494,7 @@ again:
                GOTO(stop, rc);
 
        lfsck_buf_init(&lov_buf, ea_buf->lb_buf, size);
-       rc = dt_declare_xattr_set(env, pobj, &lov_buf, XATTR_NAME_LOV,
+       rc = dt_declare_xattr_set(env, pobj, NULL, &lov_buf, XATTR_NAME_LOV,
                                  LU_XATTR_CREATE, th);
        if (rc != 0)
                GOTO(stop, rc);
@@ -2508,7 +2509,7 @@ again:
 
        lfsck_buf_init(&linkea_buf, ldata.ld_buf->lb_buf,
                       ldata.ld_leh->leh_len);
-       rc = dt_declare_xattr_set(env, pobj, &linkea_buf,
+       rc = dt_declare_xattr_set(env, pobj, NULL, &linkea_buf,
                                  XATTR_NAME_LINK, 0, th);
        if (rc != 0)
                GOTO(stop, rc);
@@ -2818,7 +2819,7 @@ static int lfsck_layout_conflict_create(const struct lu_env *env,
        if (IS_ERR(th))
                GOTO(unlock, rc = PTR_ERR(th));
 
-       rc = dt_declare_xattr_set(env, parent, ea_buf, XATTR_NAME_LOV,
+       rc = dt_declare_xattr_set(env, parent, NULL, ea_buf, XATTR_NAME_LOV,
                                  LU_XATTR_REPLACE, th);
        if (rc != 0)
                GOTO(stop, rc);
@@ -2936,8 +2937,8 @@ again:
                if (IS_ERR(handle))
                        GOTO(unlock_layout, rc = PTR_ERR(handle));
 
-               rc = dt_declare_xattr_set(env, parent, buf, XATTR_NAME_LOV,
-                                         fl, handle);
+               rc = dt_declare_xattr_set(env, parent, NULL, buf,
+                                         XATTR_NAME_LOV, fl, handle);
                if (rc != 0)
                        GOTO(stop, rc);
 
@@ -3561,7 +3562,7 @@ static int __lfsck_layout_repair_dangling(const struct lu_env *env,
        if (rc != 0)
                GOTO(stop, rc);
 
-       rc = dt_declare_xattr_set(env, child, buf, XATTR_NAME_FID,
+       rc = dt_declare_xattr_set(env, child, NULL, buf, XATTR_NAME_FID,
                                  LU_XATTR_CREATE, handle);
        if (rc != 0)
                GOTO(stop, rc);
@@ -3800,7 +3801,8 @@ static int lfsck_layout_repair_unmatched_pair(const struct lu_env *env,
        if (IS_ERR(handle))
                GOTO(unlock1, rc = PTR_ERR(handle));
 
-       rc = dt_declare_xattr_set(env, child, buf, XATTR_NAME_FID, 0, handle);
+       rc = dt_declare_xattr_set(env, child, NULL, buf, XATTR_NAME_FID, 0,
+                                 handle);
        if (rc != 0)
                GOTO(stop, rc);
 
@@ -3972,7 +3974,7 @@ static int lfsck_layout_repair_multiple_references(const struct lu_env *env,
        if (IS_ERR(handle))
                GOTO(log, rc = PTR_ERR(handle));
 
-       rc = dt_declare_xattr_set(env, parent, buf, XATTR_NAME_LOV,
+       rc = dt_declare_xattr_set(env, parent, NULL, buf, XATTR_NAME_LOV,
                                  LU_XATTR_REPLACE, handle);
        if (rc != 0)
                GOTO(stop, rc);
@@ -5879,8 +5881,9 @@ fix:
                        GOTO(out, rc = PTR_ERR(handle));
 
                lfsck_buf_init(&ea_buf, buf->lb_buf, size);
-               rc = dt_declare_xattr_set(env, obj, &ea_buf, XATTR_NAME_LOV,
-                                         LU_XATTR_REPLACE, handle);
+               rc = dt_declare_xattr_set(env, obj, NULL, &ea_buf,
+                                         XATTR_NAME_LOV, LU_XATTR_REPLACE,
+                                         handle);
                if (rc != 0)
                        GOTO(out, rc);
 
index 0da9d9d..c0ad6bd 100644 (file)
@@ -719,7 +719,7 @@ static int lfsck_create_lpf_local(const struct lu_env *env,
        /* 5a. insert linkEA for child */
        lfsck_buf_init(&linkea_buf, ldata.ld_buf->lb_buf,
                       ldata.ld_leh->leh_len);
-       rc = dt_declare_xattr_set(env, child, &linkea_buf,
+       rc = dt_declare_xattr_set(env, child, NULL, &linkea_buf,
                                  XATTR_NAME_LINK, 0, th);
        if (rc != 0)
                GOTO(stop, rc);
@@ -901,7 +901,7 @@ static int lfsck_create_lpf_remote(const struct lu_env *env,
        /* 5a. insert linkEA for child */
        lfsck_buf_init(&linkea_buf, ldata.ld_buf->lb_buf,
                       ldata.ld_leh->leh_len);
-       rc = dt_declare_xattr_set(env, child, &linkea_buf,
+       rc = dt_declare_xattr_set(env, child, NULL, &linkea_buf,
                                  XATTR_NAME_LINK, 0, th);
        if (rc != 0)
                GOTO(stop, rc);
index 49e60c2..c950bd4 100644 (file)
@@ -390,14 +390,14 @@ static int lfsck_namespace_store(const struct lu_env *env,
        if (IS_ERR(handle))
                GOTO(log, rc = PTR_ERR(handle));
 
-       rc = dt_declare_xattr_set(env, obj,
+       rc = dt_declare_xattr_set(env, obj, NULL,
                                  lfsck_buf_get(env, com->lc_file_disk, len),
                                  XATTR_NAME_LFSCK_NAMESPACE, 0, handle);
        if (rc != 0)
                GOTO(out, rc);
 
        if (bitmap != NULL) {
-               rc = dt_declare_xattr_set(env, obj,
+               rc = dt_declare_xattr_set(env, obj, NULL,
                                lfsck_buf_get(env, bitmap, nbits >> 3),
                                XATTR_NAME_LFSCK_BITMAP, 0, handle);
                if (rc != 0)
@@ -613,7 +613,7 @@ static int lfsck_declare_namespace_exec_dir(const struct lu_env *env,
        rc = dt_declare_xattr_del(env, obj, XATTR_NAME_LINK, handle);
        if (rc == 0)
                /* For insert new linkEA entry. */
-               rc = dt_declare_xattr_set(env, obj,
+               rc = dt_declare_xattr_set(env, obj, NULL,
                        lfsck_buf_get_const(env, NULL, MAX_LINKEA_SIZE),
                        XATTR_NAME_LINK, 0, handle);
        return rc;
@@ -998,7 +998,7 @@ again:
                        GOTO(stop, rc);
        }
 
-       rc = dt_declare_xattr_set(env, orphan, &linkea_buf,
+       rc = dt_declare_xattr_set(env, orphan, NULL, &linkea_buf,
                                  XATTR_NAME_LINK, 0, th);
        if (rc != 0)
                GOTO(stop, rc);
@@ -1116,7 +1116,7 @@ static int lfsck_lmv_set(const struct lu_env *env,
        if (IS_ERR(th))
                RETURN(PTR_ERR(th));
 
-       rc = dt_declare_xattr_set(env, obj, &buf, XATTR_NAME_LMV, 0, th);
+       rc = dt_declare_xattr_set(env, obj, NULL, &buf, XATTR_NAME_LMV, 0, th);
        if (rc)
                GOTO(stop, rc);
 
@@ -1328,8 +1328,8 @@ static int lfsck_namespace_insert_normal(const struct lu_env *env,
        }
 
        if (parent_lmv_lost) {
-               rc = dt_declare_xattr_set(env, parent, &buf, XATTR_NAME_LMV,
-                                         0, th);
+               rc = dt_declare_xattr_set(env, parent, NULL, &buf,
+                                         XATTR_NAME_LMV, 0, th);
                if (rc)
                        GOTO(stop, rc);
        }
@@ -1570,15 +1570,15 @@ again:
                lmv->lmv_master_mdt_index = lfsck_dev_idx(lfsck);
                lfsck_lmv_header_cpu_to_le(lmv2, lmv);
                lfsck_buf_init(&lmv_buf, lmv2, sizeof(*lmv2));
-               rc = dt_declare_xattr_set(env, orphan, &lmv_buf, XATTR_NAME_LMV,
-                                         0, th);
+               rc = dt_declare_xattr_set(env, orphan, NULL, &lmv_buf,
+                                         XATTR_NAME_LMV, 0, th);
                if (rc != 0)
                        GOTO(stop, rc);
        }
 
        lfsck_buf_init(&linkea_buf, ldata.ld_buf->lb_buf,
                       ldata.ld_leh->leh_len);
-       rc = dt_declare_xattr_set(env, orphan, &linkea_buf,
+       rc = dt_declare_xattr_set(env, orphan, NULL, &linkea_buf,
                                  XATTR_NAME_LINK, 0, th);
        if (rc != 0)
                GOTO(stop, rc);
@@ -1732,7 +1732,7 @@ again:
                GOTO(unlock1, rc = PTR_ERR(th));
 
        if (buflen != 0)
-               rc = dt_declare_xattr_set(env, obj, &linkea_buf,
+               rc = dt_declare_xattr_set(env, obj, NULL, &linkea_buf,
                                          XATTR_NAME_LINK, 0, th);
        else
                rc = dt_declare_xattr_del(env, obj, XATTR_NAME_LINK, th);
@@ -2139,7 +2139,7 @@ int lfsck_namespace_rebuild_linkea(const struct lu_env *env,
 
        lfsck_buf_init(&linkea_buf, ldata->ld_buf->lb_buf,
                       ldata->ld_leh->leh_len);
-       rc = dt_declare_xattr_set(env, obj, &linkea_buf,
+       rc = dt_declare_xattr_set(env, obj, NULL, &linkea_buf,
                                  XATTR_NAME_LINK, 0, th);
        if (rc != 0)
                GOTO(stop, rc);
@@ -2401,7 +2401,7 @@ static int lfsck_namespace_repair_unmatched_pairs(const struct lu_env *env,
        if (rc != 0)
                GOTO(stop, rc);
 
-       rc = dt_declare_xattr_set(env, obj, &linkea_buf,
+       rc = dt_declare_xattr_set(env, obj, NULL, &linkea_buf,
                                  XATTR_NAME_LINK, 0, th);
        if (rc != 0)
                GOTO(stop, rc);
@@ -3499,7 +3499,7 @@ static int lfsck_namespace_linkea_clear_overflow(const struct lu_env *env,
        if (IS_ERR(th))
                GOTO(log, rc = PTR_ERR(th));
 
-       rc = dt_declare_xattr_set(env, obj,
+       rc = dt_declare_xattr_set(env, obj, NULL,
                        lfsck_buf_get_const(env, NULL, MAX_LINKEA_SIZE),
                        XATTR_NAME_LINK, 0, th);
        if (rc != 0)
@@ -3634,7 +3634,7 @@ static int lfsck_namespace_check_agent_entry(const struct lu_env *env,
 
                lfsck_buf_init(&linkea_buf, ldata.ld_buf->lb_buf,
                               ldata.ld_leh->leh_len);
-               rc = dt_declare_xattr_set(env, obj, &linkea_buf,
+               rc = dt_declare_xattr_set(env, obj, NULL, &linkea_buf,
                                XATTR_NAME_LINK, LU_XATTR_REPLACE, handle);
                if (rc)
                        GOTO(stop, rc);
@@ -5478,7 +5478,7 @@ int lfsck_namespace_repair_dangling(const struct lu_env *env,
 
                        lfsck_lmv_header_cpu_to_le(lmv2, lmv2);
                        lfsck_buf_init(&lmv_buf, lmv2, sizeof(*lmv2));
-                       rc = dt_declare_xattr_set(env, child, &lmv_buf,
+                       rc = dt_declare_xattr_set(env, child, NULL, &lmv_buf,
                                                  XATTR_NAME_LMV, 0, th);
                        if (rc != 0)
                                GOTO(stop, rc);
@@ -5488,7 +5488,7 @@ int lfsck_namespace_repair_dangling(const struct lu_env *env,
        /* 6a. insert linkEA for child */
        lfsck_buf_init(&linkea_buf, ldata.ld_buf->lb_buf,
                       ldata.ld_leh->leh_len);
-       rc = dt_declare_xattr_set(env, child, &linkea_buf,
+       rc = dt_declare_xattr_set(env, child, NULL, &linkea_buf,
                                  XATTR_NAME_LINK, 0, th);
        if (rc != 0)
                GOTO(stop, rc);
@@ -6986,7 +6986,7 @@ int lfsck_verify_linkea(const struct lu_env *env, struct lfsck_instance *lfsck,
        if (IS_ERR(th))
                RETURN(PTR_ERR(th));
 
-       rc = dt_declare_xattr_set(env, obj, &linkea_buf,
+       rc = dt_declare_xattr_set(env, obj, NULL, &linkea_buf,
                                  XATTR_NAME_LINK, fl, th);
        if (rc != 0)
                GOTO(stop, rc);
index 058df66..6cb699c 100644 (file)
@@ -1086,7 +1086,7 @@ int lfsck_namespace_update_lmv(const struct lu_env *env,
        if (dt_object_remote(obj))
                th->th_sync = 1;
 
-       rc = dt_declare_xattr_set(env, obj, buf, XATTR_NAME_LMV, 0, th);
+       rc = dt_declare_xattr_set(env, obj, NULL, buf, XATTR_NAME_LMV, 0, th);
        if (rc != 0)
                GOTO(stop, rc);
 
index 26e9db7..2d28fb1 100644 (file)
@@ -3745,13 +3745,13 @@ static int lod_layout_purge(const struct lu_env *env, struct dt_object *dt,
  */
 static int lod_declare_xattr_set(const struct lu_env *env,
                                 struct dt_object *dt,
+                                const struct lu_attr *attr,
                                 const struct lu_buf *buf,
                                 const char *name, int fl,
                                 struct thandle *th)
 {
        struct lod_thread_info *info = lod_env_info(env);
        struct dt_object *next = dt_object_child(dt);
-       struct lu_attr   *attr = &info->lti_attr;
        struct lod_object *lo = lod_dt_obj(dt);
        __u32             mode;
        int               rc;
@@ -3763,6 +3763,8 @@ static int lod_declare_xattr_set(const struct lu_env *env,
                    LU_XATTR_PURGE)) &&
            (strcmp(name, XATTR_NAME_LOV) == 0 ||
             strcmp(name, XATTR_LUSTRE_LOV) == 0)) {
+               struct lu_attr   *lattr = &lod_env_info(env)->lti_attr;
+
                /*
                 * this is a request to create object's striping.
                 *
@@ -3773,15 +3775,15 @@ static int lod_declare_xattr_set(const struct lu_env *env,
                 * LU_XATTR_REPLACE is set to indicate a layout swap
                 */
                if (dt_object_exists(dt)) {
-                       rc = dt_attr_get(env, next, attr);
+                       rc = dt_attr_get(env, next, lattr);
                        if (rc)
                                RETURN(rc);
                } else {
-                       memset(attr, 0, sizeof(*attr));
-                       attr->la_valid = LA_TYPE | LA_MODE;
-                       attr->la_mode = S_IFREG;
+                       memset(lattr, 0, sizeof(*lattr));
+                       lattr->la_valid = LA_TYPE | LA_MODE;
+                       lattr->la_mode = S_IFREG;
                }
-               rc = lod_declare_striped_create(env, dt, attr, buf, th);
+               rc = lod_declare_striped_create(env, dt, lattr, buf, th);
        } else if (fl & LU_XATTR_MERGE) {
                LASSERT(strcmp(name, XATTR_NAME_LOV) == 0 ||
                        strcmp(name, XATTR_LUSTRE_LOV) == 0);
index d99e112..3db1c01 100644 (file)
@@ -549,7 +549,7 @@ int lod_sub_declare_xattr_set(const struct lu_env *env, struct dt_object *dt,
                                   lu_object_fid(&dt->do_lu),
                                   buf, name, fl);
 
-       rc = dt_declare_xattr_set(env, dt, buf, name, fl, sub_th);
+       rc = dt_declare_xattr_set(env, dt, NULL, buf, name, fl, sub_th);
 
        RETURN(rc);
 }
index cb4ce24..7ab9a4a 100644 (file)
@@ -1333,7 +1333,7 @@ static int mdd_prepare(const struct lu_env *env,
 
                        buf.lb_buf = &lmv_default;
                        buf.lb_len = sizeof(lmv_default);
-                       rc = dt_declare_xattr_set(env, root, &buf,
+                       rc = dt_declare_xattr_set(env, root, NULL, &buf,
                                                  XATTR_NAME_DEFAULT_LMV, 0,
                                                  th);
                        if (rc)
index a6e0a7f..37c8571 100644 (file)
@@ -2381,7 +2381,7 @@ static int mdd_create_data(const struct lu_env *env, struct md_object *pobj,
                buf = &LU_BUF_NULL;
        }
 
-       rc = dt_declare_xattr_set(env, mdd_object_child(son), buf,
+       rc = dt_declare_xattr_set(env, mdd_object_child(son), NULL, buf,
                                  XATTR_NAME_LOV, 0, handle);
        if (rc)
                GOTO(stop, rc);
index ffc3208..84ced3e 100644 (file)
@@ -627,7 +627,7 @@ static inline int mdo_declare_xattr_set(const struct lu_env *env,
        struct dt_object *next = mdd_object_child(obj);
        int rc;
 
-       rc = dt_declare_xattr_set(env, next, buf, name, fl, handle);
+       rc = dt_declare_xattr_set(env, next, NULL, buf, name, fl, handle);
        if (rc >= 0 &&
            (strcmp(name, LL_XATTR_NAME_ENCRYPTION_CONTEXT) == 0 ||
             strcmp(name, LL_XATTR_NAME_ENCRYPTION_CONTEXT_OLD) == 0)) {
index 10956de..ebf24b0 100644 (file)
@@ -401,7 +401,7 @@ int dt_declare_version_set(const struct lu_env *env, struct dt_object *o,
        LASSERT(o);
        vbuf.lb_buf = NULL;
        vbuf.lb_len = sizeof(dt_obj_version_t);
-       return dt_declare_xattr_set(env, o, &vbuf, xname, 0, th);
+       return dt_declare_xattr_set(env, o, NULL, &vbuf, xname, 0, th);
 }
 EXPORT_SYMBOL(dt_declare_version_set);
 
@@ -449,7 +449,8 @@ int dt_declare_data_version_set(const struct lu_env *env, struct dt_object *o,
        vbuf.lb_buf = NULL;
        vbuf.lb_len = sizeof(dt_obj_version_t);
 
-       return dt_declare_xattr_set(env, o, &vbuf, XATTR_NAME_DATAVER, 0, th);
+       return dt_declare_xattr_set(env, o, NULL, &vbuf, XATTR_NAME_DATAVER, 0,
+              th);
 }
 EXPORT_SYMBOL(dt_declare_data_version_set);
 
index 695feec..60a5e21 100644 (file)
@@ -224,7 +224,8 @@ int local_object_declare_create(const struct lu_env *env,
 
        dti->dti_lb.lb_buf = NULL;
        dti->dti_lb.lb_len = sizeof(dti->dti_lma);
-       rc = dt_declare_xattr_set(env, o, &dti->dti_lb, XATTR_NAME_LMA, 0, th);
+       rc = dt_declare_xattr_set(env, o, NULL, &dti->dti_lb, XATTR_NAME_LMA, 0,
+                                 th);
 
        RETURN(rc);
 }
index 28488f2..583d4a9 100644 (file)
@@ -884,7 +884,8 @@ static int lustre_index_update_lma(const struct lu_env *env,
        if (IS_ERR(th))
                RETURN(rc);
 
-       rc = dt_declare_xattr_set(env, obj, &lbuf, XATTR_NAME_LMA, fl, th);
+       rc = dt_declare_xattr_set(env, obj, NULL, &lbuf, XATTR_NAME_LMA, fl,
+                                 th);
        if (rc)
                GOTO(stop, rc);
 
index d3938ad..5903b0b 100644 (file)
@@ -1063,7 +1063,7 @@ ofd_write_attr_set(const struct lu_env *env, struct ofd_device *ofd,
 
        if (oa->o_valid & (OBD_MD_FLFID | OBD_MD_FLOSTLAYOUT |
                           OBD_MD_LAYOUT_VERSION)) {
-               rc = dt_declare_xattr_set(env, dt_obj, &info->fti_buf,
+               rc = dt_declare_xattr_set(env, dt_obj, NULL, &info->fti_buf,
                                          XATTR_NAME_FID, 0, th);
                if (rc)
                        GOTO(out_tx, rc);
index c42b050..4acf642 100644 (file)
@@ -713,8 +713,8 @@ int ofd_attr_set(const struct lu_env *env, struct ofd_object *fo,
 
        info->fti_buf.lb_buf = ff;
        info->fti_buf.lb_len = sizeof(*ff);
-       rc = dt_declare_xattr_set(env, ofd_object_child(fo), &info->fti_buf,
-                                 XATTR_NAME_FID, 0, th);
+       rc = dt_declare_xattr_set(env, ofd_object_child(fo), NULL,
+                                 &info->fti_buf, XATTR_NAME_FID, 0, th);
        if (rc)
                GOTO(stop, rc);
 
@@ -853,7 +853,7 @@ int ofd_object_fallocate(const struct lu_env *env, struct ofd_object *fo,
                        info->fti_buf.lb_buf = ff;
                        info->fti_buf.lb_len = sizeof(*ff);
                        rc = dt_declare_xattr_set(env, ofd_object_child(fo),
-                                       &info->fti_buf, XATTR_NAME_FID, 0,
+                                       NULL, &info->fti_buf, XATTR_NAME_FID, 0,
                                        th);
                        if (rc)
                                GOTO(stop, rc);
@@ -977,8 +977,8 @@ int ofd_object_punch(const struct lu_env *env, struct ofd_object *fo,
 
        info->fti_buf.lb_buf = ff;
        info->fti_buf.lb_len = sizeof(*ff);
-       rc = dt_declare_xattr_set(env, ofd_object_child(fo), &info->fti_buf,
-                                 XATTR_NAME_FID, 0, th);
+       rc = dt_declare_xattr_set(env, ofd_object_child(fo), NULL,
+                                 &info->fti_buf, XATTR_NAME_FID, 0, th);
        if (rc)
                GOTO(stop, rc);
 
index 1f755b4..4da6428 100644 (file)
@@ -4714,6 +4714,7 @@ static int osd_xattr_get(const struct lu_env *env, struct dt_object *dt,
 
 static int osd_declare_xattr_set(const struct lu_env *env,
                                 struct dt_object *dt,
+                                const struct lu_attr *attr,
                                 const struct lu_buf *buf, const char *name,
                                 int fl, struct thandle *handle)
 {
index b652598..651c79f 100644 (file)
@@ -750,6 +750,7 @@ int osd_xattr_get_lma(const struct lu_env *env, struct osd_object *obj,
 int osd_xattr_get(const struct lu_env *env, struct dt_object *dt,
                  struct lu_buf *buf, const char *name);
 int osd_declare_xattr_set(const struct lu_env *env, struct dt_object *dt,
+                         const struct lu_attr *attr,
                          const struct lu_buf *buf, const char *name,
                          int fl, struct thandle *handle);
 int osd_xattr_set(const struct lu_env *env, struct dt_object *dt,
index a7a58ac..c3f9779 100644 (file)
@@ -426,6 +426,7 @@ void __osd_xattr_declare_set(const struct lu_env *env, struct osd_object *obj,
 }
 
 int osd_declare_xattr_set(const struct lu_env *env, struct dt_object *dt,
+                         const struct lu_attr *attr,
                          const struct lu_buf *buf, const char *name,
                          int fl, struct thandle *handle)
 {
index 12fa688..7e20716 100644 (file)
@@ -747,6 +747,7 @@ int osp_attr_get(const struct lu_env *env, struct dt_object *dt,
 int osp_xattr_get(const struct lu_env *env, struct dt_object *dt,
                  struct lu_buf *buf, const char *name);
 int osp_declare_xattr_set(const struct lu_env *env, struct dt_object *dt,
+                         const struct lu_attr *attr,
                          const struct lu_buf *buf, const char *name,
                          int flag, struct thandle *th);
 int osp_xattr_set(const struct lu_env *env, struct dt_object *dt,
index 7e4b0bd..03a635f 100644 (file)
@@ -1202,6 +1202,7 @@ out_req:
  * \retval             negative error number on failure
  */
 int osp_declare_xattr_set(const struct lu_env *env, struct dt_object *dt,
+                         const struct lu_attr *attr,
                          const struct lu_buf *buf, const char *name,
                          int flag, struct thandle *th)
 {
index 7bfa365..6ee76e5 100644 (file)
@@ -840,7 +840,7 @@ int out_xattr_set_add_exec(const struct lu_env *env, struct dt_object *dt_obj,
        struct tx_arg   *arg;
        int             rc;
 
-       rc = dt_declare_xattr_set(env, dt_obj, buf, name, flags, th);
+       rc = dt_declare_xattr_set(env, dt_obj, NULL, buf, name, flags, th);
        if (rc != 0)
                return rc;