Whamcloud - gitweb
LU-2675 llog: remove obd_llog_init() and obd_llod_finish()
[fs/lustre-release.git] / lustre / obdclass / llog_obd.c
index 606c22a..1b4f541 100644 (file)
@@ -36,9 +36,6 @@
 
 #define DEBUG_SUBSYSTEM S_LOG
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 
 #include <obd_class.h>
 #include <lustre_log.h>
@@ -54,7 +51,7 @@ static struct llog_ctxt* llog_new_ctxt(struct obd_device *obd)
                 return NULL;
 
         ctxt->loc_obd = obd;
-        cfs_atomic_set(&ctxt->loc_refcount, 1);
+       atomic_set(&ctxt->loc_refcount, 1);
 
         return ctxt;
 }
@@ -79,7 +76,7 @@ int __llog_ctxt_put(const struct lu_env *env, struct llog_ctxt *ctxt)
         int rc = 0;
 
        spin_lock(&olg->olg_lock);
-       if (!cfs_atomic_dec_and_test(&ctxt->loc_refcount)) {
+       if (!atomic_dec_and_test(&ctxt->loc_refcount)) {
                spin_unlock(&olg->olg_lock);
                return rc;
        }
@@ -103,7 +100,7 @@ int __llog_ctxt_put(const struct lu_env *env, struct llog_ctxt *ctxt)
                rc = CTXTP(ctxt, cleanup)(env, ctxt);
 
        llog_ctxt_destroy(ctxt);
-       cfs_waitq_signal(&olg->olg_waitq);
+       wake_up(&olg->olg_waitq);
        return rc;
 }
 EXPORT_SYMBOL(__llog_ctxt_put);
@@ -127,8 +124,8 @@ int llog_cleanup(const struct lu_env *env, struct llog_ctxt *ctxt)
        /*
          * Banlance the ctxt get when calling llog_cleanup()
          */
-        LASSERT(cfs_atomic_read(&ctxt->loc_refcount) < LI_POISON);
-        LASSERT(cfs_atomic_read(&ctxt->loc_refcount) > 1);
+       LASSERT(atomic_read(&ctxt->loc_refcount) < LI_POISON);
+       LASSERT(atomic_read(&ctxt->loc_refcount) > 1);
         llog_ctxt_put(ctxt);
 
        /*
@@ -232,35 +229,7 @@ int llog_sync(struct llog_ctxt *ctxt, struct obd_export *exp, int flags)
 }
 EXPORT_SYMBOL(llog_sync);
 
-int llog_obd_add(const struct lu_env *env, struct llog_ctxt *ctxt,
-                struct llog_rec_hdr *rec, struct lov_stripe_md *lsm,
-                struct llog_cookie *logcookies, int numcookies)
-{
-        int raised, rc;
-        ENTRY;
-
-        if (!ctxt) {
-                CERROR("No ctxt\n");
-                RETURN(-ENODEV);
-        }
-
-        if (ctxt->loc_flags & LLOG_CTXT_FLAG_UNINITIALIZED)
-                RETURN(-ENXIO);
-
-       CTXT_CHECK_OP(ctxt, obd_add, -EOPNOTSUPP);
-        raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
-        if (!raised)
-                cfs_cap_raise(CFS_CAP_SYS_RESOURCE);
-       rc = CTXTP(ctxt, obd_add)(env, ctxt, rec, lsm, logcookies,
-                                 numcookies);
-        if (!raised)
-                cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
-        RETURN(rc);
-}
-EXPORT_SYMBOL(llog_obd_add);
-
 int llog_cancel(const struct lu_env *env, struct llog_ctxt *ctxt,
-               struct lov_stripe_md *lsm, int count,
                struct llog_cookie *cookies, int flags)
 {
         int rc;
@@ -272,36 +241,11 @@ int llog_cancel(const struct lu_env *env, struct llog_ctxt *ctxt,
         }
 
         CTXT_CHECK_OP(ctxt, cancel, -EOPNOTSUPP);
-       rc = CTXTP(ctxt, cancel)(env, ctxt, lsm, count, cookies, flags);
+       rc = CTXTP(ctxt, cancel)(env, ctxt, cookies, flags);
         RETURN(rc);
 }
 EXPORT_SYMBOL(llog_cancel);
 
-int obd_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
-                  struct obd_device *disk_obd, int *index)
-{
-        int rc;
-        ENTRY;
-        OBD_CHECK_DT_OP(obd, llog_init, 0);
-        OBD_COUNTER_INCREMENT(obd, llog_init);
-
-        rc = OBP(obd, llog_init)(obd, olg, disk_obd, index);
-        RETURN(rc);
-}
-EXPORT_SYMBOL(obd_llog_init);
-
-int obd_llog_finish(struct obd_device *obd, int count)
-{
-        int rc;
-        ENTRY;
-        OBD_CHECK_DT_OP(obd, llog_finish, 0);
-        OBD_COUNTER_INCREMENT(obd, llog_finish);
-
-        rc = OBP(obd, llog_finish)(obd, count);
-        RETURN(rc);
-}
-EXPORT_SYMBOL(obd_llog_finish);
-
 /* context key constructor/destructor: llog_key_init, llog_key_fini */
 LU_KEY_INIT_FINI(llog, struct llog_thread_info);
 /* context key: llog_thread_key */