Whamcloud - gitweb
b=20997 Enable time limit on the request to be queued
[fs/lustre-release.git] / lustre / obdclass / llog.c
index 31d6ba7..202610d 100644 (file)
@@ -68,7 +68,7 @@ struct llog_handle *llog_alloc_handle(void)
         if (loghandle == NULL)
                 RETURN(ERR_PTR(-ENOMEM));
 
-        init_rwsem(&loghandle->lgh_lock);
+        cfs_init_rwsem(&loghandle->lgh_lock);
 
         RETURN(loghandle);
 }
@@ -83,9 +83,9 @@ void llog_free_handle(struct llog_handle *loghandle)
         if (!loghandle->lgh_hdr)
                 goto out;
         if (loghandle->lgh_hdr->llh_flags & LLOG_F_IS_PLAIN)
-                list_del_init(&loghandle->u.phd.phd_entry);
+                cfs_list_del_init(&loghandle->u.phd.phd_entry);
         if (loghandle->lgh_hdr->llh_flags & LLOG_F_IS_CAT)
-                LASSERT(list_empty(&loghandle->u.chd.chd_head));
+                LASSERT(cfs_list_empty(&loghandle->u.chd.chd_head));
         OBD_FREE(loghandle->lgh_hdr, LLOG_CHUNK_SIZE);
 
  out:
@@ -237,12 +237,13 @@ static int llog_process_thread(void *arg)
         if (!buf) {
                 lpi->lpi_rc = -ENOMEM;
 #ifdef __KERNEL__
-                complete(&lpi->lpi_completion);
+                cfs_complete(&lpi->lpi_completion);
 #endif
                 return 0;
         }
 
-        cfs_daemonize_ctxt("llog_process_thread");
+        if (!(lpi->lpi_flags & LLOG_FLAG_NODEAMON))
+                cfs_daemonize_ctxt("llog_process_thread");
 
         if (cd != NULL) {
                 last_called_index = cd->lpcd_first_idx;
@@ -349,13 +350,13 @@ static int llog_process_thread(void *arg)
                 OBD_FREE(buf, LLOG_CHUNK_SIZE);
         lpi->lpi_rc = rc;
 #ifdef __KERNEL__
-        complete(&lpi->lpi_completion);
+        cfs_complete(&lpi->lpi_completion);
 #endif
         return 0;
 }
 
-int llog_process(struct llog_handle *loghandle, llog_cb_t cb,
-                 void *data, void *catdata)
+int llog_process_flags(struct llog_handle *loghandle, llog_cb_t cb,
+                       void *data, void *catdata, int flags)
 {
         struct llog_process_info *lpi;
         int                      rc;
@@ -370,16 +371,17 @@ int llog_process(struct llog_handle *loghandle, llog_cb_t cb,
         lpi->lpi_cb        = cb;
         lpi->lpi_cbdata    = data;
         lpi->lpi_catdata   = catdata;
+        lpi->lpi_flags     = flags;
 
 #ifdef __KERNEL__
-        init_completion(&lpi->lpi_completion);
+        cfs_init_completion(&lpi->lpi_completion);
         rc = cfs_kernel_thread(llog_process_thread, lpi, CLONE_VM | CLONE_FILES);
         if (rc < 0) {
                 CERROR("cannot start thread: %d\n", rc);
                 OBD_FREE_PTR(lpi);
                 RETURN(rc);
         }
-        wait_for_completion(&lpi->lpi_completion);
+        cfs_wait_for_completion(&lpi->lpi_completion);
 #else
         llog_process_thread(lpi);
 #endif
@@ -387,6 +389,13 @@ int llog_process(struct llog_handle *loghandle, llog_cb_t cb,
         OBD_FREE_PTR(lpi);
         RETURN(rc);
 }
+EXPORT_SYMBOL(llog_process_flags);
+
+int llog_process(struct llog_handle *loghandle, llog_cb_t cb,
+                 void *data, void *catdata)
+{
+        return llog_process_flags(loghandle, cb, data, catdata, 0);
+}
 EXPORT_SYMBOL(llog_process);
 
 inline int llog_get_size(struct llog_handle *loghandle)