Whamcloud - gitweb
LU-6142 lustre: convert IFTODT to S_DT
[fs/lustre-release.git] / lustre / osd-zfs / osd_object.c
index 7f38fa4..9817cc5 100644 (file)
@@ -64,9 +64,9 @@
 char *osd_obj_tag = "osd_object";
 static int osd_object_sync_delay_us = -1;
 
-static struct dt_object_operations osd_obj_ops;
-static struct lu_object_operations osd_lu_obj_ops;
-static struct dt_object_operations osd_obj_otable_it_ops;
+static const struct dt_object_operations osd_obj_ops;
+static const struct lu_object_operations osd_lu_obj_ops;
+static const struct dt_object_operations osd_obj_otable_it_ops;
 
 static void
 osd_object_sa_fini(struct osd_object *obj)
@@ -696,11 +696,8 @@ static void osd_object_free(const struct lu_env *env, struct lu_object *l)
        dt_object_fini(&obj->oo_dt);
        /* obj doesn't contain an lu_object_header, so we don't need call_rcu */
        OBD_SLAB_FREE_PTR(obj, osd_object_kmem);
-       if (unlikely(h)) {
-               lu_object_header_fini(h);
-               OBD_FREE_PRE(h, sizeof(*h), "kfreed");
-               kfree_rcu(h, loh_rcu);
-       }
+       if (unlikely(h))
+               lu_object_header_free(h);
 }
 
 static int
@@ -1975,7 +1972,7 @@ static int osd_create(const struct lu_env *env, struct dt_object *dt,
 
        zde->zde_pad = 0;
        zde->zde_dnode = dn->dn_object;
-       zde->zde_type = IFTODT(attr->la_mode & S_IFMT);
+       zde->zde_type = S_DT(attr->la_mode & S_IFMT);
 
        zapid = osd_get_name_n_idx(env, osd, fid, buf,
                                   sizeof(info->oti_str), &zdn);
@@ -2149,7 +2146,12 @@ static int osd_invalidate(const struct lu_env *env, struct dt_object *dt)
        return 0;
 }
 
-static struct dt_object_operations osd_obj_ops = {
+static bool osd_check_stale(struct dt_object *dt)
+{
+       return false;
+}
+
+static const struct dt_object_operations osd_obj_ops = {
        .do_read_lock           = osd_read_lock,
        .do_write_lock          = osd_write_lock,
        .do_read_unlock         = osd_read_unlock,
@@ -2176,9 +2178,10 @@ static struct dt_object_operations osd_obj_ops = {
        .do_xattr_list          = osd_xattr_list,
        .do_object_sync         = osd_object_sync,
        .do_invalidate          = osd_invalidate,
+       .do_check_stale         = osd_check_stale,
 };
 
-static struct lu_object_operations osd_lu_obj_ops = {
+static const struct lu_object_operations osd_lu_obj_ops = {
        .loo_object_init        = osd_object_init,
        .loo_object_delete      = osd_object_delete,
        .loo_object_release     = osd_object_release,
@@ -2195,7 +2198,7 @@ static int osd_otable_it_attr_get(const struct lu_env *env,
        return 0;
 }
 
-static struct dt_object_operations osd_obj_otable_it_ops = {
+static const struct dt_object_operations osd_obj_otable_it_ops = {
        .do_attr_get            = osd_otable_it_attr_get,
        .do_index_try           = osd_index_try,
 };