Commit 509224bf authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/gregkh/linux/2.6.11/aoe

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 0a983298 e9271e60
...@@ -6,9 +6,16 @@ The EtherDrive (R) HOWTO for users of 2.6 kernels is found at ... ...@@ -6,9 +6,16 @@ The EtherDrive (R) HOWTO for users of 2.6 kernels is found at ...
CREATING DEVICE NODES CREATING DEVICE NODES
Users of udev should find device nodes created automatically. Two Users of udev should find the block device nodes created
scripts are provided in Documentation/aoe as examples of static automatically, but to create all the necessary device nodes, use the
device node creation for using the aoe driver. udev configuration rules provided in udev.txt (in this directory).
There is a udev-install.sh script that shows how to install these
rules on your system.
If you are not using udev, two scripts are provided in
Documentation/aoe as examples of static device node creation for
using the aoe driver.
rm -rf /dev/etherd rm -rf /dev/etherd
sh Documentation/aoe/mkdevs.sh /dev/etherd sh Documentation/aoe/mkdevs.sh /dev/etherd
......
...@@ -4,10 +4,13 @@ ...@@ -4,10 +4,13 @@
set -e set -e
format="%8s\t%8s\t%8s\n" format="%8s\t%8s\t%8s\n"
me=`basename $0` me=`basename $0`
sysd=${sysfs_dir:-/sys}
# printf "$format" device mac netif state # printf "$format" device mac netif state
test -z "`mount | grep sysfs`" && { # Suse 9.1 Pro doesn't put /sys in /etc/mtab
#test -z "`mount | grep sysfs`" && {
test ! -d "$sysd/block" && {
echo "$me Error: sysfs is not mounted" 1>&2 echo "$me Error: sysfs is not mounted" 1>&2
exit 1 exit 1
} }
...@@ -16,7 +19,7 @@ test -z "`lsmod | grep '^aoe'`" && { ...@@ -16,7 +19,7 @@ test -z "`lsmod | grep '^aoe'`" && {
exit 1 exit 1
} }
for d in `ls -d /sys/block/etherd* 2>/dev/null | grep -v p` end; do for d in `ls -d $sysd/block/etherd* 2>/dev/null | grep -v p` end; do
# maybe ls comes up empty, so we use "end" # maybe ls comes up empty, so we use "end"
test $d = end && continue test $d = end && continue
......
# install the aoe-specific udev rules from udev.txt into
# the system's udev configuration
#
me="`basename $0`"
# find udev.conf, often /etc/udev/udev.conf
# (or environment can specify where to find udev.conf)
#
if test -z "$conf"; then
if test -r /etc/udev/udev.conf; then
conf=/etc/udev/udev.conf
else
conf="`find /etc -type f -name udev.conf 2> /dev/null`"
if test -z "$conf" || test ! -r "$conf"; then
echo "$me Error: no udev.conf found" 1>&2
exit 1
fi
fi
fi
# find the directory where udev rules are stored, often
# /etc/udev/rules.d
#
rules_d="`sed -n '/^udev_rules=/{ s!udev_rules=!!; s!\"!!g; p; }' $conf`"
test "$rules_d" && sh -xc "cp `dirname $0`/udev.txt $rules_d/60-aoe.rules"
# These rules tell udev what device nodes to create for aoe support.
# They may be installed along the following lines (adjusted to what
# you see on your system).
#
# ecashin@makki ~$ su
# Password:
# bash# find /etc -type f -name udev.conf
# /etc/udev/udev.conf
# bash# grep udev_rules= /etc/udev/udev.conf
# udev_rules="/etc/udev/rules.d/"
# bash# ls /etc/udev/rules.d/
# 10-wacom.rules 50-udev.rules
# bash# cp /path/to/linux-2.6.xx/Documentation/aoe/udev.txt \
# /etc/udev/rules.d/60-aoe.rules
#
# aoe char devices
SUBSYSTEM="aoe", KERNEL="discover", NAME="etherd/%k", GROUP="disk", MODE="0220"
SUBSYSTEM="aoe", KERNEL="err", NAME="etherd/%k", GROUP="disk", MODE="0440"
SUBSYSTEM="aoe", KERNEL="interfaces", NAME="etherd/%k", GROUP="disk", MODE="0220"
# aoe block devices
KERNEL="etherd*", NAME="%k", GROUP="disk"
...@@ -143,7 +143,6 @@ void aoedisk_rm_sysfs(struct aoedev *d); ...@@ -143,7 +143,6 @@ void aoedisk_rm_sysfs(struct aoedev *d);
int aoechr_init(void); int aoechr_init(void);
void aoechr_exit(void); void aoechr_exit(void);
void aoechr_error(char *); void aoechr_error(char *);
void aoechr_hdump(char *, int len);
void aoecmd_work(struct aoedev *d); void aoecmd_work(struct aoedev *d);
void aoecmd_cfg(ushort, unsigned char); void aoecmd_cfg(ushort, unsigned char);
......
...@@ -99,41 +99,6 @@ bail: spin_unlock_irqrestore(&emsgs_lock, flags); ...@@ -99,41 +99,6 @@ bail: spin_unlock_irqrestore(&emsgs_lock, flags);
up(&emsgs_sema); up(&emsgs_sema);
} }
#define PERLINE 16
void
aoechr_hdump(char *buf, int n)
{
int bufsiz;
char *fbuf;
int linelen;
char *p, *e, *fp;
bufsiz = n * 3; /* 2 hex digits and a space */
bufsiz += n / PERLINE + 1; /* the newline characters */
bufsiz += 1; /* the final '\0' */
fbuf = kmalloc(bufsiz, GFP_ATOMIC);
if (!fbuf) {
printk(KERN_INFO
"%s: cannot allocate memory\n",
__FUNCTION__);
return;
}
for (p = buf; n <= 0;) {
linelen = n > PERLINE ? PERLINE : n;
n -= linelen;
fp = fbuf;
for (e=p+linelen; p<e; p++)
fp += sprintf(fp, "%2.2X ", *p & 255);
sprintf(fp, "\n");
aoechr_error(fbuf);
}
kfree(fbuf);
}
static ssize_t static ssize_t
aoechr_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *offp) aoechr_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *offp)
{ {
...@@ -178,13 +143,13 @@ aoechr_rel(struct inode *inode, struct file *filp) ...@@ -178,13 +143,13 @@ aoechr_rel(struct inode *inode, struct file *filp)
static ssize_t static ssize_t
aoechr_read(struct file *filp, char __user *buf, size_t cnt, loff_t *off) aoechr_read(struct file *filp, char __user *buf, size_t cnt, loff_t *off)
{ {
int n; unsigned long n;
char *mp; char *mp;
struct ErrMsg *em; struct ErrMsg *em;
ssize_t len; ssize_t len;
ulong flags; ulong flags;
n = (int) filp->private_data; n = (unsigned long) filp->private_data;
switch (n) { switch (n) {
case MINOR_ERR: case MINOR_ERR:
spin_lock_irqsave(&emsgs_lock, flags); spin_lock_irqsave(&emsgs_lock, flags);
...@@ -233,7 +198,7 @@ aoechr_read(struct file *filp, char __user *buf, size_t cnt, loff_t *off) ...@@ -233,7 +198,7 @@ aoechr_read(struct file *filp, char __user *buf, size_t cnt, loff_t *off)
} }
} }
struct file_operations aoe_fops = { static struct file_operations aoe_fops = {
.write = aoechr_write, .write = aoechr_write,
.read = aoechr_read, .read = aoechr_read,
.open = aoechr_open, .open = aoechr_open,
......
...@@ -416,7 +416,9 @@ aoecmd_ata_rsp(struct sk_buff *skb) ...@@ -416,7 +416,9 @@ aoecmd_ata_rsp(struct sk_buff *skb)
if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */ if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */
printk(KERN_CRIT "aoe: aoecmd_ata_rsp: ata error cmd=%2.2Xh " printk(KERN_CRIT "aoe: aoecmd_ata_rsp: ata error cmd=%2.2Xh "
"stat=%2.2Xh\n", ahout->cmdstat, ahin->cmdstat); "stat=%2.2Xh from e%ld.%ld\n",
ahout->cmdstat, ahin->cmdstat,
d->aoemajor, d->aoeminor);
if (buf) if (buf)
buf->flags |= BUFFL_FAIL; buf->flags |= BUFFL_FAIL;
} else { } else {
...@@ -458,8 +460,8 @@ aoecmd_ata_rsp(struct sk_buff *skb) ...@@ -458,8 +460,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
if (buf) { if (buf) {
buf->nframesout -= 1; buf->nframesout -= 1;
if (buf->nframesout == 0 && buf->resid == 0) { if (buf->nframesout == 0 && buf->resid == 0) {
n = !(buf->flags & BUFFL_FAIL); n = (buf->flags & BUFFL_FAIL) ? -EIO : 0;
bio_endio(buf->bio, buf->bio->bi_size, 0); bio_endio(buf->bio, buf->bio->bi_size, n);
mempool_free(buf, d->bufpool); mempool_free(buf, d->bufpool);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment