Whamcloud - gitweb
LU-3420 scrub: trigger OI scrub properly
[fs/lustre-release.git] / lustre / quota / qsd_reint.c
index adac87f..6fec9e6 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, Intel Corporation.
+ * Copyright (c) 2012, 2013, Intel Corporation.
  * Use is subject to license terms.
  *
  * Author: Johann Lombardi <johann.lombardi@intel.com>
@@ -197,7 +197,7 @@ static int qsd_reint_index(const struct lu_env *env, struct qsd_qtype_info *qqi,
        fid = global ? &qqi->qqi_fid : &qqi->qqi_slv_fid;
 
        /* let's do a 1MB bulk */
-       npages = min_t(unsigned int, PTLRPC_MAX_BRW_SIZE, 1 << 20);
+       npages = min_t(unsigned int, OFD_MAX_BRW_SIZE, 1 << 20);
        npages /= CFS_PAGE_SIZE;
 
        /* allocate pages for bulk index read */
@@ -417,8 +417,6 @@ static int qsd_reint_main(void *args)
        int                      rc;
        ENTRY;
 
-       cfs_daemonize("qsd_reint");
-
        CDEBUG(D_QUOTA, "%s: Starting reintegration thread for "DFID"\n",
               qsd->qsd_svname, PFID(&qqi->qqi_fid));
 
@@ -636,6 +634,10 @@ int qsd_start_reint_thread(struct qsd_qtype_info *qqi)
        if (!qsd_type_enabled(qqi->qqi_qsd, qqi->qqi_qtype))
                RETURN(0);
 
+       if (qqi->qqi_qsd->qsd_acct_failed)
+               /* no space accounting support, can't enable enforcement */
+               RETURN(0);
+
        /* check if the reintegration has already started or finished */
        write_lock(&qsd->qsd_lock);
 
@@ -658,8 +660,8 @@ int qsd_start_reint_thread(struct qsd_qtype_info *qqi)
                RETURN(0);
        }
 
-       rc = cfs_create_thread(qsd_reint_main, (void *)qqi, 0);
-       if (rc < 0) {
+       rc = PTR_ERR(kthread_run(qsd_reint_main, (void *)qqi, "qsd_reint"));
+       if (IS_ERR_VALUE(rc)) {
                thread_set_flags(thread, SVC_STOPPED);
                write_lock(&qsd->qsd_lock);
                qqi->qqi_reint = 0;