X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fptlrpc%2Fllog_client.c;h=dffd8549f3be9bed3919b4ea39a16451d7938c86;hp=17f7142d43bca98a038ce5c1ef47e0c94134da53;hb=e2af7fb3c91dfb13d34d8e1b2f2df8c09621f768;hpb=6e3ec5812ebd1b5ecf7cae584f429b013ffe7431 diff --git a/lustre/ptlrpc/llog_client.c b/lustre/ptlrpc/llog_client.c index 17f7142..dffd854 100644 --- a/lustre/ptlrpc/llog_client.c +++ b/lustre/ptlrpc/llog_client.c @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,8 +24,10 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2012, Whamcloud, Inc. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -42,10 +42,6 @@ #define DEBUG_SUBSYSTEM S_LOG -#ifndef EXPORT_SYMTAB -#define EXPORT_SYMTAB -#endif - #ifdef __KERNEL__ #include #else @@ -58,7 +54,7 @@ #include #define LLOG_CLIENT_ENTRY(ctxt, imp) do { \ - cfs_mutex_down(&ctxt->loc_sem); \ + cfs_mutex_lock(&ctxt->loc_mutex); \ if (ctxt->loc_imp) { \ imp = class_import_get(ctxt->loc_imp); \ } else { \ @@ -67,19 +63,19 @@ "but I'll try again next time. Not fatal.\n", \ ctxt->loc_idx); \ imp = NULL; \ - cfs_mutex_up(&ctxt->loc_sem); \ + cfs_mutex_unlock(&ctxt->loc_mutex); \ return (-EINVAL); \ } \ - cfs_mutex_up(&ctxt->loc_sem); \ + cfs_mutex_unlock(&ctxt->loc_mutex); \ } while(0) #define LLOG_CLIENT_EXIT(ctxt, imp) do { \ - cfs_mutex_down(&ctxt->loc_sem); \ + cfs_mutex_lock(&ctxt->loc_mutex); \ if (ctxt->loc_imp != imp) \ CWARN("loc_imp has changed from %p to %p\n", \ ctxt->loc_imp, imp); \ class_import_put(imp); \ - cfs_mutex_up(&ctxt->loc_sem); \ + cfs_mutex_unlock(&ctxt->loc_mutex); \ } while(0) /* This is a callback from the llog_* functions. @@ -147,6 +143,7 @@ out: ptlrpc_req_finished(req); return rc; err_free: + *res = NULL; llog_free_handle(handle); goto out; }