Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / fid / fid_handler.c
index 0aa64b2..0522eb8 100644 (file)
@@ -356,33 +356,9 @@ static int seq_req_handle(struct ptlrpc_request *req,
         RETURN(rc);
 }
 
-static void *seq_key_init(const struct lu_context *ctx,
-                          struct lu_context_key *key)
-{
-        struct seq_thread_info *info;
-
-        /*
-         * check that no high order allocations are incurred.
-         */
-        CLASSERT(CFS_PAGE_SIZE >= sizeof *info);
-        OBD_ALLOC_PTR(info);
-        if (info == NULL)
-                info = ERR_PTR(-ENOMEM);
-        return info;
-}
-
-static void seq_key_fini(const struct lu_context *ctx,
-                         struct lu_context_key *key, void *data)
-{
-        struct seq_thread_info *info = data;
-        OBD_FREE_PTR(info);
-}
+LU_KEY_INIT_FINI(seq, struct seq_thread_info);
 
-struct lu_context_key seq_thread_key = {
-        .lct_tags = LCT_MD_THREAD,
-        .lct_init = seq_key_init,
-        .lct_fini = seq_key_fini
-};
+LU_CONTEXT_KEY_DEFINE(seq, LCT_MD_THREAD);
 
 static void seq_thread_info_init(struct ptlrpc_request *req,
                                  struct seq_thread_info *info)