Whamcloud - gitweb
mds_filter_recovery_request(): share code between mds and mdt
authornikita <nikita>
Wed, 19 Jul 2006 12:00:10 +0000 (12:00 +0000)
committernikita <nikita>
Wed, 19 Jul 2006 12:00:10 +0000 (12:00 +0000)
lustre/mds/handler.c
lustre/mdt/mdt_handler.c

index 98a0d94..ee11b07 100644 (file)
@@ -1190,8 +1190,8 @@ int mds_reint(struct ptlrpc_request *req, int offset,
         return rc;
 }
 
-static int mds_filter_recovery_request(struct ptlrpc_request *req,
-                                       struct obd_device *obd, int *process)
+int mds_filter_recovery_request(struct ptlrpc_request *req,
+                                struct obd_device *obd, int *process)
 {
         switch (req->rq_reqmsg->opc) {
         case MDS_CONNECT: /* This will never get here, but for completeness. */
@@ -1217,6 +1217,7 @@ static int mds_filter_recovery_request(struct ptlrpc_request *req,
                 RETURN(ptlrpc_error(req));
         }
 }
+EXPORT_SYMBOL(mds_filter_recovery_request);
 
 static char *reint_names[] = {
         [REINT_SETATTR] "setattr",
index d50d11f..63cb70e 100644 (file)
@@ -1138,36 +1138,9 @@ static void mdt_thread_info_fini(struct mdt_thread_info *info)
                 mdt_lock_handle_fini(&info->mti_lh[i]);
 }
 
-static int mdt_filter_recovery_request(struct ptlrpc_request *req,
-                                       struct obd_device *obd, int *process)
-{
-        ENTRY;
-
-        switch (req->rq_reqmsg->opc) {
-        case MDS_CONNECT: /* This will never get here, but for completeness. */
-        case OST_CONNECT: /* This will never get here, but for completeness. */
-        case MDS_DISCONNECT:
-        case OST_DISCONNECT:
-               *process = 1;
-               RETURN(0);
-
-        case MDS_CLOSE:
-        case MDS_SYNC: /* used in unmounting */
-        case OBD_PING:
-        case MDS_REINT:
-        case LDLM_ENQUEUE:
-                *process = target_queue_recovery_request(req, obd);
-                RETURN(0);
-
-        default:
-                DEBUG_REQ(D_ERROR, req, "not permitted during recovery");
-                *process = 0;
-                /* XXX what should we set rq_status to here? */
-                req->rq_status = -EAGAIN;
-                RETURN(ptlrpc_error(req));
-        }
-}
-
+/* mds/handler.c */
+extern int mds_filter_recovery_request(struct ptlrpc_request *req,
+                                       struct obd_device *obd, int *process);
 /*
  * Handle recovery. Return:
  *        +1: continue request processing;
@@ -1220,7 +1193,7 @@ static int mdt_recovery(struct ptlrpc_request *req)
                 int rc;
                 int should_process;
 
-                rc = mdt_filter_recovery_request(req, obd, &should_process);
+                rc = mds_filter_recovery_request(req, obd, &should_process);
                 if (rc != 0 || !should_process) {
                         LASSERT(rc < 0);
                         RETURN(rc);