void lu_device_fini (struct lu_device *d);
int lu_object_header_init(struct lu_object_header *h);
void lu_object_header_fini(struct lu_object_header *h);
+void lu_object_header_free(struct lu_object_header *h);
int lu_object_init (struct lu_object *o,
struct lu_object_header *h, struct lu_device *d);
void lu_object_fini (struct lu_object *o);
EXPORT_SYMBOL(lu_object_header_fini);
/**
+ * Free lu_object_header with proper RCU handling
+ */
+void lu_object_header_free(struct lu_object_header *h)
+{
+ lu_object_header_fini(h);
+ OBD_FREE_PRE(h, sizeof(*h), "kfreed");
+ kfree_rcu(h, loh_rcu);
+}
+EXPORT_SYMBOL(lu_object_header_free);
+
+/**
* Given a compound object, find its slice, corresponding to the device type
* \a dtype.
*/
ldiskfs_htree_lock_head_free(obj->oo_hl_head);
/* obj doesn't contain an lu_object_header, so we don't need call_rcu */
OBD_FREE_PTR(obj);
- 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);
}
/*
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