Re: [PATCH v2 05/11] firewire-sbp-target: Add sbp_configfs.c

From: Chris Boot
Date: Thu Feb 16 2012 - 04:57:31 EST


On 15/02/2012 19:21, Stefan Richter wrote:
On Feb 15 Chris Boot wrote:
--- /dev/null
+++ b/drivers/target/sbp/sbp_configfs.c
@@ -0,0 +1,751 @@
+/*
+ * SBP2 target driver (SCSI over IEEE1394 in target mode)
+ *
+ * Copyright (C) 2011 Chris Boot<bootc@xxxxxxxxx>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#define KMSG_COMPONENT "sbp_target"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
+#include<linux/module.h>
+#include<linux/moduleparam.h>
+#include<linux/version.h>
+#include<linux/init.h>
+#include<linux/slab.h>
+#include<linux/kthread.h>
+#include<linux/types.h>
+#include<linux/string.h>
+#include<linux/configfs.h>
+#include<linux/ctype.h>
+#include<linux/firewire.h>
+
+#include<asm/unaligned.h>
+
+#include<target/target_core_base.h>
+#include<target/target_core_backend.h>
+#include<target/target_core_fabric.h>
+#include<target/target_core_configfs.h>
+#include<target/target_core_fabric_configfs.h>
+#include<target/configfs_macros.h>
+
+#include "sbp_base.h"
+#include "sbp_fabric.h"
+#include "sbp_management_agent.h"
+
+/* Local pointer to allocated TCM configfs fabric module */
+struct target_fabric_configfs *sbp_fabric_configfs;
+
+struct workqueue_struct *sbp_workqueue;

#include<linux/workqueue.h> goes before this.

Yep.

[...]
+ sbp_workqueue = alloc_workqueue("firewire-sbp-target", WQ_UNBOUND, 0);
+ if (!sbp_workqueue) {
+ target_fabric_configfs_deregister(fabric);
+ return -ENOMEM;
+ }

What are your specific requirements that you cannot use one of the
system-wide workqueues?

Nothing specific, I just thought it was sensible to use your own workqueue if you put enough work into it. I'll switch to the system queues.

--
Chris Boot
bootc@xxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/