Whamcloud - gitweb
LU-2850 kernel: 3.8 upstream kills daemonize()
[fs/lustre-release.git] / lustre / llite / lloop.c
index 5f00ab2..c494dd2 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
 #include <lustre_lite.h>
 #include "llite_internal.h"
 
-#define LLOOP_MAX_SEGMENTS        PTLRPC_MAX_BRW_PAGES
+#define LLOOP_MAX_SEGMENTS        LNET_MAX_IOV
 
 /* Possible states of device */
 enum {
@@ -420,8 +420,6 @@ static int loop_thread(void *data)
         int refcheck;
         int ret = 0;
 
-        daemonize("lloop%d", lo->lo_number);
-
         set_user_nice(current, -20);
 
         lo->lo_state = LLOOP_BOUND;
@@ -552,13 +550,13 @@ static int loop_set_fd(struct lloop_device *lo, struct file *unused,
         set_capacity(disks[lo->lo_number], size);
         bd_set_size(bdev, size << 9);
 
-        set_blocksize(bdev, lo->lo_blocksize);
+       set_blocksize(bdev, lo->lo_blocksize);
 
-        cfs_create_thread(loop_thread, lo, CLONE_KERNEL);
+       kthread_run(loop_thread, lo, "lloop%d", lo->lo_number);
        down(&lo->lo_sem);
-        return 0;
+       return 0;
 
- out:
+out:
         /* This is safe: open() is still holding a reference. */
         cfs_module_put(THIS_MODULE);
         return error;