Skip to contentSkip to conversation

ATA Over Ethernet Root

PATCH In review McMullan, Jason 2 participants 2 messages May 13, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ATA Over Ethernet Root

This patch allows you to use ATA Over Ethernet as your root device, with 'root=/dev/etherd/eX.Y/disc'

Limited testing, just for ya'lls review.

Signature · 2 lines
Jason McMullan <[email protected]>
TimeSys Corporation

Description: ATA Over Ethernet root device
ie 'root=/dev/etherd/e0.0/disc' on the kernel command line

drivers/block/Kconfig +15 -0
@@ -506,4 +506,19 @@
 	This driver provides Support for ATA over Ethernet block
 	devices like the Coraid EtherDrive (R) Storage Blade.
 
+config ATA_OVER_ETH_ROOT
+	bool "ATA over Ethernet root device"
+	depends on ATA_OVER_ETH=y
+	help
+	  If you want to use ATA Over Ethernet as the root device,
+	  set this to 'y'
+
+config ATA_OVER_ETH_ROOT_SHELF
+	int "Shelf ID"
+	depends on ATA_OVER_ETH_ROOT
+	
+config ATA_OVER_ETH_ROOT_SLOT
+	int "Slot ID"
+	depends on ATA_OVER_ETH_ROOT
+
 endmenu
drivers/block/aoe/aoe.h +1 -0
@@ -153,6 +153,7 @@
 int aoedev_init(void);
 void aoedev_exit(void);
 struct aoedev *aoedev_bymac(unsigned char *);
+struct aoedev *aoedev_bymajor_minor(ulong major, ulong minor);
 void aoedev_downdev(struct aoedev *d);
 struct aoedev *aoedev_set(ulong, unsigned char *, struct net_device *, ulong);
 int aoedev_busy(void);
drivers/block/aoe/aoeblk.c +1 -0
@@ -229,6 +229,7 @@
 	gd->capacity = d->ssize;
 	snprintf(gd->disk_name, sizeof gd->disk_name, "etherd/e%ld.%ld",
 		d->aoemajor, d->aoeminor);
+	strncpy(gd->devfs_name, gd->disk_name, sizeof gd->devfs_name);
 
 	gd->queue = &d->blkq;
 	d->gd = gd;
drivers/block/aoe/aoedev.c +17 -0
@@ -28,6 +28,23 @@
 	return d;
 }
 
+struct aoedev *
+aoedev_bymajor_minor(ulong major, ulong minor)
+{
+	struct aoedev *d;
+	ulong flags;
+
+	spin_lock_irqsave(&devlist_lock, flags);
+
+	for (d=devlist; d; d=d->next)
+		if (d->aoemajor == major && d->aoeminor == minor)
+			break;
+
+	spin_unlock_irqrestore(&devlist_lock, flags);
+	return d;
+}
+
+
 /* called with devlist lock held */
 static struct aoedev *
 aoedev_newdev(ulong nframes)
drivers/block/aoe/aoemain.c +51 -0

87 lines not on this page · raw message

#1 lore raw

On Fri, 13 May 2005 13:19:55 -0400 McMullan, Jason wrote:

| This patch allows you to use ATA Over Ethernet as your root device,
| with 'root=/dev/etherd/eX.Y/disc'
| 
| Limited testing, just for ya'lls review.

or y'alls

Please make patches against 2.6.12-rcX, not against 2.6.11.z. (probably doesn't matter in this case)

+struct aoedev *
+aoedev_bymajor_minor(ulong major, ulong minor)
+{

Kernel preferred style is not to split the function definition line.

+#ifdef CONFIG_ATA_OVER_ETH_ROOT
+#include <linux/delay.h>
+#include <linux/rtnetlink.h>
+#include <linux/netdevice.h>
+#include <net/sock.h>
+#endif

Lose the ifdef/endif. Don't make #includes conditional.

+printk("Bring up loopback...\n");
+ if (dev_change_flags(&loopback_dev, loopback_dev.flags | IFF_UP) < 0)
+ printk(KERN_ERR "AOE Root: Failed to open %s\n", loopback_dev.name);
+
+ /* Setup all network devices */
+ for (dev = dev_base; dev ; dev = dev->next) {
+ if (dev == &loopback_dev)
+ continue;
+printk("Bring up %s...\n",dev->name);

Did you mean to leave these printk()s here?
I think not, but if so, they need a KERN_ level, like KERN_INFO.

It would help readability if you would add some spaces around '=', after commas, etc., in places like these:

+ for (d=devlist; d; d=d->next)
and
+ } while (!aoedev_bymajor_minor(CONFIG_ATA_OVER_ETH_ROOT_SHELF,CONFIG_ATA_OVER_ETH_ROOT_SLOT));
and
+ aoe_root(CONFIG_ATA_OVER_ETH_ROOT_SHELF,CONFIG_ATA_OVER_ETH_ROOT_SLOT);

Thanks.

---
~Randy