Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-1302 llog: pass lu_env as parametr in llog functions
[fs/lustre-release.git]
/
lustre
/
ptlrpc
/
recov_thread.c
diff --git
a/lustre/ptlrpc/recov_thread.c
b/lustre/ptlrpc/recov_thread.c
index
4d552cf
..
710afd7
100644
(file)
--- a/
lustre/ptlrpc/recov_thread.c
+++ b/
lustre/ptlrpc/recov_thread.c
@@
-47,10
+47,6
@@
#define DEBUG_SUBSYSTEM S_LOG
#define DEBUG_SUBSYSTEM S_LOG
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
-
#ifdef __KERNEL__
# include <libcfs/libcfs.h>
#else
#ifdef __KERNEL__
# include <libcfs/libcfs.h>
#else
@@
-566,7
+562,7
@@
int llog_obd_repl_connect(struct llog_ctxt *ctxt,
* Send back cached llcd from llog before recovery if we have any.
* This is void is nothing cached is found there.
*/
* Send back cached llcd from llog before recovery if we have any.
* This is void is nothing cached is found there.
*/
-
llog_sync(ctxt, NULL
);
+
llog_sync(ctxt, NULL, 0
);
/*
* Start recovery in separate thread.
/*
* Start recovery in separate thread.
@@
-585,9
+581,9
@@
EXPORT_SYMBOL(llog_obd_repl_connect);
* log record for the deletion. The commit callback calls this
* function.
*/
* log record for the deletion. The commit callback calls this
* function.
*/
-int llog_obd_repl_cancel(struct llog_ctxt *ctxt,
-
struct lov_stripe_md *lsm, int count,
-
struct llog_cookie *cookies, int flags)
+int llog_obd_repl_cancel(
const struct lu_env *env,
struct llog_ctxt *ctxt,
+ struct lov_stripe_md *lsm, int count,
+ struct llog_cookie *cookies, int flags)
{
struct llog_commit_master *lcm;
struct llog_canceld_ctxt *llcd;
{
struct llog_commit_master *lcm;
struct llog_canceld_ctxt *llcd;
@@
-608,7
+604,12
@@
int llog_obd_repl_cancel(struct llog_ctxt *ctxt,
* Let's check if we have all structures alive. We also check for
* possible shutdown. Do nothing if we're stopping.
*/
* Let's check if we have all structures alive. We also check for
* possible shutdown. Do nothing if we're stopping.
*/
- if (ctxt->loc_imp == NULL) {
+ if (ctxt->loc_flags & LLOG_CTXT_FLAG_STOP) {
+ CDEBUG(D_RPCTRACE, "Last sync was done for ctxt %p\n", ctxt);
+ GOTO(out, rc = -ENODEV);
+ }
+
+ if (ctxt->loc_imp == NULL) {
CDEBUG(D_RPCTRACE, "No import for ctxt %p\n", ctxt);
GOTO(out, rc = -ENODEV);
}
CDEBUG(D_RPCTRACE, "No import for ctxt %p\n", ctxt);
GOTO(out, rc = -ENODEV);
}
@@
-677,12
+678,17
@@
int llog_obd_repl_cancel(struct llog_ctxt *ctxt,
out:
if (rc)
llcd_put(ctxt);
out:
if (rc)
llcd_put(ctxt);
+
+ if (flags & OBD_LLOG_FL_EXIT)
+ ctxt->loc_flags = LLOG_CTXT_FLAG_STOP;
+
cfs_mutex_unlock(&ctxt->loc_mutex);
return rc;
}
EXPORT_SYMBOL(llog_obd_repl_cancel);
cfs_mutex_unlock(&ctxt->loc_mutex);
return rc;
}
EXPORT_SYMBOL(llog_obd_repl_cancel);
-int llog_obd_repl_sync(struct llog_ctxt *ctxt, struct obd_export *exp)
+int llog_obd_repl_sync(struct llog_ctxt *ctxt, struct obd_export *exp,
+ int flags)
{
int rc = 0;
ENTRY;
{
int rc = 0;
ENTRY;
@@
-698,6
+704,10
@@
int llog_obd_repl_sync(struct llog_ctxt *ctxt, struct obd_export *exp)
*/
CDEBUG(D_RPCTRACE, "Kill cached llcd\n");
llcd_put(ctxt);
*/
CDEBUG(D_RPCTRACE, "Kill cached llcd\n");
llcd_put(ctxt);
+
+ if (flags & OBD_LLOG_FL_EXIT)
+ ctxt->loc_flags = LLOG_CTXT_FLAG_STOP;
+
cfs_mutex_unlock(&ctxt->loc_mutex);
} else {
/*
cfs_mutex_unlock(&ctxt->loc_mutex);
} else {
/*
@@
-707,7
+717,8
@@
int llog_obd_repl_sync(struct llog_ctxt *ctxt, struct obd_export *exp)
*/
CDEBUG(D_RPCTRACE, "Sync cached llcd\n");
cfs_mutex_unlock(&ctxt->loc_mutex);
*/
CDEBUG(D_RPCTRACE, "Sync cached llcd\n");
cfs_mutex_unlock(&ctxt->loc_mutex);
- rc = llog_cancel(ctxt, NULL, 0, NULL, OBD_LLOG_FL_SENDNOW);
+ rc = llog_cancel(NULL, ctxt, NULL, 0, NULL,
+ OBD_LLOG_FL_SENDNOW | flags);
}
RETURN(rc);
}
}
RETURN(rc);
}
@@
-715,7
+726,7
@@
EXPORT_SYMBOL(llog_obd_repl_sync);
#else /* !__KERNEL__ */
#else /* !__KERNEL__ */
-int llog_obd_repl_cancel(struct llog_ctxt *ctxt,
+int llog_obd_repl_cancel(
const struct lu_env *env,
struct llog_ctxt *ctxt,
struct lov_stripe_md *lsm, int count,
struct llog_cookie *cookies, int flags)
{
struct lov_stripe_md *lsm, int count,
struct llog_cookie *cookies, int flags)
{