if (osd_object_auth(env, dt, capa, CAPA_OPC_INDEX_INSERT))
return -EACCES;
- fid_unpack(pack, fid);
+ result = fid_unpack(pack, fid);
+ if (result != 0)
+ return result;
+
luch = lu_object_find(env, ludev->ld_site, fid);
if (!IS_ERR(luch)) {
if (lu_object_exists(luch)) {
/*
* OSD device type methods
*/
-static int osd_type_init(struct lu_device_type *t)
-{
- LU_CONTEXT_KEY_INIT(&osd_key);
- return lu_context_key_register(&osd_key);
-}
-
-static void osd_type_fini(struct lu_device_type *t)
-{
- lu_context_key_degister(&osd_key);
-}
+
+LU_TYPE_INIT_FINI(osd, &osd_key);
static struct lu_context_key osd_key = {
.lct_tags = LCT_DT_THREAD | LCT_MD_THREAD,
return info;
}
-static void osd_key_fini(const struct lu_context *ctx,
- struct lu_context_key *key, void *data)
-{
- struct osd_thread_info *info = data;
- OBD_FREE_PTR(info);
-}
+LU_KEY_FINI(osd, struct osd_thread_info);
static void osd_key_exit(const struct lu_context *ctx,
struct lu_context_key *key, void *data)