├── mak ├── dummy.c ├── Makefile ├── src-id.sh ├── kernel-id.sh ├── cc-id.sh ├── update-if-new.sh └── checksum.sh ├── conf ├── 4-av.sh ├── 4-kv.sh ├── 3-av.sh ├── 3-kv.sh ├── 17.txt ├── 3.txt ├── 6.txt ├── 5.txt ├── 10.txt ├── 39.txt ├── 41.txt ├── 1-kv.sh ├── 15.txt ├── 30.c ├── 25-relay5.c ├── 11.txt ├── 25-fs5.c ├── 6-av.sh ├── 25-relay6.c ├── 35-av.sh ├── 11-av.sh ├── 30-av.sh ├── 31-av.sh ├── 5-av.sh ├── 10-av.sh ├── 12-av.sh ├── 13-av.sh ├── 20-av.sh ├── 1-av.sh ├── 33-av.sh ├── 36-av.sh ├── 39-av.sh ├── 14-av.sh ├── 16-av.sh ├── 43-av.sh ├── 44.c ├── 7-av.sh ├── 17-av.sh ├── 42-av.sh ├── 9-av.sh ├── kv.sh ├── 15-av.sh ├── 18-kv.sh ├── 35.c ├── 17-kv.sh ├── detect-udev ├── 18-av.sh ├── 20-kv.sh ├── 28-av.sh ├── 44-av.sh ├── 8-av.sh ├── 2-av.sh ├── 26-av.sh ├── 37-av.sh ├── 9-kv.sh ├── 29.txt ├── 35-kv.sh ├── 36-kv.sh ├── 10-kv.sh ├── 12-kv.sh ├── 22-av.sh ├── 29-av.sh ├── 36.c ├── 38-av.sh ├── 40-av.sh ├── 41-av.sh ├── 6-kv.sh ├── 8.c ├── 15-kv.sh ├── 16-kv.sh ├── 26-kv.sh ├── 7-kv.sh ├── 28-kv.sh ├── 33-kv.sh ├── 11.c ├── 22-kv.sh ├── 13-kv.sh ├── 14-kv.sh ├── 2.c ├── 27-av.sh ├── 5-kv.sh ├── 8-kv.sh ├── 30-kv.sh ├── 7.c ├── 37.c ├── 42-kv.sh ├── 44-kv.sh ├── 43-kv.sh ├── 39-kv.sh ├── 40-kv.sh ├── 13.txt ├── bump.sh ├── 41-kv.sh ├── 43.txt ├── 19-av.sh ├── 29-kv.sh ├── 4.txt ├── 31-kv.sh ├── 9.c ├── 2-kv.sh ├── 16.txt ├── 19-dev_net.c ├── 19-nd_net.c ├── 33.c ├── 10.c ├── 17.c ├── 32-av.sh ├── 12.c ├── 6.c ├── 39.c ├── 23-av.sh ├── 31.c ├── 40.c ├── 1.c ├── 27-kv.sh ├── 5.c ├── 18.c ├── 8.txt ├── 25-kv.sh ├── 32-kv.sh ├── 28.txt ├── 34.c ├── 19-kv.sh ├── 15.c ├── 17-patches │ └── old-new.diff ├── 23-brq1.c ├── 23-brq2.c ├── 23-bsq.c ├── 9.txt ├── 37-kv.sh ├── 37.txt ├── 20-patches │ └── old-new.diff ├── 26.c ├── 13.c ├── 21-av.sh ├── 38-kv.sh ├── 14.c ├── 24-cdc4.c ├── 24-dc.c ├── 43.c ├── 24-cdc5.c ├── 24-dcd.c ├── 18.txt ├── 2.txt ├── 7-patches │ └── old-new.diff ├── 33.txt ├── 18-patches │ └── old-new.diff ├── 38.c ├── 34-av.sh ├── 41.c ├── 43-patches │ └── old-new.diff ├── 28.c ├── 23-patches │ ├── brq1-brq2.diff │ ├── brq1-bsq.diff │ ├── brq2-bsq.diff │ ├── brq1-old.diff │ ├── brq2-old.diff │ └── bsq-old.diff ├── 29.c ├── 39-patches │ └── old-new.diff ├── 22.c ├── 32.c ├── 11-kv.sh ├── 1.txt ├── 40.txt ├── 19-patches │ ├── nd_net-dev_net.diff │ ├── nons-nd_net.diff │ └── nons-dev_net.diff ├── 11-patches │ └── old-new.diff ├── 20.c ├── 7.txt ├── 16-patches │ └── old-new.diff ├── 33-patches │ └── old-new.diff ├── 16.c ├── 27.txt ├── 25-patches │ ├── relay5-relay6.diff │ ├── fs5-relay5.diff │ ├── fs5-relay6.diff │ ├── none-relay6.diff │ ├── none-relay5.diff │ └── fs5-none.diff ├── 42.c ├── 32-patches │ └── sles10-normal.diff ├── 14-patches │ └── old-new.diff ├── 24-patches │ ├── cdc4-cdc5.diff │ ├── dc-dcd.diff │ ├── cdc4-dcd.diff │ ├── cdc5-dcd.diff │ ├── cdc4-dc.diff │ └── cdc5-dc.diff ├── 37-patches │ └── old-new.diff ├── 42.txt ├── 34-kv.sh ├── 6-patches │ └── old-new.diff ├── 32.txt ├── 1-patches │ └── old-new.diff ├── 25-av.sh ├── 5-patches │ └── old-new.diff ├── 21-gd.c ├── 35.txt ├── 21-kv.sh ├── 19.txt ├── 40-patches │ └── old-new.diff ├── 21-dev.c ├── 38-patches │ └── old-new.diff ├── 26.txt ├── 12.txt ├── 14.txt ├── 21-patches │ └── dev-dtd.diff ├── 20.txt ├── 24-av.sh ├── 30.txt ├── 29-patches │ └── old-new.diff ├── 21.txt ├── 26-patches │ └── old-new.diff ├── 38.txt ├── 23-kv.sh ├── 34-patches │ └── old-new.diff ├── 42-patches │ └── old-new.diff ├── 13-patches │ └── old-new.diff ├── 25.txt ├── 24-kv.sh ├── 22.txt ├── 9-patches │ └── old-new.diff ├── 36-patches │ └── old-new.diff ├── 15-patches │ └── old-new.diff ├── 28-patches │ └── old-new.diff ├── 35-patches │ └── old-new.diff ├── pairs.sh ├── 44.txt ├── 22-patches │ └── old-new.diff ├── 12-patches │ └── old-new.diff ├── 2-patches │ └── old-new.diff ├── 24.txt ├── 36.txt ├── 31-patches │ └── old-new.diff ├── compat.sh ├── 10-patches │ └── old-new.diff ├── 31.txt ├── 8-patches │ └── old-new.diff ├── 30-patches │ └── old-new.diff └── 34.txt ├── aoetools-36 ├── config.h ├── fns.h ├── aoe-discover.in ├── sos-linux.8 ├── pkg │ └── rhel6 │ │ ├── SOURCES │ │ └── 60-aoe.rules │ │ └── SPECS │ │ └── aoetools.spec ├── aoe-revalidate.in ├── aoe-version.8 ├── aoe-revalidate.8 ├── HACKING ├── coraid-update.8 ├── aoe-flush.in ├── sos-linux ├── aoe-interfaces.in ├── aoe-mkshelf.in ├── aoetools.8 ├── aoe-flush.8 ├── aoe-mkdevs ├── devnodes.txt ├── aoe-version ├── aoe-discover.8 ├── dat.h ├── linux.c ├── aoe-stat.in ├── README ├── aoe-mkshelf.8 ├── aoe-mkdevs.8 ├── coraid-update ├── aoecfg.8 ├── aoe-interfaces.8 ├── Makefile └── aoe-sancheck.8 ├── pkg └── rhel6 │ ├── SOURCES │ ├── aoe.conf │ ├── aoe.files │ └── aoe-83-nodepmod.diff │ └── SPECS │ └── aoe.spec ├── linux ├── drivers │ └── block │ │ └── aoe │ │ ├── disk_attr.h │ │ └── Makefile └── Documentation │ └── aoe │ ├── autoload.sh │ ├── 00-INDEX │ ├── status.sh │ ├── todo.txt │ ├── udev.txt │ └── udev-install.sh ├── .gitignore └── README.md /mak/dummy.c: -------------------------------------------------------------------------------- 1 | int; 2 | -------------------------------------------------------------------------------- /conf/4-av.sh: -------------------------------------------------------------------------------- 1 | echo new 2 | -------------------------------------------------------------------------------- /conf/4-kv.sh: -------------------------------------------------------------------------------- 1 | echo new 2 | -------------------------------------------------------------------------------- /conf/3-av.sh: -------------------------------------------------------------------------------- 1 | # see 24 2 | echo new 3 | -------------------------------------------------------------------------------- /conf/3-kv.sh: -------------------------------------------------------------------------------- 1 | # see 24 2 | echo new 3 | -------------------------------------------------------------------------------- /conf/17.txt: -------------------------------------------------------------------------------- 1 | DEFINE_SPINLOCK appeared in 2.6.11. 2 | -------------------------------------------------------------------------------- /conf/3.txt: -------------------------------------------------------------------------------- 1 | This test has been rolled into 24. 2 | -------------------------------------------------------------------------------- /aoetools-36/config.h: -------------------------------------------------------------------------------- 1 | #define _FILE_OFFSET_BITS 64 2 | -------------------------------------------------------------------------------- /mak/Makefile: -------------------------------------------------------------------------------- 1 | obj-$(CONFIG_ATA_OVER_ETH) += dummy.o 2 | -------------------------------------------------------------------------------- /conf/6.txt: -------------------------------------------------------------------------------- 1 | 2.6.15-git9 has mutexes instead of semaphores. 2 | -------------------------------------------------------------------------------- /pkg/rhel6/SOURCES/aoe.conf: -------------------------------------------------------------------------------- 1 | override aoe * weak-updates/aoe 2 | -------------------------------------------------------------------------------- /conf/5.txt: -------------------------------------------------------------------------------- 1 | Network receive functions gained an extra parameter in 2.6.15. 2 | -------------------------------------------------------------------------------- /conf/10.txt: -------------------------------------------------------------------------------- 1 | Change approach to delayed work due to kernel 2 | change in 2.6.20. 3 | 4 | -------------------------------------------------------------------------------- /conf/39.txt: -------------------------------------------------------------------------------- 1 | Old kernels like 2.6.18 need for seq_file.h to be included explicitly. 2 | -------------------------------------------------------------------------------- /linux/drivers/block/aoe/disk_attr.h: -------------------------------------------------------------------------------- 1 | /* struct disk_attribute is defined in kernel headers */ 2 | -------------------------------------------------------------------------------- /conf/41.txt: -------------------------------------------------------------------------------- 1 | Kent Overstreet changed biovecs so that they are immutable. 2 | 3 | The change appears in 3.13. 4 | -------------------------------------------------------------------------------- /pkg/rhel6/SOURCES/aoe.files: -------------------------------------------------------------------------------- 1 | %defattr(644,root,root,755) 2 | /lib/modules/%2-%1 3 | /etc/depmod.d/aoe.conf 4 | -------------------------------------------------------------------------------- /conf/1-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | if $make_cmd > conf/$TESTNO.log 2>&1; then 3 | echo new 4 | else 5 | echo old 6 | fi 7 | -------------------------------------------------------------------------------- /conf/15.txt: -------------------------------------------------------------------------------- 1 | In 2.6.22, the sk_buff members were changed around, so we use a 2 | function that provides access to the packet. 3 | -------------------------------------------------------------------------------- /conf/30.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | testfn(int a, int b) 6 | { 7 | return a + b; 8 | } 9 | -------------------------------------------------------------------------------- /conf/25-relay5.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void 4 | test_fn(char *name) 5 | { 6 | relay_open(name, NULL, 1024*128, 4, NULL); 7 | } 8 | -------------------------------------------------------------------------------- /conf/11.txt: -------------------------------------------------------------------------------- 1 | Replace kmem_cache_t with 'struct kmem_cache' for kernels supporting the latter. 2 | 3 | kmem_cache_t is deprecated in 2.6.20. 4 | 5 | -------------------------------------------------------------------------------- /conf/25-fs5.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void 4 | test_fn(char *name) 5 | { 6 | relay_open(name, NULL, 1024*128, 4, NULL); 7 | } 8 | -------------------------------------------------------------------------------- /conf/6-av.sh: -------------------------------------------------------------------------------- 1 | new="`grep '[-]>i_mutex' linux/drivers/block/aoe/aoecmd.c`" 2 | if test "$new"; then 3 | echo new 4 | else 5 | echo old 6 | fi 7 | -------------------------------------------------------------------------------- /conf/25-relay6.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void 4 | test_fn(char *name) 5 | { 6 | relay_open(name, NULL, 1024*128, 4, NULL, NULL); 7 | } 8 | -------------------------------------------------------------------------------- /conf/35-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoechr.c 2 | 3 | old="`fgrep 'lock_kernel()' $f`" 4 | test "$old" && { echo old; exit 0; } 5 | 6 | echo new 7 | -------------------------------------------------------------------------------- /conf/11-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | old="`fgrep 'kmem_cache_t' $f`" 3 | if test "$old"; then 4 | echo old 5 | else 6 | echo new 7 | fi 8 | -------------------------------------------------------------------------------- /conf/30-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoecmd.c 2 | new="`fgrep '#include ' $f`" 3 | test "$new" && { echo new; exit 0; } 4 | 5 | echo old 6 | -------------------------------------------------------------------------------- /conf/31-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | 3 | bpr="`fgrep 'blk_peek_request(' $f`" 4 | test "$bpr" && { echo new; exit 0; } 5 | 6 | echo old 7 | -------------------------------------------------------------------------------- /conf/5-av.sh: -------------------------------------------------------------------------------- 1 | new="`grep '^aoenet_rcv.*orig_dev' linux/drivers/block/aoe/aoenet.c`" 2 | if test "$new"; then 3 | echo new 4 | else 5 | echo old 6 | fi 7 | -------------------------------------------------------------------------------- /aoetools-36/fns.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2009, CORAID, Inc., and licensed under GPL v.2. */ 2 | int dial(char *eth); 3 | int getea(int s, char *name, uchar *ea); 4 | 5 | -------------------------------------------------------------------------------- /conf/10-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoedev.c 2 | old="`grep 'INIT_WORK(.*,.*,.*)' $f`" 3 | if test "$old"; then 4 | echo old 5 | else 6 | echo new 7 | fi 8 | -------------------------------------------------------------------------------- /conf/12-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | new="`fgrep 'sysfs_create_group' $f`" 3 | if test "$new"; then 4 | echo new 5 | else 6 | echo old 7 | fi 8 | -------------------------------------------------------------------------------- /conf/13-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoecmd.c 2 | new="`fgrep '__blk_end_request(' $f`" 3 | if test "$new"; then 4 | echo new 5 | else 6 | echo old 7 | fi 8 | -------------------------------------------------------------------------------- /conf/20-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoecmd.c 2 | new="`fgrep '__rq_for_each_bio(' $f`" 3 | if test "$new"; then 4 | echo new 5 | else 6 | echo old 7 | fi 8 | -------------------------------------------------------------------------------- /conf/1-av.sh: -------------------------------------------------------------------------------- 1 | old="`grep 'struct attribute attr;' linux/drivers/block/aoe/disk_attr.h`" 2 | 3 | if test "$old"; then 4 | echo old 5 | else 6 | echo new 7 | fi 8 | -------------------------------------------------------------------------------- /conf/33-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | old="`grep 'blk_queue_max_sectors(' $f`" 3 | if test "$old"; then 4 | echo old 5 | else 6 | echo new 7 | fi 8 | -------------------------------------------------------------------------------- /conf/36-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoechr.c 2 | 3 | new="`fgrep '#include ' $f`" 4 | test "$new" && { echo new; exit 0; } 5 | 6 | echo old 7 | -------------------------------------------------------------------------------- /conf/39-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | 3 | old="`grep '^#include $' $f`" 4 | test "$old" && { echo old; exit 0; } 5 | 6 | echo new 7 | -------------------------------------------------------------------------------- /conf/14-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoecmd.c 2 | new="`fgrep 'end_that_request_last(rq);' $f`" 3 | if test "$new"; then 4 | echo old 5 | else 6 | echo new 7 | fi 8 | -------------------------------------------------------------------------------- /conf/16-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoecmd.c 2 | old="`grep 'define for_each_netdev(__ifp)' $f`" 3 | if test "$old"; then 4 | echo old 5 | else 6 | echo new 7 | fi 8 | -------------------------------------------------------------------------------- /conf/43-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoedbg.c 2 | 3 | old="`sed -n '/^cfile/{n;n;/^int mode,/p;}' $f`" 4 | test "$old" && { echo old; exit 0; } 5 | 6 | echo new 7 | -------------------------------------------------------------------------------- /conf/44.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void try_using_bio_endio(struct bio *bio) 4 | { 5 | // only older kernels have a second parameter 6 | bio_endio(bio); 7 | } 8 | -------------------------------------------------------------------------------- /conf/7-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoecmd.c 2 | old="`grep 'skb_linearize(skb, GFP_ATOMIC' $f`" 3 | if test "$old"; then 4 | echo old 5 | else 6 | echo new 7 | fi 8 | -------------------------------------------------------------------------------- /conf/17-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoedev.c 2 | old="`grep '#define[ ][ ]*DEFINE_SPINLOCK' $f`" 3 | if test "$old"; then 4 | echo old 5 | else 6 | echo new 7 | fi 8 | -------------------------------------------------------------------------------- /conf/42-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | 3 | old="`sed -n '/^static int/{n;/^aoeblk_release/p;}' $f`" 4 | test "$old" && { echo old; exit 0; } 5 | 6 | echo new 7 | -------------------------------------------------------------------------------- /conf/9-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | old="`fgrep 'atomic_dec(&bv->bv_page->count);' $f`" 3 | if test "$old"; then 4 | echo old 5 | else 6 | echo new 7 | fi 8 | -------------------------------------------------------------------------------- /conf/kv.sh: -------------------------------------------------------------------------------- 1 | # common code for *-kv.sh 2 | 3 | TESTNO=`echo $0 | sed 's!^conf/!!' | sed 's!-kv[.]sh$!!'` 4 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 5 | -------------------------------------------------------------------------------- /conf/15-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoecmd.c 2 | old="`grep 'skb_mac_header(struct sk_buff \*skb)$' $f`" 3 | if test "$old"; then 4 | echo old 5 | else 6 | echo new 7 | fi 8 | -------------------------------------------------------------------------------- /conf/18-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if egrep -i 'too many' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo new 6 | else 7 | echo old 8 | fi 9 | -------------------------------------------------------------------------------- /conf/35.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | -------------------------------------------------------------------------------- /mak/src-id.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | d="${1?}" 4 | for f in "$d"/*.[ch]; do 5 | echo "$f:" `sh mak/checksum.sh "$f"` 6 | done > mak/src-id.out 7 | sh mak/update-if-new.sh src-id 8 | 9 | -------------------------------------------------------------------------------- /conf/17-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if egrep -i 'DEFINE_SPINLOCK' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo old 6 | else 7 | echo new 8 | fi 9 | -------------------------------------------------------------------------------- /conf/detect-udev: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | if test "`ps axwwww | grep 'udev[d]'`" || test -d "/dev/.udev"; then 4 | # aoe_dyndevs=1 when udev is present 5 | echo 1 6 | else 7 | echo 0 8 | fi 9 | -------------------------------------------------------------------------------- /mak/kernel-id.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | d="${1?}" 4 | { 5 | echo $d 6 | echo .config: `sh mak/checksum.sh $d/.config` 7 | } > mak/kernel-id.out 8 | sh mak/update-if-new.sh kernel-id 9 | -------------------------------------------------------------------------------- /conf/18-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | new="`sed -n '/kmem_cache_create/,$p' $f | head | fgrep '0, 0, NULL);'`" 3 | if test "$new"; then 4 | echo new 5 | else 6 | echo old 7 | fi 8 | -------------------------------------------------------------------------------- /conf/20-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if egrep 'declar.*rq_for_each_bio' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo new 6 | else 7 | echo old 8 | fi 9 | -------------------------------------------------------------------------------- /conf/28-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | new="`fgrep 'aoeblk_open(struct block_device *bdev, fmode_t mode)' $f`" 3 | if test "$new"; then 4 | echo new 5 | else 6 | echo old 7 | fi 8 | -------------------------------------------------------------------------------- /conf/44-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoecmd.c 2 | 3 | old="`fgrep 'bok = !fastfail && test_bit(BIO_UPTODATE, &bio->bi_flags);' $f`" 4 | test "$old" && { echo old; exit 0; } 5 | 6 | echo new 7 | -------------------------------------------------------------------------------- /conf/8-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoechr.c 2 | old="`fgrep 'unsigned long msleep_interruptible(unsigned int msecs)' $f`" 3 | if test "$old"; then 4 | echo old 5 | else 6 | echo new 7 | fi 8 | -------------------------------------------------------------------------------- /conf/2-av.sh: -------------------------------------------------------------------------------- 1 | # This script is run from its parent directory. 2 | 3 | old="`grep 'class_simple' linux/drivers/block/aoe/aoechr.c`" 4 | if test "$old"; then 5 | echo old 6 | else 7 | echo new 8 | fi 9 | -------------------------------------------------------------------------------- /conf/26-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoecmd.c 2 | old="`fgrep 'static inline void list_replace(struct list_head *old,' $f`" 3 | if test "$old"; then 4 | echo old 5 | else 6 | echo new 7 | fi 8 | -------------------------------------------------------------------------------- /conf/37-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoechr.c 2 | 3 | old="`fgrep 'static void *kmemdup(const void *src, size_t len, gfp_t gfp)' $f`" 4 | test "$old" && { echo old; exit 0; } 5 | 6 | echo new 7 | -------------------------------------------------------------------------------- /conf/9-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if grep 'has no member named .*_count' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo old 6 | else 7 | echo new 8 | fi 9 | -------------------------------------------------------------------------------- /conf/29.txt: -------------------------------------------------------------------------------- 1 | commit d4430d62fa77208824a37fe6f85ab2831d274769 2 | Author: Al Viro 3 | Date: Sun Mar 2 09:09:22 2008 -0500 4 | 5 | [PATCH] beginning of methods conversion 6 | -------------------------------------------------------------------------------- /conf/35-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 3 | $make_cmd > conf/$TESTNO.log 2>&1 4 | 5 | test "$?" = "0" && { echo old; exit 0; } 6 | 7 | echo new 8 | -------------------------------------------------------------------------------- /conf/36-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 3 | $make_cmd > conf/$TESTNO.log 2>&1 4 | 5 | test "$?" = "0" && { echo new; exit 0; } 6 | 7 | echo old 8 | -------------------------------------------------------------------------------- /conf/10-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if grep 'passed 3 arguments, but takes just 2' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo new 6 | else 7 | echo old 8 | fi 9 | -------------------------------------------------------------------------------- /conf/12-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if egrep -i '(warning|error).*sysfs_create_group' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo old 6 | else 7 | echo new 8 | fi 9 | -------------------------------------------------------------------------------- /conf/22-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | new="`fgrep 'aoeblk_getgeo(struct block_device *bdev, struct hd_geometry *geo)' $f`" 3 | if test "$new"; then 4 | echo new 5 | else 6 | echo old 7 | fi 8 | -------------------------------------------------------------------------------- /conf/29-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | new="`fgrep 'aoeblk_ioctl(struct block_device *bdev, fmode_t mode, uint cmd, ulong arg)' $f`" 3 | test "$new" && { echo new; exit 0; } 4 | 5 | echo old 6 | -------------------------------------------------------------------------------- /conf/36.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | -------------------------------------------------------------------------------- /conf/38-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoe.h 2 | 3 | old="`fgrep 'static inline struct page *compound_trans_head(struct page *p) {return p;}' $f`" 4 | test "$old" && { echo old; exit 0; } 5 | 6 | echo new 7 | -------------------------------------------------------------------------------- /conf/40-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | 3 | old="`fgrep 'static inline long __must_check IS_ERR_OR_NULL(__force const void *ptr)' $f`" 4 | test "$old" && { echo old; exit 0; } 5 | 6 | echo new 7 | -------------------------------------------------------------------------------- /conf/41-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoecmd.c 2 | 3 | old="`fgrep 'skb_fillup(struct sk_buff *skb, struct bio_vec *bv, ulong off, ulong cnt)' $f`" 4 | test "$old" && { echo old; exit 0; } 5 | 6 | echo new 7 | -------------------------------------------------------------------------------- /conf/6-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if grep '.*struct.* has no member named .i_mutex' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo old 6 | else 7 | echo new 8 | fi 9 | -------------------------------------------------------------------------------- /conf/8.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | void test_function(void) 7 | { 8 | msleep_interruptible(200); 9 | } 10 | -------------------------------------------------------------------------------- /conf/15-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if egrep -i 'implicit declaration.*skb_mac_header' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo old 6 | else 7 | echo new 8 | fi 9 | -------------------------------------------------------------------------------- /conf/16-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if egrep -i 'implicit declaration.*for_each_netdev' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo old 6 | else 7 | echo new 8 | fi 9 | -------------------------------------------------------------------------------- /conf/26-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if egrep \ 4 | "implicit.*list_replace" \ 5 | conf/$TESTNO.log > /dev/null 2>&1; then 6 | echo old 7 | else 8 | echo new 9 | fi 10 | -------------------------------------------------------------------------------- /conf/7-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if grep 'too many arguments to function.*skb_linearize' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo new 6 | else 7 | echo old 8 | fi 9 | -------------------------------------------------------------------------------- /conf/28-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if test "$?" = "0" && 4 | test ! "`grep 'incompatible pointer' conf/$TESTNO.log`"; then 5 | echo new 6 | exit 0 7 | fi 8 | 9 | echo old 10 | -------------------------------------------------------------------------------- /conf/33-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if egrep -i '(implicit declaration).*blk_queue_max_sectors' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo new 6 | else 7 | echo old 8 | fi 9 | -------------------------------------------------------------------------------- /linux/drivers/block/aoe/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for ATA over Ethernet 3 | # 4 | 5 | obj-$(CONFIG_ATA_OVER_ETH) += aoe.o 6 | aoe-objs := aoeblk.o aoechr.o aoecmd.o aoedev.o aoemain.o aoenet.o 7 | aoe-objs += aoedbg.o 8 | -------------------------------------------------------------------------------- /conf/11.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | kmem_cache_t *foo; 9 | 10 | -------------------------------------------------------------------------------- /conf/22-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if egrep \ 4 | "struct.*no member named .*getgeo" \ 5 | conf/$TESTNO.log > /dev/null 2>&1; then 6 | echo old 7 | else 8 | echo new 9 | fi 10 | -------------------------------------------------------------------------------- /conf/13-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if egrep -i 'implicit declaration of function .*__blk_end_request' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo old 6 | else 7 | echo new 8 | fi 9 | -------------------------------------------------------------------------------- /conf/14-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if egrep -i 'too many arguments to function .*end_that_request_last' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo old 6 | else 7 | echo new 8 | fi 9 | -------------------------------------------------------------------------------- /conf/2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void * 6 | test_fn(void) 7 | { 8 | void *p = class_simple_create(THIS_MODULE, "testing"); 9 | 10 | return p; 11 | } 12 | -------------------------------------------------------------------------------- /conf/27-av.sh: -------------------------------------------------------------------------------- 1 | echo new; exit # disable this test 2 | 3 | f=linux/drivers/block/aoe/aoecmd.c 4 | old="`fgrep 'static const char *empty_page;' $f`" 5 | if test "$old"; then 6 | echo old 7 | else 8 | echo new 9 | fi 10 | -------------------------------------------------------------------------------- /conf/5-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if grep 'initialization from incompatible pointer type' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo new 6 | else 7 | echo old 8 | fi 9 | 10 | -------------------------------------------------------------------------------- /conf/8-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | if grep ': implicit declaration of function .*msleep_interruptible' conf/$TESTNO.log \ 4 | > /dev/null 2>&1; then 5 | echo old 6 | else 7 | echo new 8 | fi 9 | -------------------------------------------------------------------------------- /conf/30-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 3 | $make_cmd > conf/$TESTNO.log 2>&1 4 | if test "$?" = "0"; then 5 | echo new 6 | exit 0 7 | fi 8 | 9 | echo old 10 | 11 | -------------------------------------------------------------------------------- /conf/7.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int testfn(struct sk_buffer *skb) 7 | { 8 | return skb_linearize(skb, GFP_ATOMIC); 9 | } 10 | -------------------------------------------------------------------------------- /conf/37.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | void *testfn(void *p, int n) 8 | { 9 | return kmemdup(p, n, GFP_KERNEL); 10 | } 11 | -------------------------------------------------------------------------------- /conf/42-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 3 | $make_cmd > conf/$TESTNO.log 2>&1 4 | 5 | status="$?" 6 | test "`egrep -i 'release' conf/$TESTNO.log`" && { echo new; exit 0; } 7 | 8 | echo old 9 | -------------------------------------------------------------------------------- /conf/44-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 3 | $make_cmd > conf/$TESTNO.log 2>&1 4 | 5 | status="$?" 6 | test "`egrep -i 'bio_endio' conf/$TESTNO.log`" && { echo old; exit 0; } 7 | 8 | echo new 9 | -------------------------------------------------------------------------------- /mak/cc-id.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | make_cmd="$*" 4 | $make_cmd V=1 > mak/dummy.log 2>&1 5 | `grep '[-]nostdinc' mak/dummy.log | awk '{print $1}' | sed 1q` --version \ 6 | > mak/cc-id.out 7 | rm -f mak/dummy.o mak/dummy.ko 8 | sh mak/update-if-new.sh cc-id 9 | -------------------------------------------------------------------------------- /conf/43-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 3 | $make_cmd > conf/$TESTNO.log 2>&1 4 | 5 | status="$?" 6 | test "`egrep -i 'create_buf_file' conf/$TESTNO.log`" && { echo old; exit 0; } 7 | 8 | echo new 9 | -------------------------------------------------------------------------------- /conf/39-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 3 | $make_cmd > conf/$TESTNO.log 2>&1 4 | 5 | status="$?" 6 | test "`egrep -i '(err|warn).*seq_printf' conf/$TESTNO.log`" && { echo old; exit 0; } 7 | 8 | echo new 9 | -------------------------------------------------------------------------------- /mak/update-if-new.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | s="${1?}" 4 | 5 | if test -r mak/${s}.last; then 6 | cmp mak/${s}.out mak/${s}.last > mak/${s}.cmpout 2>&1 || 7 | echo > mak/${s}.ts 8 | else 9 | echo > mak/${s}.ts 10 | fi 11 | cp mak/${s}.out mak/${s}.last 12 | -------------------------------------------------------------------------------- /conf/40-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 3 | $make_cmd > conf/$TESTNO.log 2>&1 4 | 5 | status="$?" 6 | test "`egrep -i '(err|warn).*IS_ERR_OR_NULL' conf/$TESTNO.log`" && { echo old; exit 0; } 7 | 8 | echo new 9 | -------------------------------------------------------------------------------- /conf/13.txt: -------------------------------------------------------------------------------- 1 | The 2.6.25 kernel does not make end_that_request_{first,last} 2 | available to drivers. See, 3 | 4 | commit 336cdb4003200a90f4fc52a4e9ccc2baa570fffb 5 | 6 | http://lwn.net/Articles/266914/ 7 | 8 | ... for details. We have to use __blk_end_request instead. 9 | -------------------------------------------------------------------------------- /conf/bump.sh: -------------------------------------------------------------------------------- 1 | start=${1?} 2 | end=`cd conf && ls *.diff | sort -n | tail -n 1` 3 | end=`basename $end .diff` 4 | for i in `seq $start $end | tac`; do 5 | n=`expr $i + 1` 6 | for s in -av.sh -kv.sh .c .diff .txt; do 7 | echo git mv conf/$i$s conf/$n$s 8 | done 9 | done 10 | -------------------------------------------------------------------------------- /conf/41-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 3 | $make_cmd > conf/$TESTNO.log 2>&1 4 | 5 | status="$?" 6 | test "`egrep -i '(err|warn).*undefined type .struct bvec_iter' conf/$TESTNO.log`" && { echo old; exit 0; } 7 | 8 | echo new 9 | -------------------------------------------------------------------------------- /conf/43.txt: -------------------------------------------------------------------------------- 1 | commit f4ae40a6a50a98ac23d4b285f739455e926a473e 2 | Author: Al Viro 3 | Date: Sun Jul 24 04:33:43 2011 -0400 4 | 5 | switch debugfs to umode_t 6 | 7 | Signed-off-by: Al Viro 8 | 9 | Appears in 3.3. 10 | -------------------------------------------------------------------------------- /conf/19-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoenet.c 2 | 3 | nd_net="`fgrep 'if (ifp->nd_net != &init_net)' $f`" 4 | test "$nd_net" && { echo nd_net; exit 0; } 5 | 6 | dev_net="`fgrep 'if (dev_net(ifp) != &init_net)' $f`" 7 | test "$dev_net" && { echo dev_net; exit 0; } 8 | 9 | echo nons 10 | -------------------------------------------------------------------------------- /conf/29-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 3 | $make_cmd > conf/$TESTNO.log 2>&1 4 | if test "$?" = "0" && 5 | test ! "`grep 'incompatible pointer' conf/$TESTNO.log`"; then 6 | echo old 7 | exit 0 8 | fi 9 | 10 | echo new 11 | 12 | -------------------------------------------------------------------------------- /conf/4.txt: -------------------------------------------------------------------------------- 1 | For 2.6.15, Jens Axboe changed the way disk stats are kept. 2 | 3 | Since we switched over to handling I/O requests, though, we don't have 4 | to update the disk stats, because that's done in the block layer in 5 | end_that_request_last. 6 | 7 | So this conf test is becoming a noop. 8 | -------------------------------------------------------------------------------- /conf/31-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | 3 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 4 | log=conf/$TESTNO.log 5 | $make_cmd > $log 2>&1 6 | test "$?" = "0" && 7 | test -z "`egrep -i '(warning|error).*blk_start_request' $log`" && 8 | { echo new; exit 0; } 9 | 10 | echo old 11 | -------------------------------------------------------------------------------- /conf/9.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | void test_function(struct page *p) 9 | { 10 | atomic_inc(p->_count); 11 | atomic_dec(p->_count); 12 | } 13 | -------------------------------------------------------------------------------- /conf/2-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | 4 | # RedHat's gcc puts weird chars in messages, so we need .* below 5 | if grep ': implicit declaration of function .*class_simple_create' \ 6 | conf/$TESTNO.log > /dev/null 2>&1; then 7 | echo new 8 | else 9 | echo old 10 | fi 11 | -------------------------------------------------------------------------------- /conf/16.txt: -------------------------------------------------------------------------------- 1 | In 2.6.22, the sk_buff members were changed around, so we use a 2 | function that provides access to the packet. That change is handled 3 | by the last test. 4 | 5 | RHEL 5.2 introduced kernel 2.6.18-92.el5-i686, which DOES have 6 | skb_reset_mac_header et al., but which DOES NOT have for_each_netdev. 7 | -------------------------------------------------------------------------------- /conf/19-dev_net.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int 9 | testfn(struct net_device *ifp) 10 | { 11 | return dev_net(ifp) == &init_net; 12 | } 13 | -------------------------------------------------------------------------------- /conf/19-nd_net.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int 9 | testfn(struct net_device *ifp) 10 | { 11 | return ifp->nd_net == &init_net; 12 | } 13 | -------------------------------------------------------------------------------- /conf/33.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | void test_fn(struct request_queue *q, int n) 10 | { 11 | blk_queue_max_sectors(q, n); 12 | } 13 | -------------------------------------------------------------------------------- /conf/10.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | void foo(void *); 9 | 10 | void 11 | testfn_10(struct work_struct *w) 12 | { 13 | INIT_WORK(w, foo, NULL); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /conf/17.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | static DEFINE_SPINLOCK(test_lock); 9 | 10 | void *testfn(int n) 11 | { 12 | return n > 0 ? &test_lock : NULL; 13 | } 14 | -------------------------------------------------------------------------------- /conf/32-av.sh: -------------------------------------------------------------------------------- 1 | patched=`grep '^skb_mac_header' linux/drivers/block/aoe/aoecmd.c` 2 | test "$patched" = "" && { 3 | echo normal 4 | exit 0 5 | } 6 | f=linux/drivers/block/aoe/aoecmd.c 7 | normal="`grep '^skb_reset_mac_header(' $f`" 8 | if test "$normal"; then 9 | echo normal 10 | else 11 | echo sles10 12 | fi 13 | -------------------------------------------------------------------------------- /conf/12.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | static int 9 | test_12_fn(struct kobject *kobj, const struct attribute_group *agrp) 10 | { 11 | return sysfs_create_group(kobj, agrp); 12 | } 13 | -------------------------------------------------------------------------------- /conf/6.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | void testfn(struct block_device *bd) 9 | { 10 | mutex_lock(&bd->bd_inode->i_mutex); 11 | mutex_unlock(&bd->bd_inode->i_mutex); 12 | } 13 | -------------------------------------------------------------------------------- /conf/39.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | int testfn(struct seq_file *s, int n) 11 | { 12 | return seq_printf(s, "%d\n", n); 13 | } 14 | -------------------------------------------------------------------------------- /conf/23-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoecmd.c 2 | 3 | bsq="`fgrep 'blk_start_queueing(' $f`" 4 | test "$bsq" && { echo bsq; exit 0; } 5 | 6 | brq1="`fgrep '__blk_run_queue(q);' $f`" 7 | test "$brq1" && { echo brq1; exit 0; } 8 | 9 | brq2="`fgrep '__blk_run_queue(q, 0);' $f`" 10 | test "$brq2" && { echo brq2; exit 0; } 11 | 12 | echo old 13 | -------------------------------------------------------------------------------- /conf/31.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | void 10 | testfn(struct request_queue *q) 11 | { 12 | struct request *rq = blk_peek_request(q); 13 | blk_start_request(rq); 14 | } 15 | -------------------------------------------------------------------------------- /conf/40.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | int test_fn(struct dentry *e) 12 | { 13 | return IS_ERR_OR_NULL(e); 14 | } 15 | -------------------------------------------------------------------------------- /conf/1.c: -------------------------------------------------------------------------------- 1 | /* If this file won't compile, then struct disk_attribute is likely 2 | * defined in the kernel headers, i.e., 2.6.11 or later. 3 | */ 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | struct disk_attribute da_test; 12 | -------------------------------------------------------------------------------- /conf/27-kv.sh: -------------------------------------------------------------------------------- 1 | echo new; exit # disable this test 2 | 3 | . conf/kv.sh 4 | $make_cmd > conf/$TESTNO.log 2>&1 5 | if egrep \ 6 | "empty_zero_page.*undefined" \ 7 | conf/$TESTNO.log > /dev/null 2>&1; then 8 | echo old 9 | elif egrep \ 10 | "phys_base.*undefined" \ 11 | conf/$TESTNO.log > /dev/null 2>&1; then 12 | echo old 13 | else 14 | echo new 15 | fi 16 | -------------------------------------------------------------------------------- /conf/5.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | static int 7 | aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt) 8 | { 9 | return 0; 10 | } 11 | 12 | static struct packet_type aoe_pt = { 13 | .type = 0, 14 | .func = aoenet_rcv, 15 | }; 16 | -------------------------------------------------------------------------------- /conf/18.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | void * 9 | testing_function(char *name) 10 | { 11 | void *p; 12 | 13 | p = kmem_cache_create(name, 14 | 100, 15 | 0, 0, NULL, NULL); 16 | 17 | return p; 18 | } 19 | -------------------------------------------------------------------------------- /conf/8.txt: -------------------------------------------------------------------------------- 1 | The msleep_interruptible function appears only in 2.6.9 and up, but we 2 | can supply it for older kernels. 3 | 4 | I saw a Fedora Core system with a 2.6.7 kernel for which this test 5 | didn't work. Our FC2 install disc comes with 2.6.5, for which this 6 | test works, and the current FC2 kernel is 2.6.10, so I'm putting the 7 | issue on the far back burner for now. 8 | -------------------------------------------------------------------------------- /mak/checksum.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Use whatever they have to checksum the file. 3 | 4 | f="${1:-/dev/stdin}" 5 | 6 | test -r "$f" || { 7 | exec 1>&2 8 | echo "`basename $0` Error: \"$f\" is not readable" 9 | exit 1 10 | } 11 | { 12 | md5sum "$f" 2> /dev/null || 13 | sha1sum "$f" 2> /dev/null || 14 | cksum "$f" 2> /dev/null || 15 | sum "$f" 16 | } | awk '{print $1}' 17 | -------------------------------------------------------------------------------- /conf/25-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | for t in fs5 relay5 relay6; do 3 | log=conf/$TESTNO-$t.log 4 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO-$t"'.o' > conf/Makefile 5 | $make_cmd > $log 2>&1 6 | test "$?" = "0" && 7 | test -z "`grep 'relay_open.*undefined' $log`" && 8 | test -z "`grep -i 'Module.symvers' $log`" && 9 | { echo $t; exit 0; } 10 | done 11 | 12 | echo none 13 | -------------------------------------------------------------------------------- /conf/32-kv.sh: -------------------------------------------------------------------------------- 1 | patched=`grep '^skb_mac_header' linux/drivers/block/aoe/aoecmd.c` 2 | test "$patched" = "" && { 3 | echo normal 4 | exit 0 5 | } 6 | . conf/kv.sh 7 | $make_cmd > conf/$TESTNO.log 2>&1 8 | if egrep -i '(previous definition|redefinition).*skb_reset_mac_header' conf/$TESTNO.log \ 9 | > /dev/null 2>&1; then 10 | echo sles10 11 | else 12 | echo normal 13 | fi 14 | -------------------------------------------------------------------------------- /conf/28.txt: -------------------------------------------------------------------------------- 1 | In 2.6.28, the prototype of the open handler was changed. The 2 | kernel.org aoe driver was modified by this commit: 3 | 4 | commit 94562c175113cf91204a77269eabeea32e1f38db 5 | Author: Al Viro 6 | Date: Sun Mar 2 09:23:18 2008 -0500 7 | 8 | [PATCH] switch aoeblk 9 | 10 | Basically, they stopped using a pointer to struct inode. 11 | -------------------------------------------------------------------------------- /conf/34.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | struct attribute aoe_attrs = { 11 | .owner = NULL, 12 | }; 13 | void *testfn(struct attribute *p) 14 | { 15 | return (void *) p->owner; 16 | } 17 | -------------------------------------------------------------------------------- /conf/19-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO-dev_net"'.o' > conf/Makefile 3 | $make_cmd > conf/$TESTNO-dev_net.log 2>&1 4 | test "$?" = "0" && { echo dev_net; exit 0; } 5 | 6 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO-nd_net"'.o' > conf/Makefile 7 | $make_cmd > conf/$TESTNO-nd_net.log 2>&1 8 | test "$?" = "0" && { echo nd_net; exit 0; } 9 | 10 | echo nons 11 | -------------------------------------------------------------------------------- /conf/15.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | void *test_fn(struct sk_buff *skb) 13 | { 14 | return skb_mac_header(skb); 15 | } 16 | -------------------------------------------------------------------------------- /conf/17-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff --git a/linux/drivers/block/aoe/aoe.h b/linux/drivers/block/aoe/aoe.h 2 | index f1f2b6e..d097a5c 100644 3 | --- a/linux/drivers/block/aoe/aoe.h 4 | +++ b/linux/drivers/block/aoe/aoe.h 5 | @@ -13,8 +13,6 @@ 6 | #define ETH_P_AOE 0x88a2 7 | #endif 8 | 9 | -#define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED 10 | - 11 | enum { 12 | AOECMD_ATA, 13 | AOECMD_CFG, 14 | -------------------------------------------------------------------------------- /conf/23-brq1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | void 13 | testfn_brq(struct request_queue *q) 14 | { 15 | __blk_run_queue(q); 16 | } 17 | -------------------------------------------------------------------------------- /conf/23-brq2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | void 13 | testfn_brq(struct request_queue *q) 14 | { 15 | __blk_run_queue(q, 0); 16 | } 17 | -------------------------------------------------------------------------------- /conf/23-bsq.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | void 13 | testfn_22(struct request_queue *q) 14 | { 15 | blk_start_queueing(q); 16 | } 17 | -------------------------------------------------------------------------------- /conf/9.txt: -------------------------------------------------------------------------------- 1 | FC2 has a 2.6.5 kernel that lacks a _count member in the page struct. 2 | Instead, there is a count member. 3 | 4 | akpm changed the member name to _count in 2.6.7 to keep people from 5 | directly changing the member, but there are no macros to do what we 6 | need to do when we sit between XFS, which gives us zero-ref pages in 7 | bios, and the network layer, which uses get_page and put_page on pages 8 | in frags. 9 | -------------------------------------------------------------------------------- /conf/37-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 3 | $make_cmd > conf/$TESTNO.log 2>&1 4 | 5 | status="$?" 6 | test "`egrep -i '(err|warn).*kmemdup' conf/$TESTNO.log`" && { echo old; exit 0; } 7 | test "$status" != "0" && { 8 | echo `basename $0` Error: cannot identify target kernel state for compatibility 1>&2 9 | echo unsupported 10 | exit 1 11 | } 12 | 13 | echo new 14 | -------------------------------------------------------------------------------- /conf/37.txt: -------------------------------------------------------------------------------- 1 | Upstream, aoechr_error was modified with the commit shown below to use 2 | the kmemdup function. Alexey Dobriyan added kmemdup with commit 3 | 1a2f67b4, appearing in 2.6.19. 4 | 5 | commit 60abc786dd3b5d6917d63fd789c9fed772f65039 6 | Author: Mihnea Dobrescu-Balaur 7 | Date: Tue Apr 30 15:28:29 2013 -0700 8 | 9 | aoe: replace kmalloc and then memcpy with kmemdup 10 | -------------------------------------------------------------------------------- /conf/20-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff --git a/linux/drivers/block/aoe/aoecmd.c b/linux/drivers/block/aoe/aoecmd.c 2 | index eedcfbb..507b38d 100644 3 | --- a/linux/drivers/block/aoe/aoecmd.c 4 | +++ b/linux/drivers/block/aoe/aoecmd.c 5 | @@ -673,7 +673,7 @@ rqbiocnt(struct request *r) 6 | struct bio *bio; 7 | ushort n = 0; 8 | 9 | - rq_for_each_bio(bio, r) 10 | + __rq_for_each_bio(bio, r) 11 | n++; 12 | return n; 13 | } 14 | -------------------------------------------------------------------------------- /conf/26.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | void 13 | testfn(struct list_head *pos, struct list_head *new) 14 | { 15 | list_replace(pos, new); 16 | } 17 | -------------------------------------------------------------------------------- /conf/13.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | static void 13 | test_13_fn(struct request *q, int error) 14 | { 15 | __blk_end_request(q, error, 512); 16 | } 17 | -------------------------------------------------------------------------------- /conf/21-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | skip="`fgrep 'sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr);' $f`" 3 | test "$skip" && { echo skip; exit 0; } 4 | 5 | dtd="`fgrep 'return sysfs_create_group(&disk_to_dev(d->gd)->kobj,' $f`" 6 | test "$dtd" && { echo dtd; exit 0; } 7 | 8 | dev="`fgrep 'static ssize_t aoedisk_show_state(struct device *dev,' $f`" 9 | test "$dev" && { echo dev; exit 0; } 10 | 11 | echo gd 12 | -------------------------------------------------------------------------------- /conf/38-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 3 | $make_cmd > conf/$TESTNO.log 2>&1 4 | 5 | status="$?" 6 | test "`egrep -i '(err|warn).*compound_trans_head' conf/$TESTNO.log`" && { echo old; exit 0; } 7 | test "$status" != "0" && { 8 | echo `basename $0` Error: cannot identify target kernel state for compatibility 1>&2 9 | echo unsupported 10 | exit 1 11 | } 12 | 13 | echo new 14 | -------------------------------------------------------------------------------- /conf/14.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | static void 13 | test_13_fn(struct request *q, int uptodate) 14 | { 15 | end_that_request_last(q, uptodate); 16 | } 17 | -------------------------------------------------------------------------------- /pkg/rhel6/SOURCES/aoe-83-nodepmod.diff: -------------------------------------------------------------------------------- 1 | --- Makefile.20130705 2013-07-05 11:06:02.336589106 -0400 2 | +++ Makefile 2013-07-05 11:06:58.987086749 -0400 3 | @@ -116,7 +116,6 @@ 4 | @echo "Install directory is $(INSTDIR)" 5 | mkdir -p $(INSTDIR) 6 | install -m 644 $(DRIVER_D)/aoe.ko $(INSTDIR) 7 | - /sbin/depmod -a 8 | 9 | install_nodev: install_modobj 10 | # punt if DEVSUBDIR isn't the default. probably should have cleaner solution. 11 | -------------------------------------------------------------------------------- /conf/24-cdc4.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | struct aoe_chardev { 6 | ulong minor; 7 | char name[32]; 8 | }; 9 | 10 | static struct class *aoe_class; 11 | static struct aoe_chardev chardevs[1]; 12 | 13 | int 14 | aoechr_init(void) 15 | { 16 | class_device_create(aoe_class, 17 | MKDEV(152, chardevs[0].minor), 18 | NULL, chardevs[0].name); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /conf/24-dc.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | struct aoe_chardev { 6 | ulong minor; 7 | char name[32]; 8 | }; 9 | 10 | static struct class *aoe_class; 11 | static struct aoe_chardev chardevs[1]; 12 | 13 | int 14 | aoechr_init(void) 15 | { 16 | device_create(aoe_class, NULL, 17 | MKDEV(152, chardevs[0].minor), 18 | NULL, chardevs[0].name); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /linux/Documentation/aoe/autoload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # set aoe to autoload by installing the 3 | # aliases in /etc/modprobe.conf 4 | 5 | f=/etc/modprobe.conf 6 | 7 | if test ! -r $f || test ! -w $f; then 8 | echo "cannot configure $f for module autoloading" 1>&2 9 | exit 1 10 | fi 11 | 12 | grep major-152 $f >/dev/null 13 | if [ $? = 1 ]; then 14 | echo alias block-major-152 aoe >> $f 15 | echo alias char-major-152 aoe >> $f 16 | fi 17 | 18 | -------------------------------------------------------------------------------- /conf/43.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | static struct dentry * 8 | cfile(const char *filename, 9 | struct dentry *parent, 10 | umode_t mode, 11 | struct rchan_buf *buf, 12 | int *is_global) 13 | { 14 | return NULL; 15 | } 16 | 17 | struct rchan_callbacks cb = { 18 | .create_buf_file = cfile, 19 | }; 20 | -------------------------------------------------------------------------------- /conf/24-cdc5.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | struct aoe_chardev { 6 | ulong minor; 7 | char name[32]; 8 | }; 9 | 10 | static struct class *aoe_class; 11 | static struct aoe_chardev chardevs[1]; 12 | 13 | int 14 | aoechr_init(void) 15 | { 16 | class_device_create(aoe_class, NULL, 17 | MKDEV(152, chardevs[0].minor), 18 | NULL, chardevs[0].name); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /conf/24-dcd.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | struct aoe_chardev { 6 | ulong minor; 7 | char name[32]; 8 | }; 9 | 10 | static struct class *aoe_class; 11 | static struct aoe_chardev chardevs[1]; 12 | 13 | int 14 | aoechr_init(void) 15 | { 16 | device_create_drvdata(aoe_class, NULL, 17 | MKDEV(152, chardevs[0].minor), 18 | NULL, chardevs[0].name); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /conf/18.txt: -------------------------------------------------------------------------------- 1 | This change, 2 | 3 | commit 20c2df83d25c6a95affe6157a4c9cac4cf5ffaac 4 | Author: Paul Mundt 5 | Date: Fri Jul 20 10:11:58 2007 +0900 6 | 7 | mm: Remove slab destructors from kmem_cache_create(). 8 | 9 | removed the penultimate parameter to kmem_cache_create, so we 10 | just need to drop one of the NULL function pointers in our call. 11 | 12 | It seems Mundt missed the aoe driver. More work for me! 13 | -------------------------------------------------------------------------------- /conf/2.txt: -------------------------------------------------------------------------------- 1 | The class_simple_... functions were removed from the kernel in 2 | 2.6.13. 3 | 4 | We want aoechr.c to use class_simple if $(KDIR) has it, but not if 5 | it doesn't. 6 | 7 | We can't just grep for class_simple in 8 | $(KDIR)/include/linux/device.h because, e.g., Suse 9.3 Pro doesn't 9 | have device.h there. The warnings from gcc, though, should 10 | consistently let us know whether the kernel sources have 11 | class_simple or not. 12 | -------------------------------------------------------------------------------- /conf/7-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | --- aoet/linux/drivers/block/aoe/aoecmd.c.20070705 2007-07-05 11:34:25.000000000 -0400 2 | +++ aoet/linux/drivers/block/aoe/aoecmd.c 2007-07-05 11:05:33.000000000 -0400 3 | @@ -998,7 +998,7 @@ noskb: if (buf) 4 | skb->len); 5 | break; 6 | } 7 | - if (skb_is_nonlinear(skb) && skb_linearize(skb, GFP_ATOMIC)) 8 | + if (skb_linearize(skb)) 9 | break; 10 | spin_lock_irq(&d->lock); 11 | ataid_complete(d, t, skb->data); 12 | -------------------------------------------------------------------------------- /conf/33.txt: -------------------------------------------------------------------------------- 1 | v2.6.34-rc4 contains commit ee714f2dd33e, where Martin K. Petersen 2 | removes a compatibility wrapper that equates blk_queue_max_sectors 3 | with blk_queue_max_hw_sectors. 4 | 5 | v2.6.34-rc1 contains commit 086fa5ff, where he renames 6 | blk_queue_max_sectors to blk_queue_max_hw_sectors, to bring it in line 7 | with a convention that applies to newer members of the block queue 8 | limits, thus making it clear that the function updates max_hw_sectors. 9 | 10 | -------------------------------------------------------------------------------- /conf/18-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | --- aoe6-53-2.6.23.1/linux/drivers/block/aoe/aoeblk.c.20071023 2007-10-23 18:55:08.000000000 -0400 2 | +++ aoe6-53-2.6.23.1/linux/drivers/block/aoe/aoeblk.c 2007-10-23 18:55:23.000000000 -0400 3 | @@ -341,7 +341,7 @@ aoeblk_init(void) 4 | { 5 | buf_pool_cache = kmem_cache_create("aoe_bufs", 6 | sizeof(struct buf), 7 | - 0, 0, NULL, NULL); 8 | + 0, 0, NULL); 9 | if (buf_pool_cache == NULL) 10 | return -ENOMEM; 11 | 12 | -------------------------------------------------------------------------------- /conf/38.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | struct page *testfn(struct page *page) 15 | { 16 | return compound_trans_head(page); 17 | } 18 | -------------------------------------------------------------------------------- /conf/34-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | 3 | # 34 becomes not applicable when 21 moved the sources to the gd state 4 | # (It's conf/21 in Nov 2010, but it could get renumbered someday.) 5 | gd="`fgrep 'static ssize_t aoedisk_show_netif(struct gendisk *disk, char *page)' $f`" 6 | test "$gd" && { echo skip; exit 0; } 7 | 8 | owner="`sed -n '/\.attr = {/{p;n;p;n;p;n;p;n;p;}' $f | fgrep '.owner = THIS_MODULE,'`" 9 | test "$owner" && { echo old; exit 0; } 10 | 11 | echo new 12 | -------------------------------------------------------------------------------- /conf/41.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | struct bvec_iter *iter; 15 | 16 | struct bvec_iter *test_fn(int n) 17 | { 18 | return iter + n; 19 | } 20 | -------------------------------------------------------------------------------- /conf/43-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff --git a/linux/drivers/block/aoe/aoedbg.c b/linux/drivers/block/aoe/aoedbg.c 2 | index 57910da..e41113d 100644 3 | --- a/linux/drivers/block/aoe/aoedbg.c 4 | +++ b/linux/drivers/block/aoe/aoedbg.c 5 | @@ -26,7 +26,7 @@ static DEFINE_SPINLOCK(buflock); 6 | static struct dentry * 7 | cfile(const char *filename, 8 | struct dentry *parent, 9 | - int mode, 10 | + umode_t mode, 11 | struct rchan_buf *buf, 12 | int *is_global) 13 | { 14 | -------------------------------------------------------------------------------- /conf/28.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | static int 10 | aoeblk_open(struct block_device *bdev, fmode_t mode) 11 | { 12 | char *p = (char *) bdev->bd_disk->private_data; 13 | char *q = (char *) bdev; 14 | 15 | return p - q; 16 | } 17 | 18 | struct block_device_operations aoe_bdops = { 19 | .open = aoeblk_open, 20 | }; 21 | -------------------------------------------------------------------------------- /aoetools-36/aoe-discover.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # aoe-discover - trigger an AoE device discovery 3 | # Copyright 2009, CORAID, Inc., and licensed under GPL v.2. 4 | 5 | zero=`basename $0` 6 | f=@devdir@/discover 7 | 8 | if ! test -w $f; then 9 | echo 1>&2 $zero: $f does not exist or is not writeable. 10 | exit 1 11 | fi 12 | if ! test -c $f; then 13 | exec 1>&2 14 | echo "$zero: $f is not a character device file" 15 | echo "$zero: use udev or aoe-mkdevs to create it" 16 | exit 1 17 | fi 18 | echo > $f 19 | -------------------------------------------------------------------------------- /conf/23-patches/brq1-brq2.diff: -------------------------------------------------------------------------------- 1 | diff -upr brq1/linux/drivers/block/aoe/aoecmd.c brq2/linux/drivers/block/aoe/aoecmd.c 2 | --- brq1/linux/drivers/block/aoe/aoecmd.c 2013-05-30 14:22:00.675428624 -0400 3 | +++ brq2/linux/drivers/block/aoe/aoecmd.c 2013-05-30 15:13:17.488489853 -0400 4 | @@ -1169,7 +1169,7 @@ aoe_end_request(struct aoedev *d, struct 5 | 6 | /* cf. http://lkml.org/lkml/2006/10/31/28 */ 7 | if (!fastfail) 8 | - __blk_run_queue(q); 9 | + __blk_run_queue(q, 0); 10 | } 11 | 12 | void 13 | -------------------------------------------------------------------------------- /conf/23-patches/brq1-bsq.diff: -------------------------------------------------------------------------------- 1 | diff -upr brq1/linux/drivers/block/aoe/aoecmd.c bsq/linux/drivers/block/aoe/aoecmd.c 2 | --- brq1/linux/drivers/block/aoe/aoecmd.c 2013-05-30 14:22:00.675428624 -0400 3 | +++ bsq/linux/drivers/block/aoe/aoecmd.c 2013-05-30 15:14:32.791474307 -0400 4 | @@ -1169,7 +1169,7 @@ aoe_end_request(struct aoedev *d, struct 5 | 6 | /* cf. http://lkml.org/lkml/2006/10/31/28 */ 7 | if (!fastfail) 8 | - __blk_run_queue(q); 9 | + blk_start_queueing(q); 10 | } 11 | 12 | void 13 | -------------------------------------------------------------------------------- /conf/23-patches/brq2-bsq.diff: -------------------------------------------------------------------------------- 1 | diff -upr brq2/linux/drivers/block/aoe/aoecmd.c bsq/linux/drivers/block/aoe/aoecmd.c 2 | --- brq2/linux/drivers/block/aoe/aoecmd.c 2013-05-30 15:13:17.488489853 -0400 3 | +++ bsq/linux/drivers/block/aoe/aoecmd.c 2013-05-30 15:14:32.791474307 -0400 4 | @@ -1169,7 +1169,7 @@ aoe_end_request(struct aoedev *d, struct 5 | 6 | /* cf. http://lkml.org/lkml/2006/10/31/28 */ 7 | if (!fastfail) 8 | - __blk_run_queue(q, 0); 9 | + blk_start_queueing(q); 10 | } 11 | 12 | void 13 | -------------------------------------------------------------------------------- /conf/29.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | static int 10 | test_ioctl(struct inode *inode, struct file *filp, uint cmd, ulong arg) 11 | { 12 | struct inode *p = (struct inode *) filp; 13 | 14 | return p - inode; 15 | } 16 | 17 | void 18 | testfn(struct block_device_operations *bdops) 19 | { 20 | bdops->ioctl = test_ioctl; 21 | } 22 | -------------------------------------------------------------------------------- /conf/39-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -upr old/linux/drivers/block/aoe/aoeblk.c new/linux/drivers/block/aoe/aoeblk.c 2 | --- old/linux/drivers/block/aoe/aoeblk.c 2013-06-22 18:13:44.000000000 -0400 3 | +++ new/linux/drivers/block/aoe/aoeblk.c 2013-06-22 18:02:54.000000000 -0400 4 | @@ -10,7 +10,6 @@ 5 | #include 6 | #include 7 | #include 8 | -#include 9 | #include 10 | #include 11 | #include "aoe.h" 12 | -------------------------------------------------------------------------------- /conf/22.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | static int 10 | aoeblk_getgeo(struct block_device *bdev, struct hd_geometry *geo) 11 | { 12 | geo->cylinders = 0; 13 | geo->heads = 0; 14 | geo->sectors = 0; 15 | return 0; 16 | } 17 | 18 | void 19 | testfn_21(struct block_device_operations *bdops) 20 | { 21 | bdops->getgeo = aoeblk_getgeo; 22 | }; 23 | -------------------------------------------------------------------------------- /conf/32.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | static void 13 | skb_reset_mac_header(struct sk_buff *skb) 14 | { 15 | skb->mac.raw = skb->data; 16 | } 17 | 18 | void test_fn(struct sk_buff *skb) 19 | { 20 | skb_reset_mac_header(skb); 21 | } 22 | -------------------------------------------------------------------------------- /conf/11-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | $make_cmd > conf/$TESTNO.log 2>&1 3 | result=old 4 | if egrep -i '(warning|error).*kmem_cache_t' conf/$TESTNO.log \ 5 | > /dev/null 2>&1; then 6 | result=new 7 | fi 8 | # gcc-3.4.4 on debian says "parse error", but 3.4.6 corrects that 9 | if egrep -i '(parse|syntax) error before' conf/$TESTNO.log \ 10 | > /dev/null 2>&1; then 11 | result=new 12 | fi 13 | if egrep -i "expected.*before '[*]' token" conf/$TESTNO.log \ 14 | > /dev/null 2>&1; then 15 | result=new 16 | fi 17 | echo $result 18 | -------------------------------------------------------------------------------- /conf/1.txt: -------------------------------------------------------------------------------- 1 | A bugfix in the 2.6.11 kernel moved a struct from a hidden 2 | definition in a .c file to a public header file. 3 | 4 | To support 2.6.11 and later kernels as well as earlier kernels, we 5 | need to be able to either define struct disk_attribute or not, 6 | depending on its presence in the kernel we're building against. We 7 | could try grep and hope nobody moves disk_attribute to a different 8 | header, but the most reliable way to tell is to simply compile 9 | something and test for failure. 10 | 11 | -------------------------------------------------------------------------------- /conf/40.txt: -------------------------------------------------------------------------------- 1 | To fit in with the upstream kernel, we have to use code that fits 2 | current usage patterns, which sometimes means adjusting the aoe code 3 | to fit older kernels. 4 | 5 | The IS_ERR_OR_NULL helper was added in 2.6.33 by Phil Carmody. 6 | 7 | commit 603c4ba96be998a8dd7a6f9b23681c49acdf4b64 8 | Author: Phil Carmody 9 | Date: Mon Dec 14 18:00:29 2009 -0800 10 | 11 | err.h: add helper function to simplify pointer error checking 12 | 13 | Older kernels need help. 14 | -------------------------------------------------------------------------------- /conf/19-patches/nd_net-dev_net.diff: -------------------------------------------------------------------------------- 1 | diff -upr nd_net/linux/drivers/block/aoe/aoenet.c dev_net/linux/drivers/block/aoe/aoenet.c 2 | --- nd_net/linux/drivers/block/aoe/aoenet.c 2008-08-19 13:27:26.000000000 -0400 3 | +++ dev_net/linux/drivers/block/aoe/aoenet.c 2008-08-19 11:29:29.000000000 -0400 4 | @@ -169,7 +169,7 @@ aoenet_rcv(struct sk_buff *skb, struct n 5 | u32 n; 6 | int sn; 7 | 8 | - if (ifp->nd_net != &init_net) 9 | + if (dev_net(ifp) != &init_net) 10 | goto exit; 11 | 12 | skb = skb_share_check(skb, GFP_ATOMIC); 13 | -------------------------------------------------------------------------------- /conf/11-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -uprN a/linux/drivers/block/aoe/aoeblk.c b/linux/drivers/block/aoe/aoeblk.c 2 | --- a/linux/drivers/block/aoe/aoeblk.c 2013-06-19 01:20:03.000000000 -0400 3 | +++ b/linux/drivers/block/aoe/aoeblk.c 2013-06-19 01:15:39.000000000 -0400 4 | @@ -17,7 +17,7 @@ 5 | #include "aoe.h" 6 | #include "disk_attr.h" 7 | 8 | -static kmem_cache_t *buf_pool_cache; 9 | +static struct kmem_cache *buf_pool_cache; 10 | static struct dentry *aoe_debugfs_dir; 11 | 12 | /* GPFS needs a larger value than the default. */ 13 | -------------------------------------------------------------------------------- /conf/20.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | /* #include */ 10 | #include 11 | #include 12 | 13 | unsigned short 14 | rqbiocnt(struct request *r) 15 | { 16 | struct bio *bio; 17 | unsigned short n = 0; 18 | 19 | rq_for_each_bio(bio, r) 20 | n++; 21 | return n; 22 | } 23 | -------------------------------------------------------------------------------- /conf/7.txt: -------------------------------------------------------------------------------- 1 | The skb_linearize cleanup by Herbert Xu ... 2 | 3 | http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/patch-2.6.17-git1.log 4 | http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=364c6badde0dd62a0a38e5ed67f85d87d6665780;hp=932ff279a43ab7257942cddff2595acd541cc49b 5 | 6 | ... put the skb_is_nonlinear check into skb_linearize and made the 7 | GFP_ATOMIC parameter unecessary. This change is expected to show up 8 | in 2.6.18 and up (as well as the development kernels based on 9 | 2.6.17). 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.orig 3 | *.rej 4 | mak/.*.cmd 5 | mak/.tmp_versions/ 6 | mak/Module.symvers 7 | mak/cc-id.cmpout 8 | mak/cc-id.last 9 | mak/cc-id.out 10 | mak/cc-id.ts 11 | mak/dummy.log 12 | mak/dummy.mod.* 13 | mak/kernel-id.cmpout 14 | mak/kernel-id.last 15 | mak/kernel-id.out 16 | mak/kernel-id.ts 17 | mak/modules.order 18 | mak/src-id.cmpout 19 | mak/src-id.last 20 | mak/src-id.out 21 | mak/src-id.ts 22 | conf/*.log 23 | aoetools-*/ 24 | conf/.tmp_versions/ 25 | conf/Makefile 26 | conf/Module.symvers 27 | conf/done 28 | conf/modules.order 29 | -------------------------------------------------------------------------------- /linux/Documentation/aoe/00-INDEX: -------------------------------------------------------------------------------- 1 | 00-INDEX 2 | - this file. 3 | aoe.txt 4 | - ATA over Ethernet (AoE) driver user guide and pointer to tools. 5 | autoload.sh 6 | - script for making the AoE driver autoload via /etc/modprobe.conf. 7 | status.sh 8 | - script to collate and present sysfs information about AoE storage. 9 | todo.txt 10 | - list of things yet to be done for the AoE driver. 11 | udev-install.sh 12 | - script to install the aoe-specific udev rules from udev.txt. 13 | udev.txt 14 | - list of udev rules for AoE device node creation. 15 | -------------------------------------------------------------------------------- /conf/16-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | --- aoe6-83+/linux/drivers/block/aoe/aoecmd.c 2013-05-30 12:51:58.000000000 -0400 2 | +++ aoe6-83+/linux/drivers/block/aoe/aoecmd.c.orig 2013-05-30 12:43:47.000000000 -0400 3 | @@ -18,10 +18,6 @@ 4 | #include 5 | #include "aoe.h" 6 | 7 | -#define for_each_netdev(__ifp) \ 8 | - for (__ifp = dev_base; __ifp; __ifp = __ifp->next) 9 | - 10 | - 11 | static void ktcomplete(struct frame *, struct sk_buff *); 12 | static int count_targets(struct aoedev *d, int *untainted); 13 | static struct buf *nextbuf(struct aoedev *); 14 | -------------------------------------------------------------------------------- /conf/33-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff --git a/linux/drivers/block/aoe/aoeblk.c b/linux/drivers/block/aoe/aoeblk.c 2 | index 426537f..fdb2082 100644 3 | --- a/linux/drivers/block/aoe/aoeblk.c 4 | +++ b/linux/drivers/block/aoe/aoeblk.c 5 | @@ -378,7 +378,7 @@ gderr: spin_lock_irqsave(&d->lock, flags); 6 | q->queuedata = d; 7 | d->gd = gd; 8 | if (aoe_maxsectors) 9 | - blk_queue_max_sectors(q, aoe_maxsectors); 10 | + blk_queue_max_hw_sectors(q, aoe_maxsectors); 11 | gd->major = AOE_MAJOR; 12 | gd->first_minor = d->sysminor; 13 | gd->fops = &aoe_bdops; 14 | -------------------------------------------------------------------------------- /conf/16.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | int *test_fn(struct net_device *ifp) 13 | { 14 | int n = 0; 15 | 16 | read_lock(&dev_base_lock); 17 | for_each_netdev(&init_net, ifp) { 18 | dev_hold(ifp); 19 | n += 1; 20 | dev_put(ifp); 21 | } 22 | read_unlock(&dev_base_lock); 23 | } 24 | -------------------------------------------------------------------------------- /conf/27.txt: -------------------------------------------------------------------------------- 1 | RHEL 4 has kernel-devel that does not define empty_zero_page. 2 | 3 | update 200901: 4 | 5 | In fact, it's easier to kmalloc and use our own zero page for now. 6 | I'm disabling this compat test. 7 | 8 | update 201208: 9 | 10 | There has been get_zeroed_page since the initial git commit with 11 | 2.6.12, so I'm using that instead. Allocating two consecutive 12 | pages using kcalloc was resulting in us manipulating the _count 13 | of the second page, which was a tail of a compound page. That 14 | resulted in panics on 3.4.y (LXOSI-68). 15 | -------------------------------------------------------------------------------- /conf/25-patches/relay5-relay6.diff: -------------------------------------------------------------------------------- 1 | diff -upr relay5/linux/drivers/block/aoe/aoedbg.c relay6/linux/drivers/block/aoe/aoedbg.c 2 | --- relay5/linux/drivers/block/aoe/aoedbg.c 2008-10-17 11:10:02.000000000 -0400 3 | +++ relay6/linux/drivers/block/aoe/aoedbg.c 2008-10-17 09:37:31.000000000 -0400 4 | @@ -66,7 +66,7 @@ xrelay_open(const char *base_fnam, 5 | { 6 | struct rchan *c; 7 | 8 | - c = relay_open(base_fnam, parent, subbuf_size, n_subbufs, &cb); 9 | + c = relay_open(base_fnam, parent, subbuf_size, n_subbufs, &cb, NULL); 10 | 11 | if (!c) 12 | printk(KERN_ERR 13 | -------------------------------------------------------------------------------- /conf/42.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | static int 15 | release(struct gendisk *disk, fmode_t mode) 16 | { 17 | return 0; 18 | } 19 | 20 | static const struct block_device_operations bdops = { 21 | .release = release, 22 | }; 23 | -------------------------------------------------------------------------------- /conf/32-patches/sles10-normal.diff: -------------------------------------------------------------------------------- 1 | diff -upr sles10/linux/drivers/block/aoe/aoecmd.c normal/linux/drivers/block/aoe/aoecmd.c 2 | --- sles10/linux/drivers/block/aoe/aoecmd.c 2010-02-19 20:01:14.264154534 -0500 3 | +++ normal/linux/drivers/block/aoe/aoecmd.c 2010-02-19 20:00:24.327637132 -0500 4 | @@ -58,6 +58,11 @@ skb_reset_network_header(struct sk_buff 5 | { 6 | skb->nh.raw = skb->data; 7 | } 8 | +static void 9 | +skb_reset_mac_header(struct sk_buff *skb) 10 | +{ 11 | + skb->mac.raw = skb->data; 12 | +} 13 | static void * 14 | skb_mac_header(struct sk_buff *skb) 15 | { 16 | -------------------------------------------------------------------------------- /conf/14-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -upr a/linux/drivers/block/aoe/aoecmd.c b/linux/drivers/block/aoe/aoecmd.c 2 | --- a/linux/drivers/block/aoe/aoecmd.c 2007-07-09 15:33:20.000000000 -0400 3 | +++ b/linux/drivers/block/aoe/aoecmd.c 2007-07-09 15:32:52.000000000 -0400 4 | @@ -906,7 +906,7 @@ aoe_end_request(struct aoedev *d, struct 5 | if (!bok) 6 | rok = 0; 7 | } while (end_that_request_first(rq, bok, bio->bi_size / 512)); 8 | - end_that_request_last(rq); 9 | + end_that_request_last(rq, rok); 10 | 11 | if (!fastfail) { 12 | // cf. http://lkml.org/lkml/2006/10/31/28 13 | -------------------------------------------------------------------------------- /conf/24-patches/cdc4-cdc5.diff: -------------------------------------------------------------------------------- 1 | diff -upr cdc4/linux/drivers/block/aoe/aoechr.c cdc5/linux/drivers/block/aoe/aoechr.c 2 | --- cdc4/linux/drivers/block/aoe/aoechr.c 2013-06-04 14:49:44.000000000 -0400 3 | +++ cdc5/linux/drivers/block/aoe/aoechr.c 2013-06-04 14:53:53.000000000 -0400 4 | @@ -286,7 +286,7 @@ aoechr_init(void) 5 | return PTR_ERR(aoe_class); 6 | } 7 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 8 | - class_device_create(aoe_class, 9 | + class_device_create(aoe_class, NULL, 10 | MKDEV(AOE_MAJOR, chardevs[i].minor), 11 | NULL, chardevs[i].name); 12 | 13 | -------------------------------------------------------------------------------- /conf/37-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -r b17da58bd89f linux/drivers/block/aoe/aoechr.c 2 | --- a/linux/drivers/block/aoe/aoechr.c Wed May 22 15:58:12 2013 -0400 3 | +++ b/linux/drivers/block/aoe/aoechr.c Wed May 22 15:53:17 2013 -0400 4 | @@ -114,17 +114,6 @@ loop: 5 | return 0; 6 | } 7 | 8 | -/* added for backwards compatibility */ 9 | -static void *kmemdup(const void *src, size_t len, gfp_t gfp) 10 | -{ 11 | - void *p; 12 | - 13 | - p = kmalloc(len, gfp); 14 | - if (p) 15 | - memcpy(p, src, len); 16 | - return p; 17 | -} 18 | - 19 | void 20 | aoechr_error(char *msg) 21 | { 22 | -------------------------------------------------------------------------------- /conf/42.txt: -------------------------------------------------------------------------------- 1 | commit db2a144bedd58b3dcf19950c2f476c58c9f39d18 2 | Author: Al Viro 3 | Date: Sun May 5 21:52:57 2013 -0400 4 | 5 | block_device_operations->release() should return void 6 | 7 | The value passed is 0 in all but "it can never happen" cases (and those 8 | only in a couple of drivers) *and* it would've been lost on the way 9 | out anyway, even if something tried to pass something meaningful. 10 | Just don't bother. 11 | 12 | Signed-off-by: Al Viro 13 | 14 | First appearing in 3.10. 15 | -------------------------------------------------------------------------------- /conf/34-kv.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | 3 | # 34 becomes not applicable when 21 moved the sources to the gd state 4 | # (It's conf/21 in Nov 2010, but it could get renumbered someday.) 5 | gd="`fgrep 'static ssize_t aoedisk_show_netif(struct gendisk *disk, char *page)' $f`" 6 | test "$gd" && { echo skip; exit 0; } 7 | 8 | . conf/kv.sh 9 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO"'.o' > conf/Makefile 10 | $make_cmd > conf/$TESTNO.log 2>&1 11 | if test "$?" = "0" && 12 | test ! "`grep 'owner' conf/$TESTNO.log`"; then 13 | echo old 14 | exit 0 15 | fi 16 | 17 | echo new 18 | 19 | -------------------------------------------------------------------------------- /conf/6-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | --- aoet/linux/drivers/block/aoe/aoecmd.c.old 2007-07-05 11:38:18.000000000 -0400 2 | +++ aoet/linux/drivers/block/aoe/aoecmd.c 2007-07-05 11:43:57.000000000 -0400 3 | @@ -756,9 +756,9 @@ aoecmd_sleepwork(void *vp) 4 | ssize = d->gd->capacity; 5 | bd = bdget_disk(d->gd, 0); 6 | if (bd) { 7 | - down(&bd->bd_inode->i_sem); 8 | + mutex_lock(&bd->bd_inode->i_mutex); 9 | i_size_write(bd->bd_inode, (loff_t)ssize<<9); 10 | - up(&bd->bd_inode->i_sem); 11 | + mutex_unlock(&bd->bd_inode->i_mutex); 12 | bdput(bd); 13 | } 14 | spin_lock_irq(&d->lock); 15 | -------------------------------------------------------------------------------- /conf/32.txt: -------------------------------------------------------------------------------- 1 | SLES 10, with its 2.6.16.60-0.54.5 kernel, doesn't have 2 | skb_mac_header, so test 15 treats it as "old", but it has a 3 | skb_reset_mac_header in skbuff.h, so it's an oddball. 4 | 5 | This test accounts for that special case, but it's only relevant when 6 | the aoe driver has been patched to include definitions for 7 | skb_mac_header et al. So 32-[ak]v.sh report "normal" if it hasn't 8 | been patched. This is one of those inter-test dependencies I like to 9 | avoid. 10 | 11 | sles10 12 | has no skb_mac_header but has skb_reset_mac_header 13 | 14 | normal NEW 15 | everything else 16 | -------------------------------------------------------------------------------- /aoetools-36/sos-linux.8: -------------------------------------------------------------------------------- 1 | .TH sos-linux 8 2 | .SH NAME 3 | sos-linux \- create file containing AoE-related information 4 | .SH SYNOPSIS 5 | .nf 6 | .B sos-linux 7 | .fi 8 | .SH DESCRIPTION 9 | The 10 | .I sos-linux 11 | script creates a dated output file in the home directory of the user 12 | running it. 13 | .PP 14 | The filename is printed on the standard output. 15 | .PP 16 | The file contains information about the local system that is likely 17 | to be relevant to its use as an AoE initiator. 18 | .SH "SEE ALSO" 19 | .IR aoe-stat (8), 20 | .IR aoetools (8). 21 | .SH AUTHOR 22 | Ed L. Cashin (ecashin@coraid.com) 23 | -------------------------------------------------------------------------------- /conf/1-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -uprN a/linux/drivers/block/aoe/disk_attr.h b/linux/drivers/block/aoe/disk_attr.h 2 | --- a/linux/drivers/block/aoe/disk_attr.h 2007-01-23 13:55:47.000000000 -0500 3 | +++ b/linux/drivers/block/aoe/disk_attr.h 2007-01-23 13:55:47.000000000 -0500 4 | @@ -1,8 +1 @@ 5 | -/* This struct is not defined in kernels 2.6.10 and earlier. 6 | - * It is defined here for compatibility with those kernels. 7 | - */ 8 | - 9 | -struct disk_attribute { 10 | - struct attribute attr; 11 | - ssize_t (*show)(struct gendisk *, char *); 12 | -}; 13 | +/* struct disk_attribute is defined in kernel headers */ 14 | -------------------------------------------------------------------------------- /conf/25-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoedbg.c 2 | 3 | fs="`fgrep '#include ' $f`" 4 | test "$fs" && { echo fs5; exit 0; } 5 | 6 | none="`fgrep '#include ' $f`" 7 | test "$none" && { echo none; exit 0; } 8 | 9 | relay6="`fgrep 'relay_open(base_fnam, parent, subbuf_size, n_subbufs, &cb, NULL);' $f`" 10 | test "$relay6" && { echo relay6; exit 0; } 11 | 12 | relay5="`fgrep 'relay_open(base_fnam, parent, subbuf_size, n_subbufs, &cb);' $f`" 13 | test "$relay5" && { echo relay5; exit 0; } 14 | 15 | echo "`basename $0` Error: could not identify aoe source state" 1>&2 16 | exit 1 17 | -------------------------------------------------------------------------------- /conf/5-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -uprN a/linux/drivers/block/aoe/aoenet.c b/linux/drivers/block/aoe/aoenet.c 2 | --- a/linux/drivers/block/aoe/aoenet.c 2007-07-09 16:11:22.000000000 -0400 3 | +++ b/linux/drivers/block/aoe/aoenet.c 2007-07-09 16:11:22.000000000 -0400 4 | @@ -157,7 +157,7 @@ aoenet_xmit(struct sk_buff *sl) 5 | * wrong. 6 | */ 7 | static int 8 | -aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt) 9 | +aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, struct net_device *orig_dev) 10 | { 11 | struct aoe_hdr *h; 12 | struct aoe_atahdr *ah; 13 | -------------------------------------------------------------------------------- /conf/21-gd.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "../linux/drivers/block/aoe/disk_attr.h" 9 | 10 | static ssize_t aoedisk_show_state(struct gendisk *gd, char *page) 11 | { 12 | return &gd->kobj - (struct kobject *) NULL; 13 | } 14 | static struct disk_attribute disk_attr_state = { 15 | .attr = {.name = "state", .mode = S_IRUGO }, 16 | .show = aoedisk_show_state 17 | }; 18 | struct attribute *aoe_attrs[] = { 19 | &disk_attr_state.attr, 20 | NULL, 21 | }; 22 | -------------------------------------------------------------------------------- /conf/35.txt: -------------------------------------------------------------------------------- 1 | The big kernel lock (BKL) was removed in Jan 2011 for 2.6.39, and 2 | before that, trivial users of the BKL were migrated via script to use 3 | a mutex in Jun 2010 via commit 2a48fc0ab2424. 4 | 5 | The changes in 35 follow suit. 6 | 7 | The mutex core was added by Ingo Molnar in commit 6053ee3b32e3437 in 8 | January 2006 for 2.6.16-rc1. We could tell from the test 6 results 9 | whether we have a really old kernel without mutexes (but with the 10 | BKL), but we'd better just use the BKL when it's in the kernel, since 11 | we were originally advised to use it even though it was already 12 | planned for removal at the time. 13 | -------------------------------------------------------------------------------- /aoetools-36/pkg/rhel6/SOURCES/60-aoe.rules: -------------------------------------------------------------------------------- 1 | # These rules tell udev what device nodes to create for aoe support. 2 | 3 | # aoe char devices 4 | SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k", GROUP="disk", MODE="0220" 5 | SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k", GROUP="disk", MODE="0440" 6 | SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k", GROUP="disk", MODE="0220" 7 | SUBSYSTEM=="aoe", KERNEL=="revalidate", NAME="etherd/%k", GROUP="disk", MODE="0220" 8 | SUBSYSTEM=="aoe", KERNEL=="flush", NAME="etherd/%k", GROUP="disk", MODE="0220" 9 | 10 | # aoe block devices 11 | KERNEL=="etherd*", NAME="%k", GROUP="disk" 12 | -------------------------------------------------------------------------------- /conf/21-kv.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoeblk.c 2 | skip="`fgrep 'sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr);' $f`" 3 | if test "$skip"; then 4 | echo skip 5 | exit 6 | fi 7 | 8 | . conf/kv.sh 9 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO-gd"'.o' > conf/Makefile 10 | $make_cmd > conf/$TESTNO-gd.log 2>&1 11 | if test "$?" = "0" && 12 | test ! "`grep 'incompatible pointer' conf/$TESTNO-gd.log`"; then 13 | echo gd 14 | exit 0 15 | fi 16 | 17 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO-dev"'.o' > conf/Makefile 18 | $make_cmd > conf/$TESTNO-dev.log 2>&1 19 | test "$?" = "0" && { echo dev; exit 0; } 20 | 21 | echo dtd 22 | 23 | -------------------------------------------------------------------------------- /conf/19.txt: -------------------------------------------------------------------------------- 1 | These changes from Eric W. Biederman introduced network namespaces in 2 | 2.6.14. 3 | 4 | commit 881d966b48b035ab3f3aeaae0f3d3f9b584f45b2 5 | commit e730c15519d09ea528b4d2f1103681fa5937c0e6 6 | 7 | Later, YOSHIFUJI Hideaki made the nd_net member inaccessible. 8 | 9 | commit c346dca10840a874240c78efe3f39acf4312a1f2 10 | 11 | The three states are, 12 | 13 | nons - before namespaces 14 | nd_net - namespaces with direct access to nd_net member 15 | dev_net - access via dev_net NEW 16 | 17 | ---- 18 | In 2.6.31, nd_net is visible again, so we need to look for and use 19 | dev_net when it's present instead of checking for nd_net first. 20 | -------------------------------------------------------------------------------- /conf/40-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -upr old/linux/drivers/block/aoe/aoeblk.c new/linux/drivers/block/aoe/aoeblk.c 2 | --- old/linux/drivers/block/aoe/aoeblk.c 2013-06-22 18:32:30.000000000 -0400 3 | +++ new/linux/drivers/block/aoe/aoeblk.c 2013-06-22 18:26:20.000000000 -0400 4 | @@ -199,12 +199,6 @@ static const struct file_operations aoe_ 5 | .release = single_release, 6 | }; 7 | 8 | -/* From err.h in later kernels, for use below. */ 9 | -static inline long __must_check IS_ERR_OR_NULL(__force const void *ptr) 10 | -{ 11 | - return !ptr || IS_ERR_VALUE((unsigned long)ptr); 12 | -} 13 | - 14 | static void 15 | aoedisk_add_debugfs(struct aoedev *d) 16 | { 17 | -------------------------------------------------------------------------------- /conf/21-dev.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | static ssize_t aoedisk_show_state(struct device *dev, 10 | struct device_attribute *attr, char *page) 11 | { 12 | struct kobject *kobj = &dev->kobj; /* dev should have kobj */ 13 | struct gendisk *gd = NULL; 14 | 15 | return kobj - (struct kobject *) &gd->dev; /* gd should have dev */ 16 | } 17 | static DEVICE_ATTR(state, S_IRUGO, aoedisk_show_state, NULL); 18 | static struct attribute *aoe_attrs[] = { 19 | &dev_attr_state.attr, 20 | NULL, 21 | }; 22 | -------------------------------------------------------------------------------- /conf/38-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -upr a/linux/drivers/block/aoe/aoe.h b/linux/drivers/block/aoe/aoe.h 2 | --- a/linux/drivers/block/aoe/aoe.h 2013-06-04 18:50:11.000000000 -0400 3 | +++ b/linux/drivers/block/aoe/aoe.h 2013-06-04 18:48:11.000000000 -0400 4 | @@ -266,9 +266,3 @@ void aoedbg_rtt(struct aoedev *d, struct 5 | void aoedbg_devinit(struct aoedev *d); 6 | void aoedbg_undbg(struct aoedev *d); 7 | void aoedbg_exit(void); 8 | - 9 | -/* compatibility: 10 | - * old kernels without compound_trans_head usually do not care if we make 11 | - * count of tail pages temporarily positive 12 | - */ 13 | -static inline struct page *compound_trans_head(struct page *p) {return p;} 14 | -------------------------------------------------------------------------------- /aoetools-36/aoe-revalidate.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # aoe-revalidate - ask aoe driver to query AoE target 3 | # Copyright 2009, CORAID, Inc., and licensed under GPL v.2. 4 | 5 | zero=`basename $0` 6 | f=@devdir@/revalidate 7 | 8 | if test -z "$*"; then 9 | echo 1>&2 Usage: $zero 'e{major}.{minor}' 10 | exit 1 11 | fi 12 | if ! test -w $f; then 13 | echo 1>&2 $zero: $f does not exist or is not writeable 14 | exit 1 15 | fi 16 | if ! test -c $f; then 17 | exec 1>&2 18 | echo "$zero: $f is not a character device file" 19 | echo "$zero: use udev or aoe-mkdevs to create it" 20 | exit 1 21 | fi 22 | echo "$*" > $f || { 23 | echo "$zero: revalidate failed" 1>&2 24 | exit 1 25 | } 26 | 27 | -------------------------------------------------------------------------------- /conf/23-patches/brq1-old.diff: -------------------------------------------------------------------------------- 1 | diff -upr brq1/linux/drivers/block/aoe/aoecmd.c old/linux/drivers/block/aoe/aoecmd.c 2 | --- brq1/linux/drivers/block/aoe/aoecmd.c 2013-05-30 14:22:00.675428624 -0400 3 | +++ old/linux/drivers/block/aoe/aoecmd.c 2013-05-30 15:08:06.359447422 -0400 4 | @@ -1168,8 +1168,12 @@ aoe_end_request(struct aoedev *d, struct 5 | } while (__blk_end_request(rq, bok ? 0 : -EIO, bio->bi_size)); 6 | 7 | /* cf. http://lkml.org/lkml/2006/10/31/28 */ 8 | - if (!fastfail) 9 | - __blk_run_queue(q); 10 | + if (!fastfail) { 11 | + if (!blk_queue_plugged(q)) 12 | + q->request_fn(q); 13 | + else 14 | + __generic_unplug_device(q); 15 | + } 16 | } 17 | 18 | void 19 | -------------------------------------------------------------------------------- /conf/23-patches/brq2-old.diff: -------------------------------------------------------------------------------- 1 | diff -upr brq2/linux/drivers/block/aoe/aoecmd.c old/linux/drivers/block/aoe/aoecmd.c 2 | --- brq2/linux/drivers/block/aoe/aoecmd.c 2013-05-30 15:13:17.488489853 -0400 3 | +++ old/linux/drivers/block/aoe/aoecmd.c 2013-05-30 15:08:06.359447422 -0400 4 | @@ -1168,8 +1168,12 @@ aoe_end_request(struct aoedev *d, struct 5 | } while (__blk_end_request(rq, bok ? 0 : -EIO, bio->bi_size)); 6 | 7 | /* cf. http://lkml.org/lkml/2006/10/31/28 */ 8 | - if (!fastfail) 9 | - __blk_run_queue(q, 0); 10 | + if (!fastfail) { 11 | + if (!blk_queue_plugged(q)) 12 | + q->request_fn(q); 13 | + else 14 | + __generic_unplug_device(q); 15 | + } 16 | } 17 | 18 | void 19 | -------------------------------------------------------------------------------- /conf/23-patches/bsq-old.diff: -------------------------------------------------------------------------------- 1 | diff -upr bsq/linux/drivers/block/aoe/aoecmd.c old/linux/drivers/block/aoe/aoecmd.c 2 | --- bsq/linux/drivers/block/aoe/aoecmd.c 2013-05-30 15:14:32.791474307 -0400 3 | +++ old/linux/drivers/block/aoe/aoecmd.c 2013-05-30 15:08:06.359447422 -0400 4 | @@ -1168,8 +1168,12 @@ aoe_end_request(struct aoedev *d, struct 5 | } while (__blk_end_request(rq, bok ? 0 : -EIO, bio->bi_size)); 6 | 7 | /* cf. http://lkml.org/lkml/2006/10/31/28 */ 8 | - if (!fastfail) 9 | - blk_start_queueing(q); 10 | + if (!fastfail) { 11 | + if (!blk_queue_plugged(q)) 12 | + q->request_fn(q); 13 | + else 14 | + __generic_unplug_device(q); 15 | + } 16 | } 17 | 18 | void 19 | -------------------------------------------------------------------------------- /conf/24-patches/dc-dcd.diff: -------------------------------------------------------------------------------- 1 | diff -upr dc/linux/drivers/block/aoe/aoechr.c dcd/linux/drivers/block/aoe/aoechr.c 2 | --- dc/linux/drivers/block/aoe/aoechr.c 2013-06-19 15:52:32.000000000 -0400 3 | +++ dcd/linux/drivers/block/aoe/aoechr.c 2013-06-04 14:57:11.000000000 -0400 4 | @@ -286,9 +286,9 @@ aoechr_init(void) 5 | return PTR_ERR(aoe_class); 6 | } 7 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 8 | - device_create(aoe_class, NULL, 9 | - MKDEV(AOE_MAJOR, chardevs[i].minor), NULL, 10 | - chardevs[i].name); 11 | + device_create_drvdata(aoe_class, NULL, 12 | + MKDEV(AOE_MAJOR, chardevs[i].minor), 13 | + NULL, chardevs[i].name); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /aoetools-36/aoe-version.8: -------------------------------------------------------------------------------- 1 | .TH aoe-version 8 2 | .SH NAME 3 | aoe-version \- print AoE-related software version information 4 | .SH SYNOPSIS 5 | .nf 6 | .B aoe-version 7 | .fi 8 | .SH DESCRIPTION 9 | The 10 | .I aoe-version 11 | script collects information on running and installed ATA over Ethernet 12 | software, displaying a summary. 13 | .SH EXAMPLE 14 | .IP 15 | .EX 16 | .nf 17 | ellijay:~# aoe-version 18 | aoetools: 17 19 | installed aoe driver: 50 20 | running aoe driver: 50 21 | .fi 22 | .EE 23 | .SH "SEE ALSO" 24 | .IR aoe-discover (8), 25 | .IR aoe-interfaces (8), 26 | .IR aoetools (8), 27 | .IR aoe-stat (8). 28 | .SH AUTHOR 29 | Ed L. Cashin (ecashin@coraid.com) 30 | -------------------------------------------------------------------------------- /conf/26.txt: -------------------------------------------------------------------------------- 1 | The list_replace function appears in v2.6.18-rc1~1081^2~31. 2 | 3 | We can provide it inline for older kernels. 4 | 5 | commit 54e73770357142e297c916c7865f5fca7499f69c 6 | Author: Oleg Nesterov 7 | Date: Fri Jun 23 02:05:54 2006 -0700 8 | 9 | [PATCH] list: introduce list_replace() helper 10 | 11 | list_replace() is similar to list_replace_rcu(), but unlike 12 | list_replace_rcu() it 13 | 14 | could be used when list_empty(old) == 1 15 | 16 | doesn't use barriers 17 | 18 | Signed-off-by: Oleg Nesterov 19 | Signed-off-by: Andrew Morton 20 | Signed-off-by: Linus Torvalds 21 | -------------------------------------------------------------------------------- /conf/12.txt: -------------------------------------------------------------------------------- 1 | As of 2.6.20, the sysfs_create_file function has a return value and 2 | complains if we ignore the results. Jeff Garzik sent a patch that 3 | attends to the results: 4 | 5 | Message-ID: <20061004135819.GA29526@havoc.gtf.org> 6 | 7 | ... but Greg KH had a nicer patch that used the new "group" feature. 8 | 9 | Message-Id: <20061003183705.27E1091A6EB@imap.suse.de> 10 | 11 | Greg's patch had a bug that was subsequently fixed by Dennis Stosberg 12 | in 13 | 14 | Message-ID: <20061113081520.G77d5ed8a@leonov.stosberg.net> 15 | 16 | ... where he added the NULL that was missing from Greg's array. 17 | 18 | For conf/12, we use the groups feature if it is present in the kernel 19 | for which we're building the aoe driver. 20 | -------------------------------------------------------------------------------- /conf/14.txt: -------------------------------------------------------------------------------- 1 | Kernels 2.6.15 and older only have one parameter to 2 | end_that_request_last. 3 | 4 | commit 8ffdc6550c47f75ca4e6c9f30a2a89063e035cf2 5 | Author: Tejun Heo 6 | Date: Fri Jan 6 09:49:03 2006 +0100 7 | 8 | [BLOCK] add @uptodate to end_that_request_last() and @error to rq_end_io_fn() 9 | 10 | add @uptodate argument to end_that_request_last() and @error 11 | to rq_end_io_fn(). there's no generic way to pass error code 12 | to request completion function, making generic error handling 13 | of non-fs request difficult (rq->errors is driver-specific and 14 | each driver uses it differently). this patch adds @uptodate 15 | to end_that_request_last() and @error to rq_end_io_fn(). 16 | 17 | -------------------------------------------------------------------------------- /conf/21-patches/dev-dtd.diff: -------------------------------------------------------------------------------- 1 | diff -upr dev/linux/drivers/block/aoe/aoeblk.c dtd/linux/drivers/block/aoe/aoeblk.c 2 | --- dev/linux/drivers/block/aoe/aoeblk.c 2013-06-22 15:45:14.000000000 -0400 3 | +++ dtd/linux/drivers/block/aoe/aoeblk.c 2013-06-19 01:27:11.000000000 -0400 4 | @@ -232,12 +232,12 @@ aoedisk_rm_debugfs(struct aoedev *d) 5 | static int 6 | aoedisk_add_sysfs(struct aoedev *d) 7 | { 8 | - return sysfs_create_group(&d->gd->dev.kobj, &attr_group); 9 | + return sysfs_create_group(&disk_to_dev(d->gd)->kobj, &attr_group); 10 | } 11 | void 12 | aoedisk_rm_sysfs(struct aoedev *d) 13 | { 14 | - sysfs_remove_group(&d->gd->dev.kobj, &attr_group); 15 | + sysfs_remove_group(&disk_to_dev(d->gd)->kobj, &attr_group); 16 | } 17 | 18 | static int 19 | -------------------------------------------------------------------------------- /conf/20.txt: -------------------------------------------------------------------------------- 1 | There seems to be a trend where a nice, general and symmetrical user 2 | interfaces in the kernel will be made less capable by the removal of 3 | unused parts, just because no in-kernel code is using the interface to 4 | its full potential yet. 5 | 6 | If we could get changes into the kernel more quickly, then we wouldn't 7 | have the rug pulled out from under us (I hope). 8 | 9 | commit 5705f7021748a69d84d6567e68e8851dab551464 10 | Author: NeilBrown 11 | Date: Tue Sep 25 12:35:59 2007 +0200 12 | 13 | Introduce rq_for_each_segment replacing rq_for_each_bio 14 | 15 | Every usage of rq_for_each_bio wraps a usage of 16 | bio_for_each_segment, so these can be combined into 17 | rq_for_each_segment. 18 | 19 | -------------------------------------------------------------------------------- /conf/24-av.sh: -------------------------------------------------------------------------------- 1 | f=linux/drivers/block/aoe/aoechr.c 2 | # skip this compat test if 2 made the aoe sources use class_simple 3 | old="`grep 'class_simple' $f`" 4 | test "$old" && { echo skip; exit 0; } 5 | 6 | # look to see whether the source is already new-style 7 | cdc5="`grep 'class_device_create.aoe_class, NULL' $f`" 8 | test "$cdc5" && { echo cdc5; exit 0; } 9 | 10 | cdc4="`grep 'class_device_create.aoe_class,$' $f`" 11 | test "$cdc4" && { echo cdc4; exit 0; } 12 | 13 | dcd="`grep 'device_create_drvdata.aoe_class, NULL' $f`" 14 | test "$dcd" && { echo dcd; exit 0; } 15 | 16 | dc="`fgrep 'device_create(aoe_class, NULL,' $f`" 17 | test "$dc" && { echo dc; exit 0; } 18 | 19 | echo "`basename $0` Error: could not identify aoe source state" 1>&2 20 | exit 1 21 | -------------------------------------------------------------------------------- /conf/30.txt: -------------------------------------------------------------------------------- 1 | 2.6.30 no longer defines WIN_READ, etc., except *outside* of kernel 2 | sources. 3 | 4 | In older kernels the ATA_CMD_PIO_* values are present, but in 2.6.9, 5 | for instance, you can't include both hdreg.h and ata.h, so we support 6 | those old kernels by using the WIN_* macros. 7 | 8 | commit 04b3ab52a000ab7e718efc97e9fdd67d95002d11 9 | Author: Bartlomiej Zolnierkiewicz 10 | Date: Wed Apr 1 21:42:24 2009 +0200 11 | 12 | aoe: WIN_* -> ATA_CMD_* 13 | 14 | * Use ATA_CMD_* defines instead of WIN_* ones. 15 | 16 | * Include directly instead of through . 17 | 18 | Cc: Ed L. Cashin 19 | Signed-off-by: Bartlomiej Zolnierkiewicz 20 | -------------------------------------------------------------------------------- /conf/29-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff --git a/linux/drivers/block/aoe/aoeblk.c b/linux/drivers/block/aoe/aoeblk.c 2 | index a57316a..677584e 100644 3 | --- a/linux/drivers/block/aoe/aoeblk.c 4 | +++ b/linux/drivers/block/aoe/aoeblk.c 5 | @@ -278,14 +278,14 @@ aoeblk_getgeo(struct block_device *bdev, struct hd_geometry *geo) 6 | } 7 | 8 | static int 9 | -aoeblk_ioctl(struct inode *inode, struct file *filp, uint cmd, ulong arg) 10 | +aoeblk_ioctl(struct block_device *bdev, fmode_t mode, uint cmd, ulong arg) 11 | { 12 | struct aoedev *d; 13 | 14 | if (!arg) 15 | return -EINVAL; 16 | 17 | - d = inode->i_bdev->bd_disk->private_data; 18 | + d = bdev->bd_disk->private_data; 19 | if ((d->flags & DEVFL_UP) == 0) { 20 | printk(KERN_ERR "aoe: disk not up\n"); 21 | return -ENODEV; 22 | -------------------------------------------------------------------------------- /conf/21.txt: -------------------------------------------------------------------------------- 1 | Kernel 2.6.25 changed the way block devices appear in sysfs, and we 2 | now must use "core devices" instead of raw disks. See, 3 | 4 | commit edfaa7c36574f1bf09c65ad602412db9da5f96bf 5 | 6 | ... for details. 7 | 8 | Then 2.6.28 made the "dev" member inaccessible, so we must use the new 9 | disk_to_dev. 10 | 11 | commit ed9e1982347b36573cd622ee5f4e2a7ccd79b3fd 12 | 13 | The three states are, 14 | 15 | gd 16 | 17 | Pre-2.6.25, with a pointer to gendisk passed to 18 | aoedisk_show_state. 19 | 20 | dev 21 | 22 | A struct device pointer is passed to aoedisk_show_state, and such 23 | a pointer is accessible via gd->dev. 24 | 25 | The gendisk struct doesn't have a kobj member. 26 | 27 | dtd NEW 28 | 29 | The gd->dev member is inaccessible as of 2.6.28. 30 | -------------------------------------------------------------------------------- /conf/26-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -upr old/linux/drivers/block/aoe/aoecmd.c new/linux/drivers/block/aoe/aoecmd.c 2 | --- old/linux/drivers/block/aoe/aoecmd.c 2008-12-02 13:45:25.000000000 -0500 3 | +++ new/linux/drivers/block/aoe/aoecmd.c 2008-12-02 10:03:07.000000000 -0500 4 | @@ -654,18 +654,6 @@ rto(struct aoedev *d) 5 | return t; 6 | } 7 | 8 | -/* list_replace appears in 2.6.18 9 | - * The implementation is copied here for older kernels. 10 | - */ 11 | -static inline void list_replace(struct list_head *old, 12 | - struct list_head *new) 13 | -{ 14 | - new->next = old->next; 15 | - new->next->prev = new; 16 | - new->prev = old->prev; 17 | - new->prev->next = new; 18 | -} 19 | - 20 | static void 21 | rexmit_deferred(struct aoedev *d) 22 | { 23 | -------------------------------------------------------------------------------- /conf/38.txt: -------------------------------------------------------------------------------- 1 | We are using compound_trans_head to find the page that holds the reference 2 | count for a given page associated with a biovec. 3 | 4 | The function first appears in a 2011 commit that is contained in the 5 | v2.6.38-rc1~99 but has been backported to the RHEL 6 2.6.32 kernel. 6 | 7 | commit 22e5c47ee238abe636655c3862ed28d6eb084ad4 8 | Author: Andrea Arcangeli 9 | Date: Thu Jan 13 15:47:20 2011 -0800 10 | 11 | thp: add compound_trans_head() helper 12 | 13 | Cleanup some code with common compound_trans_head helper. 14 | 15 | Before we were using this, older kernels didn't mind that we were 16 | temporarily incrementing the reference count of tail pages, so for 17 | compatibility we use a stub that simply returns whatever page it is 18 | sent. 19 | -------------------------------------------------------------------------------- /conf/23-kv.sh: -------------------------------------------------------------------------------- 1 | . conf/kv.sh 2 | 3 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO-brq1"'.o' > conf/Makefile 4 | log=conf/$TESTNO-brq1.log 5 | $make_cmd > $log 2>&1 6 | test "$?" = "0" && 7 | test -z "`egrep -i '(warning|error).*blk_run_queue' $log`" && 8 | { echo brq1; exit 0; } 9 | 10 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO-brq2"'.o' > conf/Makefile 11 | log=conf/$TESTNO-brq2.log 12 | $make_cmd > $log 2>&1 13 | test "$?" = "0" && 14 | test -z "`egrep -i '(warning|error).*blk_run_queue' $log`" && 15 | { echo brq2; exit 0; } 16 | 17 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO-bsq"'.o' > conf/Makefile 18 | log=conf/$TESTNO-bsq.log 19 | $make_cmd > $log 2>&1 20 | test "$?" = "0" && 21 | test -z "`egrep -i '(warning|error).*blk_start_queueing' $log`" && 22 | { echo bsq; exit 0; } 23 | 24 | echo old 25 | -------------------------------------------------------------------------------- /conf/34-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -upr old/linux/drivers/block/aoe/aoeblk.c new/linux/drivers/block/aoe/aoeblk.c 2 | --- old/linux/drivers/block/aoe/aoeblk.c 2013-06-20 15:01:07.540605241 -0400 3 | +++ new/linux/drivers/block/aoe/aoeblk.c 2013-06-19 15:52:32.000000000 -0400 4 | @@ -164,11 +164,7 @@ static DEVICE_ATTR(state, S_IRUGO, aoedi 5 | static DEVICE_ATTR(mac, S_IRUGO, aoedisk_show_mac, NULL); 6 | static DEVICE_ATTR(netif, S_IRUGO, aoedisk_show_netif, NULL); 7 | static struct device_attribute dev_attr_firmware_version = { 8 | - .attr = { 9 | - .name = "firmware-version", 10 | - .mode = S_IRUGO, 11 | - .owner = THIS_MODULE, 12 | - }, 13 | + .attr = { .name = "firmware-version", .mode = S_IRUGO }, 14 | .show = aoedisk_show_fwver, 15 | }; 16 | static DEVICE_ATTR(payload, S_IRUGO, aoedisk_show_payload, NULL); 17 | -------------------------------------------------------------------------------- /conf/42-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff --git a/linux/drivers/block/aoe/aoeblk.c b/linux/drivers/block/aoe/aoeblk.c 2 | index 7fe7119..0340040 100644 3 | --- a/linux/drivers/block/aoe/aoeblk.c 4 | +++ b/linux/drivers/block/aoe/aoeblk.c 5 | @@ -266,7 +266,7 @@ aoeblk_open(struct block_device *bdev, fmode_t mode) 6 | return -ENODEV; 7 | } 8 | 9 | -static int 10 | +static void 11 | aoeblk_release(struct gendisk *disk, fmode_t mode) 12 | { 13 | struct aoedev *d = disk->private_data; 14 | @@ -277,11 +277,9 @@ aoeblk_release(struct gendisk *disk, fmode_t mode) 15 | if (--d->nopen == 0) { 16 | spin_unlock_irqrestore(&d->lock, flags); 17 | aoecmd_cfg(d->aoemajor, d->aoeminor); 18 | - return 0; 19 | + return; 20 | } 21 | spin_unlock_irqrestore(&d->lock, flags); 22 | - 23 | - return 0; 24 | } 25 | 26 | static void 27 | -------------------------------------------------------------------------------- /linux/Documentation/aoe/status.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # collate and present sysfs information about AoE storage 3 | # 4 | # A more complete version of this script is aoe-stat, in the 5 | # aoetools. 6 | 7 | set -e 8 | format="%8s\t%8s\t%8s\n" 9 | me=`basename $0` 10 | sysd=${sysfs_dir:-/sys} 11 | 12 | # printf "$format" device mac netif state 13 | 14 | # Suse 9.1 Pro doesn't put /sys in /etc/mtab 15 | #test -z "`mount | grep sysfs`" && { 16 | test ! -d "$sysd/block" && { 17 | echo "$me Error: sysfs is not mounted" 1>&2 18 | exit 1 19 | } 20 | 21 | for d in `ls -d $sysd/block/etherd* 2>/dev/null | grep -v p` end; do 22 | # maybe ls comes up empty, so we use "end" 23 | test $d = end && continue 24 | 25 | dev=`echo "$d" | sed 's/.*!//'` 26 | printf "$format" \ 27 | "$dev" \ 28 | "`cat \"$d/netif\"`" \ 29 | "`cat \"$d/state\"`" 30 | done | sort 31 | -------------------------------------------------------------------------------- /linux/Documentation/aoe/todo.txt: -------------------------------------------------------------------------------- 1 | There is a potential for deadlock when allocating a struct sk_buff for 2 | data that needs to be written out to aoe storage. If the data is 3 | being written from a dirty page in order to free that page, and if 4 | there are no other pages available, then deadlock may occur when a 5 | free page is needed for the sk_buff allocation. This situation has 6 | not been observed, but it would be nice to eliminate any potential for 7 | deadlock under memory pressure. 8 | 9 | Because ATA over Ethernet is not fragmented by the kernel's IP code, 10 | the destructor member of the struct sk_buff is available to the aoe 11 | driver. By using a mempool for allocating all but the first few 12 | sk_buffs, and by registering a destructor, we should be able to 13 | efficiently allocate sk_buffs without introducing any potential for 14 | deadlock. 15 | -------------------------------------------------------------------------------- /conf/13-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff --git a/linux/drivers/block/aoe/aoecmd.c b/linux/drivers/block/aoe/aoecmd.c 2 | index acc54b8..8e5e879 100644 3 | --- a/linux/drivers/block/aoe/aoecmd.c 4 | +++ b/linux/drivers/block/aoe/aoecmd.c 5 | @@ -905,20 +905,16 @@ void 6 | aoe_end_request(struct aoedev *d, struct request *rq, int fastfail) 7 | { 8 | struct bio *bio; 9 | - int bok, rok; 10 | + int bok; 11 | struct request_queue *q; 12 | 13 | q = d->blkq; 14 | if (rq == d->ip.rq) 15 | d->ip.rq = NULL; 16 | - rok = 1; 17 | do { 18 | bio = rq->bio; 19 | bok = !fastfail && test_bit(BIO_UPTODATE, &bio->bi_flags); 20 | - if (!bok) 21 | - rok = 0; 22 | - } while (end_that_request_first(rq, bok, bio->bi_size / 512)); 23 | - end_that_request_last(rq, rok); 24 | + } while (__blk_end_request(rq, bok ? 0 : -EIO, bio->bi_size)); 25 | 26 | if (!fastfail) { 27 | // cf. http://lkml.org/lkml/2006/10/31/28 28 | -------------------------------------------------------------------------------- /conf/24-patches/cdc4-dcd.diff: -------------------------------------------------------------------------------- 1 | diff -upr cdc4/linux/drivers/block/aoe/aoechr.c dcd/linux/drivers/block/aoe/aoechr.c 2 | --- cdc4/linux/drivers/block/aoe/aoechr.c 2013-06-04 14:49:44.000000000 -0400 3 | +++ dcd/linux/drivers/block/aoe/aoechr.c 2013-06-04 14:57:11.000000000 -0400 4 | @@ -286,7 +286,7 @@ aoechr_init(void) 5 | return PTR_ERR(aoe_class); 6 | } 7 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 8 | - class_device_create(aoe_class, 9 | + device_create_drvdata(aoe_class, NULL, 10 | MKDEV(AOE_MAJOR, chardevs[i].minor), 11 | NULL, chardevs[i].name); 12 | 13 | @@ -299,7 +299,7 @@ aoechr_exit(void) 14 | int i; 15 | 16 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 17 | - class_device_destroy(aoe_class, MKDEV(AOE_MAJOR, chardevs[i].minor)); 18 | + device_destroy(aoe_class, MKDEV(AOE_MAJOR, chardevs[i].minor)); 19 | class_destroy(aoe_class); 20 | unregister_chrdev(AOE_MAJOR, "aoechr"); 21 | } 22 | -------------------------------------------------------------------------------- /conf/24-patches/cdc5-dcd.diff: -------------------------------------------------------------------------------- 1 | diff -upr cdc5/linux/drivers/block/aoe/aoechr.c dcd/linux/drivers/block/aoe/aoechr.c 2 | --- cdc5/linux/drivers/block/aoe/aoechr.c 2013-06-04 14:53:53.000000000 -0400 3 | +++ dcd/linux/drivers/block/aoe/aoechr.c 2013-06-04 14:57:11.000000000 -0400 4 | @@ -286,7 +286,7 @@ aoechr_init(void) 5 | return PTR_ERR(aoe_class); 6 | } 7 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 8 | - class_device_create(aoe_class, NULL, 9 | + device_create_drvdata(aoe_class, NULL, 10 | MKDEV(AOE_MAJOR, chardevs[i].minor), 11 | NULL, chardevs[i].name); 12 | 13 | @@ -299,7 +299,7 @@ aoechr_exit(void) 14 | int i; 15 | 16 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 17 | - class_device_destroy(aoe_class, MKDEV(AOE_MAJOR, chardevs[i].minor)); 18 | + device_destroy(aoe_class, MKDEV(AOE_MAJOR, chardevs[i].minor)); 19 | class_destroy(aoe_class); 20 | unregister_chrdev(AOE_MAJOR, "aoechr"); 21 | } 22 | -------------------------------------------------------------------------------- /conf/25.txt: -------------------------------------------------------------------------------- 1 | Not all kernels have relay (formerly relayfs) support. When they do, 2 | there are a few forms. 3 | 4 | none 5 | No relay support. 6 | 7 | fs5 8 | The first relayfs in Linus's tree uses relayfs_fs.h with 5 9 | parms to relay_open. 10 | 11 | commit e82894f84dbba130ab46c97748c03647f8204f92 12 | Author: Tom Zanussi 13 | Date: Tue Sep 6 15:16:30 2005 -0700 14 | 15 | This commit appears in v2.6.14-rc1~734. 16 | 17 | relay5 18 | Then it was made "relay", not "relayfs", and the header file 19 | changed. 20 | 21 | commit b86ff981a8252d83d6a7719ae09f3a05307e3592 22 | Author: Jens Axboe 23 | Date: Thu Mar 23 19:56:55 2006 +0100 24 | 25 | relay6 NEW 26 | Finally a private data parameter was added to relay_open. 27 | 28 | commit 23c887522e912ca494950796a95df8dd210f4b01 29 | Author: Mathieu Desnoyers 30 | Date: Sat Feb 10 01:45:05 2007 -0800 31 | 32 | -------------------------------------------------------------------------------- /conf/24-kv.sh: -------------------------------------------------------------------------------- 1 | # skip this compat test if 2 made the aoe sources use class_simple 2 | old="`grep 'class_simple' linux/drivers/block/aoe/aoechr.c`" 3 | test "$old" && { echo skip; exit 0; } 4 | 5 | . conf/kv.sh 6 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO-cdc4"'.o' > conf/Makefile 7 | $make_cmd > conf/$TESTNO-cdc4.log 2>&1 8 | test "$?" = "0" && { echo cdc4; exit 0; } 9 | 10 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO-cdc5"'.o' > conf/Makefile 11 | $make_cmd > conf/$TESTNO-cdc5.log 2>&1 12 | test "$?" = "0" && { echo cdc5; exit 0; } 13 | 14 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO-dcd"'.o' > conf/Makefile 15 | $make_cmd > conf/$TESTNO-dcd.log 2>&1 16 | test "$?" = "0" && { echo dcd; exit 0; } 17 | 18 | echo 'obj-$(CONFIG_ATA_OVER_ETH) += '"$TESTNO-dc"'.o' > conf/Makefile 19 | $make_cmd > conf/$TESTNO-dc.log 2>&1 20 | test "$?" = "0" && { echo dc; exit 0; } 21 | 22 | echo "`basename $0` Error: could not identify kernel source state" 1>&2 23 | exit 1 24 | -------------------------------------------------------------------------------- /conf/22.txt: -------------------------------------------------------------------------------- 1 | When they added getgeo to the block device methods, we kept using 2 | ioctl-based get geometry in the standalone aoe driver, since it has 3 | greater backwards compatibility. Then on some kernels, the old 4 | ioctl-based method was no longer working, e.g., when blktool tries to 5 | get info about the device. 6 | 7 | So now we use the getgeo block device method when it is available. 8 | 9 | commit a885c8c4316e1c1d2d2c8755da3f3d14f852528d 10 | Author: Christoph Hellwig 11 | Date: Sun Jan 8 01:02:50 2006 -0800 12 | 13 | [PATCH] Add block_device_operations.getgeo block device method 14 | 15 | HDIO_GETGEO is implemented in most block drivers, and all of them have to 16 | duplicate the code to copy the structure to userspace, as well as getting 17 | the start sector. This patch moves that to common code [1] and adds a 18 | ->getgeo method to fill out the raw kernel hd_geometry structure. For many 19 | drivers this means ->ioctl can go away now. 20 | 21 | -------------------------------------------------------------------------------- /conf/9-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -upr a/linux/drivers/block/aoe/aoeblk.c b/linux/drivers/block/aoe/aoeblk.c 2 | --- a/linux/drivers/block/aoe/aoeblk.c 2007-07-09 15:43:36.000000000 -0400 3 | +++ b/linux/drivers/block/aoe/aoeblk.c 2007-07-09 15:42:58.000000000 -0400 4 | @@ -23,7 +23,7 @@ aoe_bio_pagedec(struct bio *bio) 5 | int i; 6 | 7 | bio_for_each_segment(bv, bio, i) 8 | - atomic_dec(&bv->bv_page->count); 9 | + atomic_dec(&bv->bv_page->_count); 10 | } 11 | 12 | static ssize_t aoedisk_show_state(struct gendisk *disk, char *page) 13 | diff -upr a/linux/drivers/block/aoe/aoecmd.c b/linux/drivers/block/aoe/aoecmd.c 14 | --- a/linux/drivers/block/aoe/aoecmd.c 2007-07-09 15:43:36.000000000 -0400 15 | +++ b/linux/drivers/block/aoe/aoecmd.c 2007-07-09 15:42:53.000000000 -0400 16 | @@ -672,7 +672,7 @@ bio_pageinc(struct bio *bio) 17 | int i; 18 | 19 | bio_for_each_segment(bv, bio, i) 20 | - atomic_inc(&bv->bv_page->count); 21 | + atomic_inc(&bv->bv_page->_count); 22 | } 23 | 24 | static void 25 | -------------------------------------------------------------------------------- /conf/36-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -uprx '*.orig' -x '*.rej' old/linux/drivers/block/aoe/aoeblk.c new/linux/drivers/block/aoe/aoeblk.c 2 | --- old/linux/drivers/block/aoe/aoeblk.c 2013-06-22 17:59:14.000000000 -0400 3 | +++ new/linux/drivers/block/aoe/aoeblk.c 2013-06-22 17:56:32.000000000 -0400 4 | @@ -10,6 +10,8 @@ 5 | #include 6 | #include 7 | #include 8 | +#include 9 | +#include 10 | #include 11 | #include 12 | #include "aoe.h" 13 | diff -uprx '*.orig' -x '*.rej' old/linux/drivers/block/aoe/aoechr.c new/linux/drivers/block/aoe/aoechr.c 14 | --- old/linux/drivers/block/aoe/aoechr.c 2013-06-22 17:58:06.000000000 -0400 15 | +++ new/linux/drivers/block/aoe/aoechr.c 2013-06-22 17:56:32.000000000 -0400 16 | @@ -10,6 +10,7 @@ 17 | #include 18 | #include 19 | #include 20 | +#include 21 | #include "aoe.h" 22 | 23 | enum { 24 | -------------------------------------------------------------------------------- /conf/24-patches/cdc4-dc.diff: -------------------------------------------------------------------------------- 1 | diff -upr cdc4/linux/drivers/block/aoe/aoechr.c dc/linux/drivers/block/aoe/aoechr.c 2 | --- cdc4/linux/drivers/block/aoe/aoechr.c 2013-06-04 14:49:44.000000000 -0400 3 | +++ dc/linux/drivers/block/aoe/aoechr.c 2013-06-19 15:52:32.000000000 -0400 4 | @@ -286,9 +286,9 @@ aoechr_init(void) 5 | return PTR_ERR(aoe_class); 6 | } 7 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 8 | - class_device_create(aoe_class, 9 | - MKDEV(AOE_MAJOR, chardevs[i].minor), 10 | - NULL, chardevs[i].name); 11 | + device_create(aoe_class, NULL, 12 | + MKDEV(AOE_MAJOR, chardevs[i].minor), NULL, 13 | + chardevs[i].name); 14 | 15 | return 0; 16 | } 17 | @@ -299,7 +299,7 @@ aoechr_exit(void) 18 | int i; 19 | 20 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 21 | - class_device_destroy(aoe_class, MKDEV(AOE_MAJOR, chardevs[i].minor)); 22 | + device_destroy(aoe_class, MKDEV(AOE_MAJOR, chardevs[i].minor)); 23 | class_destroy(aoe_class); 24 | unregister_chrdev(AOE_MAJOR, "aoechr"); 25 | } 26 | -------------------------------------------------------------------------------- /conf/24-patches/cdc5-dc.diff: -------------------------------------------------------------------------------- 1 | diff -upr cdc5/linux/drivers/block/aoe/aoechr.c dc/linux/drivers/block/aoe/aoechr.c 2 | --- cdc5/linux/drivers/block/aoe/aoechr.c 2013-06-04 14:53:53.000000000 -0400 3 | +++ dc/linux/drivers/block/aoe/aoechr.c 2013-06-19 15:52:32.000000000 -0400 4 | @@ -286,9 +286,9 @@ aoechr_init(void) 5 | return PTR_ERR(aoe_class); 6 | } 7 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 8 | - class_device_create(aoe_class, NULL, 9 | - MKDEV(AOE_MAJOR, chardevs[i].minor), 10 | - NULL, chardevs[i].name); 11 | + device_create(aoe_class, NULL, 12 | + MKDEV(AOE_MAJOR, chardevs[i].minor), NULL, 13 | + chardevs[i].name); 14 | 15 | return 0; 16 | } 17 | @@ -299,7 +299,7 @@ aoechr_exit(void) 18 | int i; 19 | 20 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 21 | - class_device_destroy(aoe_class, MKDEV(AOE_MAJOR, chardevs[i].minor)); 22 | + device_destroy(aoe_class, MKDEV(AOE_MAJOR, chardevs[i].minor)); 23 | class_destroy(aoe_class); 24 | unregister_chrdev(AOE_MAJOR, "aoechr"); 25 | } 26 | -------------------------------------------------------------------------------- /aoetools-36/aoe-revalidate.8: -------------------------------------------------------------------------------- 1 | .TH aoe-revalidate 8 2 | .SH NAME 3 | aoe-revalidate \- revalidate the disk size of an aoe device 4 | .SH SYNOPSIS 5 | .nf 6 | .B aoe-revalidate e{major}.{minor} 7 | .fi 8 | .SH DESCRIPTION 9 | The 10 | .I aoe-revalidate 11 | command tells the aoe driver to revalidate the disk size of an open aoe device. 12 | Normally the aoe driver will only acknowledge changes in an aoe device's 13 | disk size when the aoe device is not open. 14 | .PP 15 | It should be noted that if an aoe device's disk size shrinks in revalidation 16 | any users may become hopelessly confused when their resumed I/O starts to fail. 17 | .SH EXAMPLE 18 | .EX 19 | .nf 20 | nai# aoe-stat | grep e1.9 21 | e1.9 82.348GB eth0 up 22 | nai# < /dev/etherd/e1.9 sleep 600 & 23 | [1] 13006 24 | nai# aoe-revalidate e1.9 25 | nai# aoe-stat | grep e1.9 26 | e1.9 164.696GB eth0 up 27 | .fi 28 | .EE 29 | .SH "SEE ALSO" 30 | .IR aoe-stat (8), 31 | .IR aoetools (8). 32 | .SH AUTHOR 33 | Sam Hopkins (sah@coraid.com) 34 | -------------------------------------------------------------------------------- /aoetools-36/HACKING: -------------------------------------------------------------------------------- 1 | Contributing 2 | 3 | Thanks for your interest in contributing to the aoetools. The best 4 | way to submit proposed changes is in plain-text "patches". These 5 | patches are generated by the diff program. 6 | 7 | Patches should be clean (to the point and easy to read) and should do 8 | one thing. Send multiple patches if necessary. Patches should be 9 | generated with "diff -uprN" if possible, and should be designed to be 10 | applied with "patch -p1". 11 | 12 | 13 | Design note: 14 | 15 | The aoe-mkdevs and aoe-mkshelf scripts are expected to work with 16 | special device files forever, but the aoe-discover script will likely 17 | someday use sysfs or something similar instead of 18 | /dev/etherd/discover. The same goes for aoe-interfaces. For that 19 | reason, there is no runtime interface for giving aoe-discover an 20 | alternative to /dev/etherd at runtime. Instead, the device directory 21 | is set once and for all by make. That way, the user interface won't 22 | change or become obsolete when aoe-discover stops using 23 | /dev/etherd/discover. 24 | -------------------------------------------------------------------------------- /aoetools-36/coraid-update.8: -------------------------------------------------------------------------------- 1 | .TH coraid-update 8 2 | .SH NAME 3 | coraid-update \- upload an update file to a CORAID appliance 4 | .SH SYNOPSIS 5 | .nf 6 | .B coraid-update {update file} {AoE device} 7 | .fi 8 | .SH DESCRIPTION 9 | The 10 | .I coraid-update 11 | script performs a few sanity checks before copying the local 12 | update 13 | file to the remote update AoE target on the CORAID appliance. 14 | .PP 15 | Two arguments are provided: 1) the name of the update file 16 | to be uploaded, and 2) the special block device file corresponding 17 | to the 18 | update target, e.g., \fI/dev/etherd/e100.40\fP. 19 | .PP 20 | It generates no output and exits with a zero status when the update 21 | file has been successfully uploaded 22 | to the update target on the appliance. Otherwise, an error message is 23 | printed to standard error and \fI coraid-update\fR exits with a 24 | non-zero status. 25 | .SH "SEE ALSO" 26 | .IR aoe-discover (8), 27 | .IR aoe-interfaces (8), 28 | .IR aoe-stat (8), 29 | .IR aoetools (8), 30 | .IR udev (7). 31 | .SH AUTHOR 32 | Ed L. Cashin (ecashin@coraid.com) 33 | -------------------------------------------------------------------------------- /conf/15-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | --- aoe6-stand/linux/drivers/block/aoe/aoecmd.c.20070815 2007-08-15 17:29:30.000000000 -0400 2 | +++ aoe6-stand/linux/drivers/block/aoe/aoecmd.c 2007-08-15 16:01:53.000000000 -0400 3 | @@ -37,22 +37,6 @@ static struct { 4 | spinlock_t lock; 5 | } iocq; 6 | 7 | -static void 8 | -skb_reset_network_header(struct sk_buff *skb) 9 | -{ 10 | - skb->nh.raw = skb->data; 11 | -} 12 | -static void 13 | -skb_reset_mac_header(struct sk_buff *skb) 14 | -{ 15 | - skb->mac.raw = skb->data; 16 | -} 17 | -void * 18 | -skb_mac_header(struct sk_buff *skb) 19 | -{ 20 | - return skb->mac.raw; 21 | -} 22 | - 23 | static struct sk_buff * 24 | new_skb(ulong len) 25 | { 26 | --- aoe6-83+/linux/drivers/block/aoe/aoenet.c 2013-05-30 14:20:22.000000000 -0400 27 | +++ aoe6-83+/linux/drivers/block/aoe/aoenet.c.orig 2013-05-30 14:28:23.000000000 -0400 28 | @@ -49,8 +49,6 @@ 29 | static spinlock_t txlock; 30 | static struct sk_buff_head skbtxq; 31 | 32 | -void *skb_mac_header(struct sk_buff *skb); 33 | - 34 | /* enters with txlock held */ 35 | static int 36 | tx(int id) 37 | -------------------------------------------------------------------------------- /conf/28-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff --git a/linux/drivers/block/aoe/aoeblk.c b/linux/drivers/block/aoe/aoeblk.c 2 | index 9e196f7..18146b8 100644 3 | --- a/linux/drivers/block/aoe/aoeblk.c 4 | +++ b/linux/drivers/block/aoe/aoeblk.c 5 | @@ -199,12 +199,11 @@ aoedisk_rm_sysfs(struct aoedev *d) 6 | } 7 | 8 | static int 9 | -aoeblk_open(struct inode *inode, struct file *filp) 10 | +aoeblk_open(struct block_device *bdev, fmode_t mode) 11 | { 12 | - struct aoedev *d; 13 | + struct aoedev *d = bdev->bd_disk->private_data; 14 | ulong flags; 15 | 16 | - d = inode->i_bdev->bd_disk->private_data; 17 | if (!virt_addr_valid(d)) { 18 | printk(KERN_CRIT 19 | "aoe: invalid device pointer in %s\n", 20 | @@ -226,13 +225,11 @@ aoeblk_open(struct inode *inode, struct file *filp) 21 | } 22 | 23 | static int 24 | -aoeblk_release(struct inode *inode, struct file *filp) 25 | +aoeblk_release(struct gendisk *disk, fmode_t mode) 26 | { 27 | - struct aoedev *d; 28 | + struct aoedev *d = disk->private_data; 29 | ulong flags; 30 | 31 | - d = inode->i_bdev->bd_disk->private_data; 32 | - 33 | spin_lock_irqsave(&d->lock, flags); 34 | 35 | if (--d->nopen == 0) { 36 | -------------------------------------------------------------------------------- /conf/35-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | --- a/linux/drivers/block/aoe/aoechr.c.old 2013-05-30 10:55:29.237409949 -0400 2 | +++ a/linux/drivers/block/aoe/aoechr.c 2013-05-30 10:54:46.538481086 -0400 3 | @@ -9,7 +9,7 @@ 4 | #include 5 | #include 6 | #include 7 | -#include 8 | +#include 9 | #include 10 | #include "aoe.h" 11 | 12 | @@ -54,6 +54,7 @@ static struct aoe_chardev chardevs[] = { 13 | { MINOR_REVALIDATE, "revalidate" }, 14 | { MINOR_FLUSH, "flush" }, 15 | }; 16 | +static DEFINE_MUTEX(aoechr_mutex); 17 | 18 | static int 19 | discover(void) 20 | @@ -182,16 +183,16 @@ aoechr_open(struct inode *inode, struct 21 | { 22 | int n, i; 23 | 24 | - lock_kernel(); 25 | + mutex_lock(&aoechr_mutex); 26 | n = MINOR(inode->i_rdev); 27 | filp->private_data = (void *) (unsigned long) n; 28 | 29 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 30 | if (chardevs[i].minor == n) { 31 | - unlock_kernel(); 32 | + mutex_unlock(&aoechr_mutex); 33 | return 0; 34 | } 35 | - unlock_kernel(); 36 | + mutex_unlock(&aoechr_mutex); 37 | return -EINVAL; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mothballed Standalone AoE Driver 2 | 3 | This repository contains the standalone, source-only distribution of 4 | the aoe driver. Current Linux kernels contain an aoe driver v85 or 5 | greater, and that in-kernel aoe driver has all the features of this 6 | one (and possibly more). 7 | 8 | The standalone driver was useful when more experimental features were 9 | being developed and when the popular Linux distributions lacked an 10 | up-to-date aoe driver. Today the distro kernels have caught up, and 11 | after installing the aoetools, you can use the aoe driver in your 12 | distro's kernel after doing `modprobe aoe`. 13 | 14 | Using your own aoe driver is the recommended way. As the upstream 15 | kernel changes, this standalone driver will become difficult to use 16 | without repeated additions to the compatibility system under `conf/`. 17 | The 4.8.x kernel and greater are not supported. 18 | 19 | We hope to include documentation here helping with tips on how to 20 | modify the aoe drivers inside the most popular Linux distributions by 21 | using their kernel source packages. 22 | 23 | Meanwhile, the old README is still here as *README-old.md* for the 24 | adventurous. -------------------------------------------------------------------------------- /conf/pairs.sh: -------------------------------------------------------------------------------- 1 | # Given a set of tags representing kernel states, you don't need to 2 | # have patches that go from one state to the same state, nor do you 3 | # need a patch for each direction, since patch takes "-R". 4 | # 5 | # If I had had more sleep lately, I probably wouldn't have written 6 | # this script. As it stands, it will print out all the patches you'd 7 | # need as pairs of tags. 8 | # 9 | # ecashin@kokone 25$ pwd 10 | # /home/ecashin/aoe-2.6-devel/conf-states/25 11 | # ecashin@kokone 25$ ls 12 | # fs5 none relay5 relay6 13 | # ecashin@kokone 25$ for i in `ls`; do echo $i; done | sh ~/aoe6-stand/conf/pairs.sh | while read a b; do diff -upr $a $b > ~/aoe6-stand/conf/25-patches/$a-$b.diff; done 14 | # ecashin@kokone 25$ 15 | # 16 | 17 | awk 'BEGIN{ 18 | i=0 19 | done["available"] = "yes" 20 | } 21 | { 22 | a[i] = $0 23 | b[i] = $0 24 | i += 1 25 | } 26 | END { 27 | n = i 28 | for (i=0; i&2 "$zero: $f does not exist or is not writeable." 11 | exit 1 12 | fi 13 | if ! test -c $f; then 14 | exec 1>&2 15 | echo "$zero: $f is not a character device file" 16 | echo "$zero: use udev or aoe-mkdevs to create it" 17 | exit 1 18 | fi 19 | 20 | # make sure that each device in the whitespace-separated 21 | # list exists 22 | verify_devs () { 23 | err="" 24 | for d; do 25 | aoe-stat | 26 | awk -vd="$d" '$1==d{print $1}' | 27 | test "`cat`" || { 28 | exec 2>&1 29 | echo "$zero Error: \"$d\" is not an aoe device" 30 | err="$err $d" 31 | } 32 | done 33 | test ! "$err" 34 | } 35 | 36 | err="" 37 | if test "$1"; then 38 | if test "$1" = "-a"; then 39 | spec=all 40 | else 41 | spec="$*" 42 | verify_devs $spec || exit 1 43 | fi 44 | for i in $spec; do 45 | printf "$i" > "$f" || { 46 | echo 1>&2 "$zero: flush failed" 47 | err="$err $i" 48 | } 49 | done 50 | else 51 | echo > "$f" || err=no_args 52 | fi 53 | if test "$err"; then 54 | exit 1 55 | fi 56 | -------------------------------------------------------------------------------- /conf/44.txt: -------------------------------------------------------------------------------- 1 | The commit below appears in v4.3-rc1. 2 | 3 | commit 4246a0b63bd8f56a1469b12eafeb875b1041a451 4 | Author: Christoph Hellwig 5 | Date: Mon Jul 20 15:29:37 2015 +0200 6 | 7 | block: add a bi_error field to struct bio 8 | 9 | Currently we have two different ways to signal an I/O error on a BIO: 10 | 11 | (1) by clearing the BIO_UPTODATE flag 12 | (2) by returning a Linux errno value to the bi_end_io callback 13 | 14 | The first one has the drawback of only communicating a single possible 15 | error (-EIO), and the second one has the drawback of not beeing persistent 16 | when bios are queued up, and are not passed along from child to parent 17 | bio in the ever more popular chaining scenario. Having both mechanisms 18 | available has the additional drawback of utterly confusing driver authors 19 | and introducing bugs where various I/O submitters only deal with one of 20 | them, and the others have to add boilerplate code to deal with both kinds 21 | of error returns. 22 | 23 | So add a new bi_error field to store an errno value directly in struct 24 | bio and remove the existing mechanisms to clean all this up. 25 | -------------------------------------------------------------------------------- /linux/Documentation/aoe/udev.txt: -------------------------------------------------------------------------------- 1 | # These rules tell udev what device nodes to create for aoe support. 2 | # They may be installed along the following lines. Check the section 3 | # 8 udev manpage to see whether your udev supports SUBSYSTEM, and 4 | # whether it uses one or two equal signs for SUBSYSTEM and KERNEL. 5 | # 6 | # ecashin@makki ~$ su 7 | # Password: 8 | # bash# find /etc -type f -name udev.conf 9 | # /etc/udev/udev.conf 10 | # bash# grep udev_rules= /etc/udev/udev.conf 11 | # udev_rules="/etc/udev/rules.d/" 12 | # bash# ls /etc/udev/rules.d/ 13 | # 10-wacom.rules 50-udev.rules 14 | # bash# cp /path/to/linux-2.6.xx/Documentation/aoe/udev.txt \ 15 | # /etc/udev/rules.d/60-aoe.rules 16 | # 17 | 18 | # aoe char devices 19 | SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k", GROUP="disk", MODE="0220" 20 | SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k", GROUP="disk", MODE="0440" 21 | SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k", GROUP="disk", MODE="0220" 22 | SUBSYSTEM=="aoe", KERNEL=="revalidate", NAME="etherd/%k", GROUP="disk", MODE="0220" 23 | SUBSYSTEM=="aoe", KERNEL=="flush", NAME="etherd/%k", GROUP="disk", MODE="0220" 24 | 25 | # aoe block devices 26 | KERNEL=="etherd*", GROUP="disk" 27 | -------------------------------------------------------------------------------- /aoetools-36/sos-linux: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | me="`basename $0`" 4 | outf="$HOME/sos-`hostname`-`date +%Y%m%d-%H%M%S`.txt" 5 | 6 | if test "`whoami`" != "root"; then 7 | echo "$me: please run $me as root" 1>&2 8 | exit 1 9 | fi 10 | echo "$me: output file is $outf" 11 | 12 | exec > $outf 13 | exec 2>&1 14 | set -x 15 | uname -a 16 | grep . /etc/*release* /etc/*version* | sed 50q 17 | find /sys/module/aoe -name version | xargs cat 18 | cat /proc/mounts 19 | aoe-version 20 | aoe-stat 21 | cat /proc/mdstat 22 | pvs 23 | ifconfig -a 24 | free 25 | dmesg | tail -n 50 26 | lspci 27 | set +x 28 | for i in `aoe-stat | awk '{print $3}' | sed 's!,! !g'`; do 29 | echo ethtool -S $i 30 | done | sort | uniq | sh -x 31 | # top -b -n 1 32 | 33 | # check for old-style sysfs-exported debug information, ignoring errors 34 | grep . /sys/block/etherd*/debug /dev/null 35 | 36 | # check for new-style debugfs-exported debug information, ignoring errors 37 | dmnt=/sys/kernel/debug 38 | didmount= 39 | mounted=`awk '$3=="debugfs"{print $2}' /proc/mounts` 40 | if test "x$mounted" = "x" && mount -t debugfs none "$dmnt"; then 41 | didmount="$dmnt" 42 | mounted="$dmnt" 43 | fi 44 | cd "$mounted"/aoe && grep . e[0-9]*.*[0-9] 45 | cd / 46 | if test "x$didmount" != "x"; then 47 | umount "$didmount" 48 | fi 49 | exit 0 50 | -------------------------------------------------------------------------------- /aoetools-36/aoe-interfaces.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # aoe-interfaces - set or list the allowed AoE network interfaces 3 | # Copyright 2009, CORAID, Inc., and licensed under GPL v.2. 4 | 5 | zero="`basename $0`" 6 | devf=@devdir@/interfaces 7 | sysf=/sys/module/aoe/parameters/aoe_iflist 8 | 9 | if test -z "$*"; then 10 | if test -r "$sysf"; then 11 | cat "$sysf" 12 | else 13 | # can't read from interfaces device 14 | false 15 | fi 16 | exit 17 | fi 18 | 19 | if test "$1" = "-c"; then 20 | shift 21 | if test "$#" != "0"; then 22 | echo "$zero Error: -c flag takes no arguments" 1>&2 23 | exit 1 24 | fi 25 | fi 26 | netifs="$*" 27 | 28 | err=no 29 | for i in $netifs; do 30 | test -d "/sys/class/net/$i" || { 31 | echo "$zero Error: \"$i\" is not a network interface" 1>&2 32 | err=yes 33 | } 34 | done 35 | if test "$err" = "yes"; then 36 | exit 1 37 | fi 38 | 39 | if test -w "$sysf"; then 40 | printf '%s\0' "$netifs" > "$sysf" 41 | else 42 | if test ! -w "$devf"; then 43 | echo 1>&2 "$zero: $devf does not exist or is not writeable." 44 | exit 1 45 | fi 46 | if test ! -c "$devf"; then 47 | exec 1>&2 48 | echo "$zero: $devf is not a character device file" 49 | echo "$zero: use udev or aoe-mkdevs to create it" 50 | exit 1 51 | fi 52 | printf '%s\0' "$netifs" > "$devf" 53 | fi 54 | -------------------------------------------------------------------------------- /linux/Documentation/aoe/udev-install.sh: -------------------------------------------------------------------------------- 1 | # install the aoe-specific udev rules from udev.txt into 2 | # the system's udev configuration 3 | # 4 | 5 | me="`basename $0`" 6 | 7 | # find udev.conf, often /etc/udev/udev.conf 8 | # (or environment can specify where to find udev.conf) 9 | # 10 | if test -z "$conf"; then 11 | if test -r /etc/udev/udev.conf; then 12 | conf=/etc/udev/udev.conf 13 | else 14 | conf="`find /etc -type f -name udev.conf 2> /dev/null`" 15 | if test -z "$conf" || test ! -r "$conf"; then 16 | echo "$me Error: no udev.conf found" 1>&2 17 | exit 1 18 | fi 19 | fi 20 | fi 21 | 22 | # find the directory where udev rules are stored, often 23 | # /etc/udev/rules.d 24 | # 25 | rules_d="`sed -n '/^udev_rules=/{ s!udev_rules=!!; s!\"!!g; p; }' $conf`" 26 | if test -z "$rules_d" ; then 27 | rules_d=/etc/udev/rules.d 28 | fi 29 | if test ! -d "$rules_d"; then 30 | echo "$me Error: cannot find udev rules directory" 1>&2 31 | exit 1 32 | fi 33 | 34 | # If they already have a working 60-aoe.rules, we should not 35 | # overwrite it. Only remark about it if the contents differ. 36 | f="$rules_d/60-aoe.rules" 37 | new="`dirname $0`/udev.txt" 38 | if test -r "$f"; then 39 | if ! cmp "$f" "$new" > /dev/null; then 40 | echo "$me: will not overwrite existing $f with $new" 1>&2 41 | fi 42 | else 43 | sh -xc "cp $new $f" 44 | fi 45 | -------------------------------------------------------------------------------- /aoetools-36/aoe-mkshelf.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # aoe-mkshelf - device nodes for one shelf without udev 3 | # Copyright 2009, CORAID, Inc., and licensed under GPL v.2. 4 | 5 | zero=`basename $0` 6 | 7 | if test "$#" != "2"; then 8 | echo "Usage: $zero {dir} {shelfaddress}" 1>&2 9 | echo " n_partitions=16 $zero {dir} {shelfaddress}" 1>&2 10 | exit 1 11 | fi 12 | dyn=/sys/module/aoe/parameters/aoe_dyndevs 13 | if test -r "$dyn" && test "`cat $dyn`" = 1; then 14 | cat 1>&2 <&2 < 10 | Version: 36 11 | Release: 1%{dist} 12 | URL: http://aoetools.sourceforge.net/ 13 | Source0: %{name}-%{version}.tar.gz 14 | Source1: 60-aoe.rules 15 | License: GPLv2 16 | Group: Application/System 17 | 18 | %description 19 | The command-line utilities for using the aoe driver to work with 20 | ATA over Ethernet storage targets on a Linux system. 21 | 22 | %define debug_package %{nil} 23 | 24 | %prep 25 | %setup -n %{name}-%{version} 26 | 27 | %build 28 | make SBINDIR=%{sbind} MANDIR=%{mand} 29 | 30 | %install 31 | mkdir -p -m 755 %{sbind}/ 32 | mkdir -p -m 755 %{mand}/man8/ 33 | make install SBINDIR=%{sbind} MANDIR=%{mand} 34 | mkdir -p -m 755 %{udevrulesd}/ 35 | install -m 644 %{SOURCE1} %{udevrulesd} 36 | 37 | %files 38 | %defattr(-,root,root) 39 | %doc %docfiles 40 | %attr(0755,root,root) %{_sbindir}/* 41 | %{_mandir}/man8/* 42 | %config %{_sysconfdir}/udev/rules.d/* 43 | 44 | %changelog 45 | * Thu Aug 15 2013 Ed Cashin - 36-1 46 | - Update for v36 47 | 48 | * Wed Jul 10 2013 Ed Cashin - 35-1 49 | - Initial package for aoetools v35 plus udev rules 50 | -------------------------------------------------------------------------------- /conf/25-patches/fs5-relay5.diff: -------------------------------------------------------------------------------- 1 | diff -upr fs5/linux/drivers/block/aoe/aoedbg.c relay5/linux/drivers/block/aoe/aoedbg.c 2 | --- fs5/linux/drivers/block/aoe/aoedbg.c 2008-10-17 11:35:32.000000000 -0400 3 | +++ relay5/linux/drivers/block/aoe/aoedbg.c 2008-10-17 11:10:02.000000000 -0400 4 | @@ -1,6 +1,7 @@ 5 | #include 6 | #include 7 | -#include 8 | +#include 9 | +#include 10 | #include "aoe.h" 11 | 12 | #define SUBBUF_SIZE 262144 13 | @@ -18,6 +19,24 @@ struct ddbg { 14 | static char buf[PAGE_SIZE]; 15 | static DEFINE_SPINLOCK(buflock); 16 | 17 | +/* required callbacks for using debugfs as host fs for relay */ 18 | +static struct dentry * 19 | +cfile(const char *filename, 20 | + struct dentry *parent, 21 | + int mode, 22 | + struct rchan_buf *buf, 23 | + int *is_global) 24 | +{ 25 | + return debugfs_create_file(filename, mode, parent, buf, 26 | + &relay_file_operations); 27 | +} 28 | +static int 29 | +rfile(struct dentry *dentry) 30 | +{ 31 | + debugfs_remove(dentry); 32 | + 33 | + return 0; 34 | +} 35 | static int 36 | subbuf_start(struct rchan_buf *buf, 37 | void *subbuf, 38 | @@ -28,6 +47,8 @@ subbuf_start(struct rchan_buf *buf, 39 | } 40 | static struct rchan_callbacks cb = { 41 | .subbuf_start = subbuf_start, 42 | + .create_buf_file = cfile, 43 | + .remove_buf_file = rfile, 44 | }; 45 | 46 | /* Use this xrelay_open instead of using relay_open directly, 47 | -------------------------------------------------------------------------------- /conf/19-patches/nons-nd_net.diff: -------------------------------------------------------------------------------- 1 | diff -upr nons/linux/drivers/block/aoe/aoecmd.c nd_net/linux/drivers/block/aoe/aoecmd.c 2 | --- nons/linux/drivers/block/aoe/aoecmd.c 2008-08-19 13:25:38.000000000 -0400 3 | +++ nd_net/linux/drivers/block/aoe/aoecmd.c 2008-07-29 16:49:48.000000000 -0400 4 | @@ -12,6 +12,7 @@ 5 | #include 6 | #include 7 | #include 8 | +#include 9 | #include 10 | #include 11 | #include "aoe.h" 12 | @@ -393,7 +394,7 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigne 13 | sl = sl_tail = NULL; 14 | 15 | read_lock(&dev_base_lock); 16 | - for_each_netdev(ifp) { 17 | + for_each_netdev(&init_net, ifp) { 18 | dev_hold(ifp); 19 | if (!is_aoe_netif(ifp)) { 20 | dev_put(ifp); 21 | diff -upr nons/linux/drivers/block/aoe/aoenet.c nd_net/linux/drivers/block/aoe/aoenet.c 22 | --- nons/linux/drivers/block/aoe/aoenet.c 2008-08-19 13:24:51.000000000 -0400 23 | +++ nd_net/linux/drivers/block/aoe/aoenet.c 2008-08-19 13:27:26.000000000 -0400 24 | @@ -8,6 +8,7 @@ 25 | #include 26 | #include 27 | #include 28 | +#include 29 | #include 30 | #include "aoe.h" 31 | 32 | @@ -168,6 +169,9 @@ aoenet_rcv(struct sk_buff *skb, struct n 33 | u32 n; 34 | int sn; 35 | 36 | + if (ifp->nd_net != &init_net) 37 | + goto exit; 38 | + 39 | skb = skb_share_check(skb, GFP_ATOMIC); 40 | if (skb == NULL) 41 | return 0; 42 | -------------------------------------------------------------------------------- /conf/19-patches/nons-dev_net.diff: -------------------------------------------------------------------------------- 1 | diff -upr nons/linux/drivers/block/aoe/aoecmd.c dev_net/linux/drivers/block/aoe/aoecmd.c 2 | --- nons/linux/drivers/block/aoe/aoecmd.c 2008-08-19 13:25:38.000000000 -0400 3 | +++ dev_net/linux/drivers/block/aoe/aoecmd.c 2008-07-29 16:49:48.000000000 -0400 4 | @@ -12,6 +12,7 @@ 5 | #include 6 | #include 7 | #include 8 | +#include 9 | #include 10 | #include 11 | #include "aoe.h" 12 | @@ -393,7 +394,7 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigne 13 | sl = sl_tail = NULL; 14 | 15 | read_lock(&dev_base_lock); 16 | - for_each_netdev(ifp) { 17 | + for_each_netdev(&init_net, ifp) { 18 | dev_hold(ifp); 19 | if (!is_aoe_netif(ifp)) { 20 | dev_put(ifp); 21 | diff -upr nons/linux/drivers/block/aoe/aoenet.c dev_net/linux/drivers/block/aoe/aoenet.c 22 | --- nons/linux/drivers/block/aoe/aoenet.c 2008-08-19 13:24:51.000000000 -0400 23 | +++ dev_net/linux/drivers/block/aoe/aoenet.c 2008-08-19 11:29:29.000000000 -0400 24 | @@ -8,6 +8,7 @@ 25 | #include 26 | #include 27 | #include 28 | +#include 29 | #include 30 | #include "aoe.h" 31 | 32 | @@ -168,6 +169,9 @@ aoenet_rcv(struct sk_buff *skb, struct n 33 | u32 n; 34 | int sn; 35 | 36 | + if (dev_net(ifp) != &init_net) 37 | + goto exit; 38 | + 39 | skb = skb_share_check(skb, GFP_ATOMIC); 40 | if (skb == NULL) 41 | return 0; 42 | -------------------------------------------------------------------------------- /aoetools-36/aoetools.8: -------------------------------------------------------------------------------- 1 | .TH aoetools 8 2 | .SH NAME 3 | aoetools \- utilities for AoE on systems running Linux 2.6 and up 4 | .SH DESCRIPTION 5 | The 6 | .I aoetools 7 | package contains scripts and commands that interact with, 8 | support, and supplement the 9 | aoe driver in the Linux kernel. 10 | .TP 11 | .BI aoe-discover 12 | tell aoe driver to discover AoE devices 13 | .TP 14 | .BI aoe-flush 15 | flush the down devices out of the aoe driver 16 | .TP 17 | .BI aoe-interfaces 18 | restrict aoe driver to specified network interfaces 19 | .TP 20 | .BI aoe-mkdevs 21 | create special device files for system without udev 22 | .TP 23 | .BI aoe-mkshelf 24 | create device files for one shelf address for system without udev 25 | .TP 26 | .BI aoe-revalidate 27 | revalidate the disk size of an aoe device 28 | .TP 29 | .BI aoe-stat 30 | collate and present information about AoE storage 31 | .TP 32 | .BI aoe-version 33 | display version numbers of AoE-related software 34 | .TP 35 | .BI coraid-update 36 | send updates to CORAID appliances 37 | .TP 38 | .BI sos-linux 39 | collect AoE-related information about the localhost 40 | .TP 41 | .BI aoe-sancheck 42 | perform an analysis of the AoE storage network 43 | .SH "SEE ALSO" 44 | .IR aoe-discover (8), 45 | .IR aoe-flush (8), 46 | .IR aoe-interfaces (8), 47 | .IR aoe-mkdevs (8), 48 | .IR aoe-mkshelf (8), 49 | .IR aoe-revalidate (8), 50 | .IR aoe-stat (8), 51 | .IR aoe-version (8), 52 | .IR aoecfg (8), 53 | .IR aoeping (8), 54 | .IR coraid-update (8), 55 | .IR sos-linux (8), 56 | .IR aoe-sancheck (8), 57 | .IR udev (7). 58 | -------------------------------------------------------------------------------- /conf/22-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -upr old/linux/drivers/block/aoe/aoeblk.c new/linux/drivers/block/aoe/aoeblk.c 2 | --- old/linux/drivers/block/aoe/aoeblk.c 2009-01-22 12:11:17.000000000 -0500 3 | +++ new/linux/drivers/block/aoe/aoeblk.c 2009-01-21 17:13:12.000000000 -0500 4 | @@ -262,6 +262,22 @@ aoeblk_request(struct request_queue *q) 5 | } 6 | 7 | static int 8 | +aoeblk_getgeo(struct block_device *bdev, struct hd_geometry *geo) 9 | +{ 10 | + struct aoedev *d = bdev->bd_disk->private_data; 11 | + 12 | + if ((d->flags & DEVFL_UP) == 0) { 13 | + printk(KERN_ERR "aoe: disk not up\n"); 14 | + return -ENODEV; 15 | + } 16 | + 17 | + geo->cylinders = d->geo.cylinders; 18 | + geo->heads = d->geo.heads; 19 | + geo->sectors = d->geo.sectors; 20 | + return 0; 21 | +} 22 | + 23 | +static int 24 | aoeblk_ioctl(struct block_device *bdev, fmode_t mode, uint cmd, ulong arg) 25 | { 26 | struct aoedev *d; 27 | @@ -280,11 +296,6 @@ aoeblk_ioctl(struct block_device *bdev, 28 | sizeof d->ident)) 29 | return 0; 30 | return -EFAULT; 31 | - } else if (cmd == HDIO_GETGEO) { 32 | - d->geo.start = get_start_sect(inode->i_bdev); 33 | - if (!copy_to_user((void __user *) arg, &d->geo, sizeof d->geo)) 34 | - return 0; 35 | - return -EFAULT; 36 | } 37 | 38 | /* udev calls scsi_id, which uses SG_IO, resulting in noise */ 39 | @@ -298,6 +309,7 @@ static struct block_device_operations ao 40 | .open = aoeblk_open, 41 | .release = aoeblk_release, 42 | .ioctl = aoeblk_ioctl, 43 | + .getgeo = aoeblk_getgeo, 44 | .owner = THIS_MODULE, 45 | }; 46 | 47 | -------------------------------------------------------------------------------- /conf/12-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -upr a/linux/drivers/block/aoe/aoeblk.c b/linux/drivers/block/aoe/aoeblk.c 2 | --- a/linux/drivers/block/aoe/aoeblk.c 2007-02-07 18:20:21.000000000 -0500 3 | +++ b/linux/drivers/block/aoe/aoeblk.c 2007-02-07 18:26:37.000000000 -0500 4 | @@ -168,23 +168,28 @@ static struct disk_attribute disk_attr_d 5 | .show = aoedisk_show_debug 6 | }; 7 | 8 | -static void 9 | +static struct attribute *aoe_attrs[] = { 10 | + &disk_attr_state.attr, 11 | + &disk_attr_mac.attr, 12 | + &disk_attr_netif.attr, 13 | + &disk_attr_fwver.attr, 14 | + &disk_attr_debug.attr, 15 | + NULL 16 | +}; 17 | + 18 | +static const struct attribute_group attr_group = { 19 | + .attrs = aoe_attrs, 20 | +}; 21 | + 22 | +static int 23 | aoedisk_add_sysfs(struct aoedev *d) 24 | { 25 | - sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr); 26 | - sysfs_create_file(&d->gd->kobj, &disk_attr_mac.attr); 27 | - sysfs_create_file(&d->gd->kobj, &disk_attr_netif.attr); 28 | - sysfs_create_file(&d->gd->kobj, &disk_attr_fwver.attr); 29 | - sysfs_create_file(&d->gd->kobj, &disk_attr_debug.attr); 30 | + return sysfs_create_group(&d->gd->kobj, &attr_group); 31 | } 32 | void 33 | aoedisk_rm_sysfs(struct aoedev *d) 34 | { 35 | - sysfs_remove_link(&d->gd->kobj, "state"); 36 | - sysfs_remove_link(&d->gd->kobj, "mac"); 37 | - sysfs_remove_link(&d->gd->kobj, "netif"); 38 | - sysfs_remove_link(&d->gd->kobj, "firmware-version"); 39 | - sysfs_remove_link(&d->gd->kobj, disk_attr_debug.attr.name); 40 | + sysfs_remove_group(&d->gd->kobj, &attr_group); 41 | } 42 | 43 | static int 44 | -------------------------------------------------------------------------------- /aoetools-36/aoe-flush.8: -------------------------------------------------------------------------------- 1 | .TH aoe-flush 8 2 | .SH NAME 3 | aoe-flush \- flush the down devices out of the aoe driver 4 | .SH SYNOPSIS 5 | .nf 6 | .B aoe-flush [-a] 7 | .B aoe-flush dev1 [dev2 ...] 8 | .fi 9 | .SH DESCRIPTION 10 | The 11 | .I aoe-flush 12 | command tells the aoe driver to remove devices from the system and 13 | forget about them. Normally the aoe driver will remember all devices it has 14 | seen until the module is unloaded. By default, 15 | .I aoe-flush 16 | will only flush 17 | downed devices. With the \fB-a\fP flag all devices are candidates for removal. 18 | .PP 19 | .I aoe-flush 20 | will not remove devices that are in use. This includes devices in the 21 | closewait state or those in the process of being installed. 22 | .PP 23 | By specifying a series of specific aoe devices, e.g., \fBe7.0 e3.2\fP, 24 | it is possible to ask the aoe driver to forget these devices. This 25 | feature may be convenient after a temporary AoE target is no longer 26 | being used. 27 | .SH OPTIONS 28 | .TP 29 | \fB-a\fP 30 | The \fB-a\fP option tells the aoe driver to forget all unused devices. 31 | .SH EXAMPLE 32 | .EX 33 | .nf 34 | nai# aoe-stat | grep e12.0 35 | e12.0 0.000GB eth1 down 36 | nai# aoe-flush 37 | nai# aoe-stat | grep e12.0 38 | .fi 39 | .EE 40 | .SH BUGS 41 | Flushed devices may reappear when they are discovered by the periodic discovery 42 | beacon. 43 | .I aoe-discover 44 | may be used to force this behaviour. 45 | .SH "SEE ALSO" 46 | .IR aoe-stat (8), 47 | .IR aoe-discover (8), 48 | .IR aoetools (8). 49 | .SH AUTHOR 50 | Sam Hopkins (sah@coraid.com) 51 | -------------------------------------------------------------------------------- /conf/2-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff -upr old/linux/drivers/block/aoe/aoechr.c new/linux/drivers/block/aoe/aoechr.c 2 | --- old/linux/drivers/block/aoe/aoechr.c 2009-01-22 11:52:25.000000000 -0500 3 | +++ new/linux/drivers/block/aoe/aoechr.c 2009-01-22 09:32:45.000000000 -0500 4 | @@ -44,7 +44,7 @@ static int emsgs_head_idx, emsgs_tail_id 5 | static struct semaphore emsgs_sema; 6 | static spinlock_t emsgs_lock; 7 | static int nblocked_emsgs_readers; 8 | -static struct class_simple *aoe_class; 9 | +static struct class *aoe_class; 10 | static struct aoe_chardev chardevs[] = { 11 | { MINOR_ERR, "err" }, 12 | { MINOR_DISCOVER, "discover" }, 13 | @@ -277,13 +277,13 @@ aoechr_init(void) 14 | printk(KERN_ERR "aoe: can't register char device\n"); 15 | return n; 16 | } 17 | - aoe_class = class_simple_create(THIS_MODULE, "aoe"); 18 | + aoe_class = class_create(THIS_MODULE, "aoe"); 19 | if (IS_ERR(aoe_class)) { 20 | unregister_chrdev(AOE_MAJOR, "aoechr"); 21 | return PTR_ERR(aoe_class); 22 | } 23 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 24 | - class_simple_device_add(aoe_class, 25 | + device_create(aoe_class, NULL, 26 | MKDEV(AOE_MAJOR, chardevs[i].minor), 27 | NULL, chardevs[i].name); 28 | 29 | @@ -296,8 +296,8 @@ aoechr_exit(void) 30 | int i; 31 | 32 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 33 | - class_simple_device_remove(MKDEV(AOE_MAJOR, chardevs[i].minor)); 34 | - class_simple_destroy(aoe_class); 35 | + device_destroy(aoe_class, MKDEV(AOE_MAJOR, chardevs[i].minor)); 36 | + class_destroy(aoe_class); 37 | unregister_chrdev(AOE_MAJOR, "aoechr"); 38 | } 39 | 40 | -------------------------------------------------------------------------------- /conf/24.txt: -------------------------------------------------------------------------------- 1 | The poor device_create function is a victim of chronic fiddling. 2 | After the removal of class_simple, there are several states the kernel 3 | has gone through. 4 | 5 | cdc4 6 | class_device_create with four arguments, found before 7 | 2.6.15-rc7 or so. 8 | 9 | cdc5 10 | class_device_create with five arguments 11 | 12 | dcd 13 | device_create_drvdata was around by the time 14 | class_device_create was finally removed in commit 15 | c3b19ff06e0808555403491d61e8f0cbbb53e933 (which appears in 16 | v2.6.26-rc1~99^2~1). 17 | 18 | Then device_create_drvdata got removed, and callers of 19 | device_create_drvdata were just switched to device_create without 20 | further modification. 21 | 22 | dc NEW 23 | device_create with 5 arguments 24 | 25 | commit 7fb6b5d51daf3613045258ee8add07022d8c39d3 26 | Author: Greg Kroah-Hartman 27 | Date: Mon Jul 21 20:03:34 2008 -0700 28 | 29 | device create: remove device_create_drvdata 30 | 31 | Now that the tree is cleaned up, device_create_drvdata can be safely 32 | removed. 33 | 34 | Signed-off-by: Greg Kroah-Hartman 35 | 36 | commit 3ee074bf432d24a92894397ac48ad2f2bb95efdc 37 | Author: Greg Kroah-Hartman 38 | Date: Mon Jul 21 20:03:34 2008 -0700 39 | 40 | device create: ide: convert device_create_drvdata to device_create 41 | 42 | Now that device_create() has been audited, rename things back to the 43 | original call to be sane. 44 | 45 | Cc: Bartlomiej Zolnierkiewicz 46 | Signed-off-by: Greg Kroah-Hartman 47 | 48 | -------------------------------------------------------------------------------- /pkg/rhel6/SPECS/aoe.spec: -------------------------------------------------------------------------------- 1 | Name: aoe 2 | Vendor: Coraid, Inc. 3 | Packager: Ed Cashin 4 | Version: 83 5 | Release: 1%{?dist} 6 | License: GPLv2 7 | URL: http://support.coraid.com/support/linux/ 8 | Source0: %{name}6-%{version}.tar.gz 9 | Source1: %{name}.files 10 | Source2: %{name}.conf 11 | Source3: %{name}-%{version}-nodepmod.diff 12 | BuildRequires: %kernel_module_package_buildreqs 13 | Group: System Environment/Kernel 14 | Summary: %{name} module for Linux 15 | Requires: aoetools 16 | patch0: %{SOURCE3} 17 | 18 | %description 19 | Coraid ATA over Ethernet (AoE) Linux initiator driver. 20 | 21 | # add percent-sign-plus-trace to understand what's going on 22 | 23 | %kernel_module_package -f %{SOURCE1} default 24 | 25 | %prep 26 | %{?kmodtool_check} 27 | if test dev_interested = 'SURE!'; then 28 | cat < 11 | Mon, 23 May 2011 18:11:39 +0000 (14:11 -0400) 12 | committer Paul Gortmaker 13 | Mon, 31 Oct 2011 13:20:11 +0000 (09:20 -0400) 14 | A lot of files pull in module.h when all they are really 15 | looking for is the basic EXPORT_SYMBOL functionality. The 16 | recent data from Ingo[1] shows that this is one of several 17 | instances that has a significant impact on compile times, 18 | and it should be targeted for factoring out (as done here). 19 | 20 | Note that several commonly used header files in include/* 21 | directly include themselves (some 34 of them!) 22 | The most commonly used ones of these will have to be made 23 | independent of module.h before the full benefit of this change 24 | can be realized. 25 | 26 | We also transition THIS_MODULE from module.h to export.h, 27 | since there are lots of files with subsystem structs that 28 | in turn will have a struct module *owner and only be doing: 29 | 30 | .owner = THIS_MODULE; 31 | 32 | and absolutely nothing else modular. So, we also want to have 33 | the THIS_MODULE definition present in the lightweight header. 34 | 35 | [1] https://lkml.org/lkml/2011/5/23/76 36 | 37 | Signed-off-by: Paul Gortmaker 38 | 39 | -------------------------------------------------------------------------------- /aoetools-36/aoe-mkdevs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # aoe-mkdevs - make static device nodes on systems without udev 3 | # Copyright 2009, CORAID, Inc., and licensed under GPL v.2. 4 | 5 | n_shelves=${n_shelves:-10} 6 | n_partitions=${n_partitions:-16} 7 | 8 | if test "$#" != "1"; then 9 | echo "Usage: `basename $0` {dir}" 1>&2 10 | echo " n_partitions=16 `basename $0` {dir}" 1>&2 11 | exit 1 12 | fi 13 | dir=$1 14 | zero="`basename $0`" 15 | MAJOR=152 16 | 17 | dyn=/sys/module/aoe/parameters/aoe_dyndevs 18 | if test -r "$dyn" && test "`cat $dyn`" = 1; then 19 | cat 1>&2 <&2 < 6 | #include 7 | -#include 8 | +#include 9 | +#include 10 | #include "aoe.h" 11 | 12 | #define SUBBUF_SIZE 262144 13 | @@ -18,6 +19,24 @@ struct ddbg { 14 | static char buf[PAGE_SIZE]; 15 | static DEFINE_SPINLOCK(buflock); 16 | 17 | +/* required callbacks for using debugfs as host fs for relay */ 18 | +static struct dentry * 19 | +cfile(const char *filename, 20 | + struct dentry *parent, 21 | + int mode, 22 | + struct rchan_buf *buf, 23 | + int *is_global) 24 | +{ 25 | + return debugfs_create_file(filename, mode, parent, buf, 26 | + &relay_file_operations); 27 | +} 28 | +static int 29 | +rfile(struct dentry *dentry) 30 | +{ 31 | + debugfs_remove(dentry); 32 | + 33 | + return 0; 34 | +} 35 | static int 36 | subbuf_start(struct rchan_buf *buf, 37 | void *subbuf, 38 | @@ -28,6 +47,8 @@ subbuf_start(struct rchan_buf *buf, 39 | } 40 | static struct rchan_callbacks cb = { 41 | .subbuf_start = subbuf_start, 42 | + .create_buf_file = cfile, 43 | + .remove_buf_file = rfile, 44 | }; 45 | 46 | /* Use this xrelay_open instead of using relay_open directly, 47 | @@ -45,7 +66,7 @@ xrelay_open(const char *base_fnam, 48 | { 49 | struct rchan *c; 50 | 51 | - c = relay_open(base_fnam, parent, subbuf_size, n_subbufs, &cb); 52 | + c = relay_open(base_fnam, parent, subbuf_size, n_subbufs, &cb, NULL); 53 | 54 | if (!c) 55 | printk(KERN_ERR 56 | -------------------------------------------------------------------------------- /conf/31-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff --git a/linux/drivers/block/aoe/aoeblk.c b/linux/drivers/block/aoe/aoeblk.c 2 | index 7323084..b7a6b01 100644 3 | --- a/linux/drivers/block/aoe/aoeblk.c 4 | +++ b/linux/drivers/block/aoe/aoeblk.c 5 | @@ -252,8 +252,8 @@ aoeblk_request(struct request_queue *q) 6 | if ((d->flags & DEVFL_UP) == 0) { 7 | printk(KERN_INFO "aoe: device %ld.%d is not up\n", 8 | d->aoemajor, d->aoeminor); 9 | - while ((rq=elv_next_request(q))) { 10 | - blkdev_dequeue_request(rq); 11 | + while ((rq = blk_peek_request(q))) { 12 | + blk_start_request(rq); 13 | aoe_end_request(d, rq, 1); 14 | } 15 | return; 16 | diff --git a/linux/drivers/block/aoe/aoecmd.c b/linux/drivers/block/aoe/aoecmd.c 17 | index d188b5b..4ec5536 100644 18 | --- a/linux/drivers/block/aoe/aoecmd.c 19 | +++ b/linux/drivers/block/aoe/aoecmd.c 20 | @@ -909,10 +909,10 @@ nextbuf(struct aoedev *d) 21 | return d->ip.buf; 22 | rq = d->ip.rq; 23 | if (rq == NULL) { 24 | - rq = elv_next_request(q); 25 | + rq = blk_peek_request(q); 26 | if (rq == NULL) 27 | return NULL; 28 | - blkdev_dequeue_request(rq); 29 | + blk_start_request(rq); 30 | d->ip.rq = rq; 31 | d->ip.nxbio = rq->bio; 32 | rq->special = (void *) rqbiocnt(rq); 33 | diff --git a/linux/drivers/block/aoe/aoedev.c b/linux/drivers/block/aoe/aoedev.c 34 | index 8466628..d02ecb7 100644 35 | --- a/linux/drivers/block/aoe/aoedev.c 36 | +++ b/linux/drivers/block/aoe/aoedev.c 37 | @@ -227,8 +227,8 @@ aoedev_downdev(struct aoedev *d) 38 | 39 | /* fast fail all pending I/O */ 40 | if (d->blkq) { 41 | - while ((rq = elv_next_request(d->blkq))) { 42 | - blkdev_dequeue_request(rq); 43 | + while ((rq = blk_peek_request(d->blkq))) { 44 | + blk_start_request(rq); 45 | aoe_end_request(d, rq, 1); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /conf/compat.sh: -------------------------------------------------------------------------------- 1 | # This script is run from its parent directory. 2 | 3 | revert= 4 | if test "$1" = "-R"; then 5 | revert=yes 6 | shift 7 | fi 8 | 9 | driver_d=$1 10 | shift 11 | make_cmd="$*" 12 | 13 | export driver_d make_cmd 14 | 15 | me=`basename $0` 16 | 17 | # ignore errors when reverting configuration 18 | if test "$revert" != "yes"; then 19 | set -e 20 | fi 21 | 22 | # the compatibility tests recognize compiler messages, so turn 23 | # off internationalization during the tests 24 | LANG=C 25 | LC_ALL=C 26 | # openSUSE 11.4 doesn't find LC_ALL convincing, requiring LC_CTYPE 27 | LC_CTYPE=C 28 | export LANG LC_ALL LC_CTYPE 29 | 30 | logf=conf/compat.log 31 | : > $logf 32 | 33 | cleanup() { 34 | i=$1 35 | rm -f conf/$i.o conf/$i.ko conf/$i.mod.[co] conf/.$i.*.cmd conf/.$i.*.d 36 | rm -f conf/$i-*.o conf/$i-*.ko \ 37 | conf/$i-*.mod.[co] conf/.$i-*.*.cmd conf/.$i-*.*.d 38 | } 39 | 40 | i=1 41 | while test -r conf/$i-kv.sh; do 42 | printf "$i " 43 | kv=`sh conf/$i-kv.sh` 44 | av=`sh conf/$i-av.sh` 45 | echo "$i kv=$kv av=$av" >> $logf 46 | 47 | if test "$revert" = "yes" && test "$av" != "new"; then 48 | if test -r "conf/$i-patches/old-new.diff"; then 49 | kv=new 50 | else 51 | kv=`awk '$NF=="NEW"{print $1}' conf/$i.txt` 52 | fi 53 | fi 54 | 55 | if test "$kv" = "$av"; then 56 | cleanup $i 57 | i=`expr $i + 1` 58 | continue 59 | fi 60 | 61 | p="conf/$i-patches/$av-$kv.diff" 62 | reverse= 63 | test -r "$p" || { 64 | p="conf/$i-patches/$kv-$av.diff" 65 | reverse="-R" 66 | } 67 | test -r "$p" || { 68 | echo 1>&2 "$me Error: no $p or inverse found" 69 | exit 1 70 | } 71 | 72 | echo 73 | echo "patch -p1 $reverse < $p" >> $logf 74 | patch -p1 $reverse < "$p" 75 | 76 | cleanup $i 77 | i=`expr $i + 1` 78 | done 79 | 80 | echo ok 81 | exit 0 82 | -------------------------------------------------------------------------------- /aoetools-36/aoe-version: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # aoe-version - display versions of AoE-related software 3 | # Copyright 2013, CORAID, Inc., and licensed under GPL v.2. 4 | 5 | aoetools=36 6 | 7 | # modinfo doesn't always work correctly when there is a file 8 | # in the current working directory called "aoe", but it's 9 | # not hard to change the current working directory. 10 | for wd in . / /sys /var/run /usr /proc /etc /home; do 11 | a=`{ cd "$wd" 2> /dev/null && test ! -r aoe && echo yes; } || echo no` 12 | if test "$a" = "yes"; then 13 | cd "$wd" 14 | break 15 | fi 16 | done 17 | # The aoe module isn't guaranteed to be in the location below, 18 | # but if we only try to use it when each of the directories 19 | # above was not usable, we shouldn't use the hard-coded location 20 | # often. 21 | aoe=aoe 22 | if test -r ./aoe; then 23 | aoe="/lib/modules/`uname -r`/kernel/drivers/block/aoe/aoe.ko" 24 | fi 25 | 26 | # standalone aoe drivers have a module parameter "version" 27 | installed="`modinfo \"$aoe\" 2>/dev/null | awk '/srcversion/ {next} /^parm:.*version:aoe module/ {print $NF; exit 0}'`" 28 | if test -z "$installed"; then 29 | # Recent kernels have a "version" of their own, so 30 | # they didn't want our module parameter, so we look 31 | # for that, too, in case user is using kernel.org driver. 32 | installed="`modinfo \"$aoe\" 2>/dev/null | awk '/^version:/ {print $NF; exit 0}'`" 33 | fi 34 | if test "$?" != "0" || test -z "$installed"; then 35 | installed="(unknown)" 36 | fi 37 | 38 | if test -d /sys/module/aoe; then 39 | running="`find /sys/module/aoe -name version | sed 1q | xargs cat`" 40 | if test "$?" != "0"; then 41 | running="(unknown)" 42 | fi 43 | else 44 | running="(none)" 45 | fi 46 | 47 | while read val desc; do 48 | printf "%22s:\t%s\n" "$desc" "$val" 49 | done <ntargets = NTARGETS; 23 | - INIT_WORK(&d->work, aoecmd_sleepwork, d); 24 | + INIT_WORK(&d->work, aoecmd_sleepwork); 25 | spin_lock_init(&d->lock); 26 | init_timer(&d->timer); 27 | d->timer.data = (ulong) d; 28 | diff -upr patched/linux/drivers/block/aoe/aoe.h pristine/linux/drivers/block/aoe/aoe.h 29 | --- patched/linux/drivers/block/aoe/aoe.h 2013-06-04 14:20:24.000000000 -0400 30 | +++ pristine/linux/drivers/block/aoe/aoe.h 2013-06-19 15:52:32.000000000 -0400 31 | @@ -223,7 +223,7 @@ void aoecmd_work(struct aoedev *d); 32 | void aoecmd_cfg(ushort aoemajor, unsigned char aoeminor); 33 | struct sk_buff *aoecmd_ata_rsp(struct sk_buff *); 34 | void aoecmd_cfg_rsp(struct sk_buff *); 35 | -void aoecmd_sleepwork(void *); 36 | +void aoecmd_sleepwork(struct work_struct *); 37 | void aoecmd_wreset(struct aoetgt *t); 38 | void aoecmd_cleanslate(struct aoedev *); 39 | void aoecmd_exit(void); 40 | -------------------------------------------------------------------------------- /conf/31.txt: -------------------------------------------------------------------------------- 1 | In 2.6.31, elv_next_request and blk_dequeue_request are gone. 2 | 3 | commit 9934c8c04561413609d2bc38c6b9f268cba774a4 4 | Author: Tejun Heo 5 | Date: Fri May 8 11:54:16 2009 +0900 6 | 7 | block: implement and enforce request peek/start/fetch 8 | 9 | Till now block layer allowed two separate modes of request execution. 10 | A request is always acquired from the request queue via 11 | elv_next_request(). After that, drivers are free to either dequeue it 12 | or process it without dequeueing. Dequeue allows elv_next_request() 13 | to return the next request so that multiple requests can be in flight. 14 | 15 | Executing requests without dequeueing has its merits mostly in 16 | allowing drivers for simpler devices which can't do sg to deal with 17 | segments only without considering request boundary. However, the 18 | benefit this brings is dubious and declining while the cost of the API 19 | ambiguity is increasing. Segment based drivers are usually for very 20 | old or limited devices and as converting to dequeueing model isn't 21 | difficult, it doesn't justify the API overhead it puts on block layer 22 | and its more modern users. 23 | 24 | Previous patches converted all block low level drivers to dequeueing 25 | model. This patch completes the API transition by... 26 | 27 | * renaming elv_next_request() to blk_peek_request() 28 | 29 | * renaming blkdev_dequeue_request() to blk_start_request() 30 | 31 | * adding blk_fetch_request() which is combination of peek and start 32 | 33 | * disallowing completion of queued (not started) requests 34 | 35 | * applying new API to all LLDs 36 | 37 | Renamings are for consistency and to break out of tree code so that 38 | it's apparent that out of tree drivers need updating. 39 | 40 | [ Impact: block request issue API cleanup, no functional change ] 41 | -------------------------------------------------------------------------------- /aoetools-36/aoe-discover.8: -------------------------------------------------------------------------------- 1 | .TH aoe-discover 8 2 | .SH NAME 3 | aoe-discover \- tell aoe driver to discover AoE devices 4 | .SH SYNOPSIS 5 | .nf 6 | .B aoe-discover 7 | .fi 8 | .SH DESCRIPTION 9 | The 10 | .I aoe-discover 11 | command tells the aoe driver to discover ATA over Ethernet (AoE) 12 | devices on the network. All network interfaces will be probed with a 13 | AoE config query broadcast. 14 | .PP 15 | If the 16 | .I aoe-interfaces 17 | command has limited the allowable network interfaces, only devices 18 | discovered via allowable interfaces will become available. The 19 | default is to make available all AoE devices found on all accessible 20 | ethernet networks. 21 | .PP 22 | It's good to run the 23 | .I aoe-discover 24 | command after running \fIaoe-interfaces\fP. 25 | .SH EXAMPLE 26 | In this example, the root user on a host named 27 | .I nai 28 | loads the aoe module with only eth0 allowable for AoE traffic. After 29 | remembering that shelf 7 is on eth3, this 30 | sysadmin uses 31 | .I aoe-interfaces 32 | to add eth3 to the list of allowable network interfaces and then 33 | calls 34 | .I aoe-discover 35 | to ask the aoe driver to look for new AoE devices. 36 | .IP 37 | .EX 38 | .nf 39 | nai:~# modprobe aoe aoe_iflist="eth0" 40 | nai:~# aoe-stat 41 | e10.9 eth0 up 42 | nai:~# aoe-interfaces eth0 eth3 43 | nai:~# aoe-discover 44 | nai:~# aoe-stat 45 | e7.0 eth3 up 46 | e7.1 eth3 up 47 | e7.2 eth3 up 48 | e7.3 eth3 up 49 | e7.4 eth3 up 50 | e7.5 eth3 up 51 | e7.6 eth3 up 52 | e7.7 eth3 up 53 | e7.8 eth3 up 54 | e7.9 eth3 up 55 | e10.9 eth0 up 56 | .fi 57 | .EE 58 | .SH "SEE ALSO" 59 | .IR aoe-interfaces (8), 60 | .IR aoe-stat (8), 61 | .IR aoetools (8). 62 | .SH AUTHOR 63 | Ed L. Cashin (ecashin@coraid.com) 64 | -------------------------------------------------------------------------------- /aoetools-36/dat.h: -------------------------------------------------------------------------------- 1 | /* dat.h - aoetools type definitions and macros 2 | * Copyright 2009, CORAID, Inc., and licensed under GPL v.2. 3 | */ 4 | 5 | #define nil NULL 6 | #define nelem(x) (sizeof(x)/sizeof((x)[0])) 7 | 8 | typedef unsigned char uchar; 9 | typedef struct Aoehdr Aoehdr; 10 | typedef struct Ata Ata; 11 | typedef struct Conf Conf; 12 | typedef struct Ataregs Ataregs; 13 | 14 | /* use C99's stdint.h for fixed-width types 15 | * 16 | * There's no guarantee an unsigned short is 16-bits wide, 17 | * but uint16_t is always correct. 18 | */ 19 | typedef uint64_t vlong; 20 | typedef uint32_t u32; 21 | typedef uint16_t u16; 22 | 23 | struct Ataregs { 24 | vlong lba; 25 | uchar cmd; 26 | uchar status; 27 | uchar err; 28 | uchar feature; 29 | uchar sectors; 30 | }; 31 | 32 | struct Aoehdr { 33 | uchar dst[6]; 34 | uchar src[6]; 35 | u16 type; 36 | uchar flags; 37 | uchar error; 38 | u16 maj; 39 | uchar min; 40 | uchar cmd; 41 | uchar tag[4]; 42 | }; 43 | 44 | struct Ata { 45 | Aoehdr h; 46 | uchar aflag; 47 | uchar err; 48 | uchar sectors; 49 | uchar cmd; 50 | uchar lba[6]; 51 | uchar resvd[2]; 52 | uchar data[1024]; 53 | }; 54 | 55 | struct Conf { 56 | Aoehdr h; 57 | u16 bufcnt; 58 | u16 firmware; 59 | uchar scnt; 60 | uchar vercmd; 61 | u16 len; 62 | uchar data[1024]; 63 | }; 64 | 65 | enum { 66 | AOE_ETH_PROTO = 0x88a2, 67 | 68 | AoEver = 1, 69 | 70 | ATAcmd = 0, // command codes 71 | Config, 72 | 73 | Resp = 1<<3, // flags 74 | Error = 1<<2, 75 | 76 | BadCmd = 1, 77 | BadArg, 78 | DevUnavailable, 79 | ConfigErr, 80 | BadVersion, 81 | 82 | Write = 1<<0, 83 | Async = 1<<1, 84 | Device = 1<<4, 85 | Extend = 1<<6, 86 | 87 | Qread = 0, 88 | Qtest, 89 | Qprefix, 90 | Qset, 91 | Qfset, 92 | 93 | Nretries = 3, 94 | 95 | ATAid_dev = 0xec, // ATA commands 96 | ATAsmart = 0xb0, 97 | 98 | ATAabrt = 0x4, // ATA error bits 99 | 100 | SmartDataPut = 0x01, 101 | SmartDataRet = 0x10, 102 | }; 103 | -------------------------------------------------------------------------------- /aoetools-36/linux.c: -------------------------------------------------------------------------------- 1 | /* linux.c: low level access routines for Linux 2 | * Copyright 2009, CORAID, Inc., and licensed under GPL v.2. 3 | */ 4 | #include "config.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include /* for the glibc version number */ 12 | #if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1 13 | #include 14 | #include /* the L2 protocols */ 15 | #else 16 | #include 17 | #include 18 | #include /* The L2 protocols */ 19 | #endif 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include "dat.h" 29 | #include "fns.h" 30 | 31 | static int 32 | getindx(int s, char *name) // return the index of device 'name' 33 | { 34 | struct ifreq xx; 35 | int n; 36 | 37 | strcpy(xx.ifr_name, name); 38 | n = ioctl(s, SIOCGIFINDEX, &xx); 39 | if (n == -1) 40 | return -1; 41 | return xx.ifr_ifindex; 42 | } 43 | 44 | int 45 | dial(char *eth) // get us a raw connection to an interface 46 | { 47 | int i; 48 | int n, s; 49 | struct sockaddr_ll sa; 50 | enum { aoe_type = 0x88a2 }; 51 | 52 | memset(&sa, 0, sizeof sa); 53 | s = socket(PF_PACKET, SOCK_RAW, htons(aoe_type)); 54 | if (s == -1) { 55 | perror("got bad socket"); 56 | return -1; 57 | } 58 | i = getindx(s, eth); 59 | sa.sll_family = AF_PACKET; 60 | sa.sll_protocol = htons(0x88a2); 61 | sa.sll_ifindex = i; 62 | n = bind(s, (struct sockaddr *)&sa, sizeof sa); 63 | if (n == -1) { 64 | perror("bind funky"); 65 | return -1; 66 | } 67 | return s; 68 | } 69 | 70 | int 71 | getea(int s, char *name, uchar *ea) 72 | { 73 | struct ifreq xx; 74 | int n; 75 | 76 | strcpy(xx.ifr_name, name); 77 | n = ioctl(s, SIOCGIFHWADDR, &xx); 78 | if (n == -1) { 79 | perror("Can't get hw addr"); 80 | return 0; 81 | } 82 | memmove(ea, xx.ifr_hwaddr.sa_data, 6); 83 | return 1; 84 | } 85 | -------------------------------------------------------------------------------- /conf/25-patches/none-relay6.diff: -------------------------------------------------------------------------------- 1 | diff -upr none/linux/drivers/block/aoe/aoedbg.c relay6/linux/drivers/block/aoe/aoedbg.c 2 | --- none/linux/drivers/block/aoe/aoedbg.c 2008-10-17 11:51:51.000000000 -0400 3 | +++ relay6/linux/drivers/block/aoe/aoedbg.c 2008-10-17 09:37:31.000000000 -0400 4 | @@ -1,59 +1,12 @@ 5 | #include 6 | #include 7 | -#include 8 | -#include 9 | -#include 10 | -#include 11 | -#include 12 | -#include 13 | +#include 14 | +#include 15 | #include "aoe.h" 16 | 17 | #define SUBBUF_SIZE 262144 18 | #define N_SUBBUFS 8 19 | 20 | -#undef AOEDBG_ACTIVE 21 | -#define AOEDBG_ACTIVE 0 22 | -/* dummy implementations for systems without relay */ 23 | -struct rchan { 24 | - int dummy; 25 | -}; 26 | -struct rchan_buf { 27 | - int dummy; 28 | -}; 29 | -static struct file_operations relay_file_operations; 30 | -struct rchan_callbacks 31 | -{ 32 | - int (*subbuf_start)(struct rchan_buf *buf, 33 | - void *subbuf, 34 | - void *prev_subbuf, 35 | - size_t prev_padding); 36 | - struct dentry *(*create_buf_file)(const char *filename, 37 | - struct dentry *parent, 38 | - int mode, 39 | - struct rchan_buf *buf, 40 | - int *is_global); 41 | - int (*remove_buf_file)(struct dentry *dentry); 42 | -}; 43 | -static struct dentry * 44 | -debugfs_create_file(const char *name, mode_t mode, 45 | - struct dentry *parent, void *data, 46 | - const struct file_operations *fops) 47 | -{ return NULL; } 48 | -void debugfs_remove(struct dentry *dentry) { } 49 | -struct rchan *relay_open(const char *base_filename, 50 | - struct dentry *parent, 51 | - size_t subbuf_size, 52 | - size_t n_subbufs, 53 | - struct rchan_callbacks *cb, 54 | - void *private_data) 55 | -{ return NULL; } 56 | -static void relay_write(struct rchan *chan, 57 | - const void *data, 58 | - size_t length) 59 | -{ } 60 | -extern void relay_flush(struct rchan *chan) { } 61 | -extern void relay_close(struct rchan *chan) { } 62 | - 63 | /* aoe module channel for ad hoc messages */ 64 | static struct rchan *chan; 65 | 66 | -------------------------------------------------------------------------------- /conf/8-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | diff --git a/linux/drivers/block/aoe/aoe.h b/linux/drivers/block/aoe/aoe.h 2 | index ece38d3..dc3be54 100644 3 | --- a/linux/drivers/block/aoe/aoe.h 4 | +++ b/linux/drivers/block/aoe/aoe.h 5 | @@ -253,9 +253,6 @@ unsigned long long mac_addr(char addr[6]); 6 | */ 7 | extern void *aoe_kcalloc(size_t, size_t, int); 8 | 9 | -/* compatibility with pre-2.6.9 kernels */ 10 | -unsigned long msleep_interruptible(unsigned int msecs); 11 | - 12 | #define AOEDBG_ACTIVE 0 13 | void __init aoedbg_init(void); 14 | void aoedbg_print(char *fmt, ...); 15 | diff --git a/linux/drivers/block/aoe/aoechr.c b/linux/drivers/block/aoe/aoechr.c 16 | index 3eb619b..b542143 100644 17 | --- a/linux/drivers/block/aoe/aoechr.c 18 | +++ b/linux/drivers/block/aoe/aoechr.c 19 | @@ -72,47 +72,6 @@ interfaces(const char __user *str, size_t size) 20 | return 0; 21 | } 22 | 23 | -/* from include/linux/time.h in 2.6.9 */ 24 | -static inline unsigned int aoe_jiffies_to_msecs(const unsigned long j) 25 | -{ 26 | -#if HZ <= 1000 && !(1000 % HZ) 27 | - return (1000 / HZ) * j; 28 | -#elif HZ > 1000 && !(HZ % 1000) 29 | - return (j + (HZ / 1000) - 1)/(HZ / 1000); 30 | -#else 31 | - return (j * 1000) / HZ; 32 | -#endif 33 | -} 34 | - 35 | -static inline unsigned long aoe_msecs_to_jiffies(const unsigned int m) 36 | -{ 37 | - if (m > aoe_jiffies_to_msecs(MAX_JIFFY_OFFSET)) 38 | - return MAX_JIFFY_OFFSET; 39 | -#if HZ <= 1000 && !(1000 % HZ) 40 | - return (m + (1000 / HZ) - 1) / (1000 / HZ); 41 | -#elif HZ > 1000 && !(HZ % 1000) 42 | - return m * (HZ / 1000); 43 | -#else 44 | - return (m * HZ + 999) / 1000; 45 | -#endif 46 | -} 47 | - 48 | -/* from kernel/timer.c in 2.6.9 */ 49 | -/** 50 | - * msleep_interruptible - sleep waiting for waitqueue interruptions 51 | - * @msecs: Time in milliseconds to sleep for 52 | - */ 53 | -unsigned long msleep_interruptible(unsigned int msecs) 54 | -{ 55 | - unsigned long timeout = aoe_msecs_to_jiffies(msecs); 56 | - 57 | - while (timeout && !signal_pending(current)) { 58 | - set_current_state(TASK_INTERRUPTIBLE); 59 | - timeout = schedule_timeout(timeout); 60 | - } 61 | - return aoe_jiffies_to_msecs(timeout); 62 | -} 63 | - 64 | static int 65 | revalidate(const char __user *str, size_t size) 66 | { 67 | -------------------------------------------------------------------------------- /aoetools-36/aoe-stat.in: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # aoe-stat - collate and present information about AoE storage 3 | # Copyright 2012, CORAID, Inc., and licensed under GPL v.2. 4 | 5 | set -e 6 | me=`basename $0` 7 | sysd=${sysfs_dir:-/sys} 8 | 9 | # printf "$format" device mac netif state 10 | 11 | # Suse 9.1 Pro doesn't put /sys in /etc/mtab 12 | #test -z "`mount | grep sysfs`" && { 13 | test ! -d "$sysd/block" && { 14 | echo "$me Error: sysfs is not mounted" 1>&2 15 | exit 1 16 | } 17 | 18 | checknode () { 19 | devname="$1" 20 | m_sysfs="$2" 21 | if test -b "@devdir@/$devname"; then 22 | m_node="`ls -l \"@devdir@/$devname\" | awk '{print $6}'`" 23 | test "$m_sysfs" = "$m_node" || { 24 | cat 1>&2 </dev/null | grep -v p` end; do 48 | # maybe ls comes up empty, so we use "end" 49 | test $d = end && continue 50 | 51 | test -r "$d/payload" && payload=yes 52 | done 53 | if test "$payload" = "yes"; then 54 | format="%10s %15s %10s %-5s %-14s\n" 55 | else 56 | format="%10s %15s %6s %-14s\n" 57 | fi 58 | for d in `ls -d $sysd/block/*e[0-9]*\.[0-9]* 2>/dev/null | grep -v p` end; do 59 | test $d = end && continue 60 | 61 | dev=`echo "$d" | sed 's/.*!//'` 62 | if test -r "$d"/dev; then 63 | minor="`awk -F: '{print $2}' \"$d/dev\"`" 64 | checknode "$dev" "$minor" 65 | else 66 | minor="$NA" 67 | fi 68 | sectors=`cat_or_NA "$d"/size` 69 | if test "$sectors" = "$NA"; then 70 | psize="$NA" 71 | else 72 | psize=$(((512000 * $sectors) / (1000 * 1000 * 1000))) 73 | psize=`printf "%04d\n" $psize | sed 's!\(...\)$!.\1!'`GB 74 | fi 75 | netif=`cat_or_NA "$d"/netif` 76 | state=`cat_or_NA "$d"/state` 77 | payload=`cat_or_NA "$d"/payload` 78 | if test "$payload" != "$NA"; then 79 | printf "$format" \ 80 | "$dev" \ 81 | "${psize}" \ 82 | "$netif" \ 83 | "$payload" \ 84 | "$state" 85 | else 86 | printf "$format" \ 87 | "$dev" \ 88 | "${psize}" \ 89 | "$netif" \ 90 | "$state" 91 | fi 92 | done | sort | grep $re 93 | -------------------------------------------------------------------------------- /aoetools-36/README: -------------------------------------------------------------------------------- 1 | The aoetools are programs that assist in using ATA over Ethernet on 2 | systems with version 2.6 and newer Linux kernels. 3 | 4 | Systems running 2.4 Linux kernels do not need and should not install 5 | the aoetools. The aoe driver for 2.4 kernels is self sufficient. 6 | 7 | Please see the aoetools manpage for a brief list of the tools. 8 | 9 | -------------------------------------------------------------------- 10 | AOE DRIVER COMPATIBILITY 11 | 12 | If you are using udev on your system, the aoe-mkdevs and aoe-mkshelf 13 | should not be used. Just let udev create device nodes for you. If 14 | you need to configure udev, its manpages, in conjunction with the 15 | example in the EtherDrive HOWTO FAQ, should help. 16 | 17 | If you are not using udev, it is important to ensure that the device 18 | nodes in /dev/etherd match the aoe driver. Please see devnodes.txt 19 | for information. 20 | 21 | -------------------------------------------------------------------- 22 | BUILDING THE AOETOOLS 23 | 24 | If you need to configure the software, look at the variables at the 25 | top of the Makefile. The defaults should work for most people. When 26 | using the defaults there's only one step to configure and install the 27 | aoetools software and documentation: 28 | 29 | make install 30 | 31 | You'll need sufficient permissions to install in the default locations 32 | if you haven't overridden them with your own locations. 33 | 34 | The aoe-sancheck tool depends on libpthread. If its header and 35 | library files are not present, the aoetools makefile skips 36 | aoe-sancheck. You can install your Linux distribution's "libpthread" 37 | and "libpthread-devel" packages (They might be called something 38 | slightly different) to help aoe-sancheck to build successfully. 39 | 40 | -------------------------------------------------------------------- 41 | LEGACY TOOLS 42 | 43 | These two are legacy commands for systems without udev. 44 | 45 | aoe-mkdevs create character and block device files 46 | aoe-mkshelf create block device files for one shelf address 47 | 48 | -------------------------------------------------------------------- 49 | RESOURCES 50 | 51 | The aoetools homepage 52 | http://aoetools.sourceforge.net/ 53 | 54 | The CORAID homepage 55 | http://www.coraid.com/ 56 | 57 | The Linux Support Page at CORAID 58 | http://support.coraid.com/support/linux/ 59 | -------------------------------------------------------------------------------- /conf/25-patches/none-relay5.diff: -------------------------------------------------------------------------------- 1 | diff -upr none/linux/drivers/block/aoe/aoedbg.c relay5/linux/drivers/block/aoe/aoedbg.c 2 | --- none/linux/drivers/block/aoe/aoedbg.c 2008-10-17 11:51:51.000000000 -0400 3 | +++ relay5/linux/drivers/block/aoe/aoedbg.c 2008-10-17 11:10:02.000000000 -0400 4 | @@ -1,59 +1,12 @@ 5 | #include 6 | #include 7 | -#include 8 | -#include 9 | -#include 10 | -#include 11 | -#include 12 | -#include 13 | +#include 14 | +#include 15 | #include "aoe.h" 16 | 17 | #define SUBBUF_SIZE 262144 18 | #define N_SUBBUFS 8 19 | 20 | -#undef AOEDBG_ACTIVE 21 | -#define AOEDBG_ACTIVE 0 22 | -/* dummy implementations for systems without relay */ 23 | -struct rchan { 24 | - int dummy; 25 | -}; 26 | -struct rchan_buf { 27 | - int dummy; 28 | -}; 29 | -static struct file_operations relay_file_operations; 30 | -struct rchan_callbacks 31 | -{ 32 | - int (*subbuf_start)(struct rchan_buf *buf, 33 | - void *subbuf, 34 | - void *prev_subbuf, 35 | - size_t prev_padding); 36 | - struct dentry *(*create_buf_file)(const char *filename, 37 | - struct dentry *parent, 38 | - int mode, 39 | - struct rchan_buf *buf, 40 | - int *is_global); 41 | - int (*remove_buf_file)(struct dentry *dentry); 42 | -}; 43 | -static struct dentry * 44 | -debugfs_create_file(const char *name, mode_t mode, 45 | - struct dentry *parent, void *data, 46 | - const struct file_operations *fops) 47 | -{ return NULL; } 48 | -void debugfs_remove(struct dentry *dentry) { } 49 | -struct rchan *relay_open(const char *base_filename, 50 | - struct dentry *parent, 51 | - size_t subbuf_size, 52 | - size_t n_subbufs, 53 | - struct rchan_callbacks *cb, 54 | - void *private_data) 55 | -{ return NULL; } 56 | -static void relay_write(struct rchan *chan, 57 | - const void *data, 58 | - size_t length) 59 | -{ } 60 | -extern void relay_flush(struct rchan *chan) { } 61 | -extern void relay_close(struct rchan *chan) { } 62 | - 63 | /* aoe module channel for ad hoc messages */ 64 | static struct rchan *chan; 65 | 66 | @@ -112,7 +66,7 @@ xrelay_open(const char *base_fnam, 67 | { 68 | struct rchan *c; 69 | 70 | - c = relay_open(base_fnam, parent, subbuf_size, n_subbufs, &cb, NULL); 71 | + c = relay_open(base_fnam, parent, subbuf_size, n_subbufs, &cb); 72 | 73 | if (!c) 74 | printk(KERN_ERR 75 | -------------------------------------------------------------------------------- /conf/30-patches/old-new.diff: -------------------------------------------------------------------------------- 1 | commit 077517992e7cb7e0b4407fb9cb3bbcf01f3d36e2 2 | Author: Ed Cashin 3 | Date: Mon Jul 20 14:19:06 2009 -0400 4 | 5 | include ata.h and use ATA_CMD_PIO_* instead of WIN_* 6 | 7 | based on 04b3ab52a000ab7e718efc97e9fdd67d95002d11 8 | Author: Bartlomiej Zolnierkiewicz 9 | Date: Wed Apr 1 21:42:24 2009 +0200 10 | 11 | aoe: WIN_* -> ATA_CMD_* 12 | 13 | * Use ATA_CMD_* defines instead of WIN_* ones. 14 | 15 | * Include directly instead of through . 16 | 17 | Cc: Ed L. Cashin 18 | Signed-off-by: Bartlomiej Zolnierkiewicz 19 | 20 | diff --git a/linux/drivers/block/aoe/aoecmd.c b/linux/drivers/block/aoe/aoecmd.c 21 | index 741dd82..d188b5b 100644 22 | --- a/linux/drivers/block/aoe/aoecmd.c 23 | +++ b/linux/drivers/block/aoe/aoecmd.c 24 | @@ -4,6 +4,7 @@ 25 | * Filesystem request handling methods 26 | */ 27 | 28 | +#include 29 | #include 30 | #include 31 | #include 32 | @@ -377,7 +378,7 @@ ata_rw_frameinit(struct frame *f) 33 | writebit = 0; 34 | } 35 | 36 | - ah->cmdstat = WIN_READ | writebit | extbit; 37 | + ah->cmdstat = ATA_CMD_PIO_READ | writebit | extbit; 38 | skb->dev = t->ifp->nd; 39 | } 40 | 41 | @@ -1182,8 +1183,8 @@ noskb: if (buf) 42 | 43 | n = ahout->scnt << 9; 44 | switch (ahout->cmdstat) { 45 | - case WIN_READ: 46 | - case WIN_READ_EXT: 47 | + case ATA_CMD_PIO_READ: 48 | + case ATA_CMD_PIO_READ_EXT: 49 | if (skb->len < n) { 50 | printk(KERN_ERR 51 | "aoe: runt data size in read from e%ld.%d." 52 | @@ -1194,15 +1195,15 @@ noskb: if (buf) 53 | break; 54 | } 55 | bvcpy(f->bv, f->bv_off, skb, n); 56 | - case WIN_WRITE: 57 | - case WIN_WRITE_EXT: 58 | + case ATA_CMD_PIO_WRITE: 59 | + case ATA_CMD_PIO_WRITE_EXT: 60 | spin_lock_irq(&d->lock); 61 | ifp = getif(t, skb->dev); 62 | if (ifp) 63 | ifp->lost = 0; 64 | spin_unlock_irq(&d->lock); 65 | break; 66 | - case WIN_IDENTIFY: 67 | + case ATA_CMD_ID_ATA: 68 | if (skb->len < 512) { 69 | printk(KERN_INFO 70 | "aoe: runt data size in ataid from e%ld.%d." 71 | @@ -1425,7 +1426,7 @@ aoecmd_ata_id(struct aoedev *d) 72 | 73 | /* set up ata header */ 74 | ah->scnt = 1; 75 | - ah->cmdstat = WIN_IDENTIFY; 76 | + ah->cmdstat = ATA_CMD_ID_ATA; 77 | ah->lba3 = 0xa0; 78 | 79 | skb->dev = t->ifp->nd; 80 | -------------------------------------------------------------------------------- /aoetools-36/aoe-mkshelf.8: -------------------------------------------------------------------------------- 1 | .TH aoe-mkshelf 8 2 | .SH NAME 3 | aoe-mkshelf \- create special device files for one shelf address 4 | .SH SYNOPSIS 5 | .nf 6 | .B aoe-mkshelf {device-dir} {shelf-address} 7 | .B env n_partitions=1 aoe-mkshelf {device-dir} {shelf-address} 8 | .fi 9 | .SH DESCRIPTION 10 | The 11 | .I aoe-mkshelf 12 | command is not needed on systems that have udev installed and 13 | is incompatible with aoe drivers that have the \fIaoe_dyndevs\fP 14 | module parameter set to 1. 15 | .PP 16 | Systems lacking udev and having an aoe driver that uses static minor 17 | device numbers can use \fIaoe-mkshelf\fP to create the block special 18 | files necessary to access the AoE devices with the given shelf 19 | address. 20 | .PP 21 | All aoe drivers prior to \fIaoe6-50\fP use static minor device 22 | numbers. Versions 50 and up use dynamic minor device numbers 23 | when the module parameter aoe_dyndevs=1 is set. 24 | .PP 25 | If you are using static minor device numbers and your aoe driver 26 | supports only one partition per device (whole-disk 27 | partitions), then the device files must match, and you should use the 28 | .I n_partitions 29 | environment variable described below. 30 | .SS Arguments 31 | .TP 32 | \fBdevice-dir\fP 33 | This should be the name of the directory where the block device files 34 | will be created. 35 | .TP 36 | \fBshelf-address\fP 37 | This is the AoE major address, or shelf address, for which to create 38 | device nodes. For example, specifying a shelf address of 1 means that 39 | the e1.* device nodes will be created in \fBdevice-dir\fP. 40 | .SH ENVIRONMENT VARIABLES 41 | If the 42 | .I n_partitions 43 | variable is set in the environment, it will override the default 44 | number of partitions per aoe disk, namely 16. 45 | .SH EXAMPLE 46 | In this example, the root user on a host named 47 | .I nai 48 | creates special files for using the aoe disks in shelf 7. Then he 49 | remembers that the driver doesn't have partition support, so the 50 | command is called again with \fIn_partitions\fP set to 1. 51 | .IP 52 | .EX 53 | .nf 54 | nai:~# aoe-mkshelf /dev/etherd 7 55 | nai:~# ls /dev/etherd/e7.* | wc -l 56 | 160 57 | nai:~# rm /dev/etherd/e7.* 58 | nai:~# n_partitions=1 aoe-mkshelf /dev/etherd 7 59 | nai:~# ls /dev/etherd/e7.* | wc -l 60 | 10 61 | nai:~# 62 | .fi 63 | .EE 64 | .SH "SEE ALSO" 65 | .IR aoe-discover (8), 66 | .IR aoe-interfaces (8), 67 | .IR aoe-mkdevs (8), 68 | .IR aoe-stat (8), 69 | .IR aoetools (8), 70 | .IR udev (7). 71 | .SH AUTHOR 72 | Ed L. Cashin (ecashin@coraid.com) 73 | -------------------------------------------------------------------------------- /aoetools-36/aoe-mkdevs.8: -------------------------------------------------------------------------------- 1 | .TH aoe-mkdevs 8 2 | .SH NAME 3 | aoe-mkdevs \- create special device files for aoe driver 4 | .SH SYNOPSIS 5 | .nf 6 | .B aoe-mkdevs {device-dir} 7 | .B env n_partitions=1 aoe-mkdevs {device-dir} 8 | .fi 9 | .SH DESCRIPTION 10 | The 11 | .I aoe-mkdevs 12 | command is deprecated in favor of udev. Systems with udev do not need 13 | to use the \fIaoe-mkdevs\fP or \fIaoe-mkself\fP commands, because udev 14 | will create device nodes as needed. 15 | .PP 16 | Systems without udev use \fIaoe-mkdevs\fP to create the character 17 | special files necessary to 18 | control the aoe driver. The \fIaoe-mkdevs\fP command uses 19 | .I aoe-mkshelf 20 | to also create block special files. 21 | .PP 22 | The aoe drivers after version 49 support dynamic minor device numbers 23 | so that a greater number of devices can be supported. The 24 | \fIaoe-mkdevs\fP command is incompatible with dynamic device numbers. 25 | If your system lacks udev, and you are using an aoe driver version 50 26 | or above, use the aoe_dyndevs=0 module option to force the aoe driver 27 | to use static device numbers. 28 | .PP 29 | If you are not using dynamic device numbers, and you built your aoe 30 | driver to support only one partition per device 31 | (whole-disk 32 | partitions), then the device files must match, and you should use the 33 | .I n_partitions 34 | environment variable described below. 35 | .SS Arguments 36 | .TP 37 | \fBdevice-dir\fP 38 | This should be the name of the directory where the special device files 39 | will be created. 40 | .SH ENVIRONMENT VARIABLES 41 | If the 42 | .I n_partitions 43 | variable is set in the environment, it will override the default 44 | number of partitions per aoe disk, namely 16. 45 | .SH EXAMPLE 46 | In this example, the root user on a host named 47 | .I nai 48 | creates special files for using the aoe disks in shelf 7. After 49 | remembering that the driver doesn't have partition support, this 50 | sysadmin gets rid of the mismatching device nodes and calls 51 | \fIaoe-mkdevs\fP again with \fIn_partitions\fP set to 1. 52 | .IP 53 | .EX 54 | .nf 55 | nai:~# rm -rf /dev/etherd 56 | nai:~# aoe-mkdevs /dev/etherd 57 | nai:~# ls /dev/etherd | wc -l 58 | 1603 59 | nai:~# rm -rf /dev/etherd 60 | nai:~# n_partitions=1 aoe-mkdevs /dev/etherd 61 | nai:~# ls /dev/etherd | wc -l 62 | 103 63 | .fi 64 | .EE 65 | .SH "SEE ALSO" 66 | .IR aoe-discover (8), 67 | .IR aoe-interfaces (8), 68 | .IR aoe-mkshelf (8), 69 | .IR aoe-stat (8), 70 | .IR aoetools (8), 71 | .IR udev (7). 72 | .SH AUTHOR 73 | Ed L. Cashin (ecashin@coraid.com) 74 | -------------------------------------------------------------------------------- /aoetools-36/coraid-update: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # usage: coraid-update {update file} {AoE target} 3 | # coraid-update depends upon sysfs mounted on /sys 4 | 5 | # The destination must be, 6 | # 1) an AoE target ready for I/O, and 7 | # 2) not too big to be an update target 8 | # 9 | # Later, when CORAID appliances mark update targets with special ATA 10 | # device identify content or special target content, a prompt should 11 | # be added after the check of the target's size if the identifying 12 | # content is not detected. 13 | # 14 | # The update file must either, 15 | # 1) be an SR tarc file that looks OK to the local tar, or 16 | # 2) any file not ending in ".tarc". 17 | 18 | # size of update LUN in /proc/partitions is 40000 19 | max=70000 20 | 21 | usage="usage: coraid-update {update file} {AoE device}" 22 | if test "$#" != 2; then 23 | echo "$usage" 1>&2 24 | exit 1 25 | fi 26 | update="$1" 27 | ulb="$2" 28 | 29 | # if it's an update target, it should be in `aoe-stat` 30 | aoe-stat | awk -vt="`basename $ulb`" ' 31 | BEGIN{fail=1} 32 | $1==t{fail=0} 33 | END{exit fail}' || { 34 | exec 1>&2 35 | echo "coraid-update Error: \"$ulb\" is not an AoE target" 36 | echo "$usage" 37 | exit 1 38 | } 39 | 40 | # it should have a size no larger than $max in /proc/partitions 41 | t="`echo $ulb | sed 's!^/dev/!!'`" 42 | awk -vt="$t" '$NF==t{print $3}' /proc/partitions | 43 | awk -vhi=$max -vdev="$ulb" ' 44 | BEGIN{ 45 | err = "could not get size of " dev 46 | } { 47 | err = "none" 48 | if ($1 > hi) { 49 | err = dev " is too large to be an update target" 50 | exit 51 | } 52 | } END{ 53 | if (err != "none") { 54 | print "Error coraid-update: " err > "/dev/stderr" 55 | exit 1 56 | } 57 | exit 0 58 | }' || exit 1 59 | 60 | # this test should be removed when it is performed on the appliance 61 | # 62 | # For a 2734080-byte tarc file, an incomplete file of 2727450 bytes passes 63 | # this test, but one of 2727400 does not. So this test isn't fullproof. 64 | # 65 | if test "`echo \"$update\" | grep '\.tarc$'`"; then 66 | tar tf "$update" > /dev/null 2>&1 || { 67 | exec 1>&2 68 | echo "coraid-update Error: \"$update\" does not appear to be a valid tarc file" 69 | exit 1 70 | } 71 | fi 72 | if test ! -r "$update"; then 73 | echo "coraid-update Error: \"$update\" is not readable" 1>&2 74 | exit 1 75 | fi 76 | 77 | # send it over and complain on error 78 | if ! dd if="$update" of="$ulb" 2> /dev/null || ! sync; then 79 | exec 1>&2 80 | echo "coraid-update Error: could not successfully write \"$update\" to \"$ulb\"" 81 | exit 1 82 | fi 83 | -------------------------------------------------------------------------------- /aoetools-36/aoecfg.8: -------------------------------------------------------------------------------- 1 | .TH aoecfg 8 2 | .SH NAME 3 | aoecfg \- manipulate AoE configuration strings 4 | .SH SYNOPSIS 5 | .B aoecfg 6 | [-c \fIcmd\fR] [-s \fIcfgstr\fR] [-t \fItimeout\fR] [\fIshelf slot\fR] [\fInetif\fR] 7 | .fi 8 | .SH DESCRIPTION 9 | .IR Aoecfg (8) 10 | sends AoE configuration commands that control the retrivial, conditional 11 | or unconditional setting of AoE configuration strings. Since configuration 12 | happens before the MAC address of the target is known, the packet is 13 | broadcast. AoE targets with a matching shelf and slot respond. Since 14 | the default shelf and slot are the wildcard values 0xffff and 0xff, 15 | with no arguments 16 | .IR aoecfg (8) 17 | will return configuration strings from all targets visible 18 | on the default interface, 19 | .IR eth0 . 20 | .SH OPTIONS 21 | .TP 8 22 | .BI \-c " cmd" 23 | specify the AoE configuration command. The default is 24 | .IR read . 25 | The available commands are 26 | .HP 8 27 | .B read 28 | Read the server config string without performing any test and 29 | respond. 30 | .HP 8 31 | .B test 32 | Respond only if the specified string exactly matches the server 33 | configuration string. 34 | .HP 8 35 | .B prefix 36 | Respond only if the specified string is a prefix of the server 37 | configuration string. 38 | .HP 8 39 | .B set 40 | If the current server config string is empty, set the server config 41 | string to the argument string and respond. If the current server 42 | config string is not empty, return a response with Flags bit E set 43 | and Error set to 4. 44 | .HP 8 45 | .B fset 46 | Force set the server config string to the argument string and respond. 47 | .TP 48 | .BI \-s " cfgstr" 49 | specify the config string. 50 | .TP 51 | .BI \-t " timeout" 52 | specify the timeout in seconds. The default is no timeout. If neither the shelf 53 | nor the slot are specified, 54 | .IR aoecfg (8) 55 | will exit after the first result. Otherwise, 56 | .IR aoecfg (8) 57 | will exit only after the timeout has expired since it does not know 58 | how many responses to expect. 59 | .TP 60 | .B shelf slot 61 | specify the shelf and slot used in the query. If unspecified, they 62 | default to broadcast. 63 | .TP 64 | .B netif 65 | specifiy the network interface. The default is 66 | .IR eth0 . 67 | .SH "SEE ALSO" 68 | .IR aoe-discover (8), 69 | .IR aoe-interfaces (8), 70 | .IR aoe-mkdevs (8), 71 | .IR aoe-mkshelf (8), 72 | .IR aoe-stat (8), 73 | .IR aoeping (8), 74 | \fIAoE (ATA over Ethernet)\fP: http://support.coraid.com/documents/AoEr10.txt, 75 | \fIATA specification\fP 76 | .SH AUTHOR 77 | Erik Quanstrom (quanstro@coraid.com) 78 | -------------------------------------------------------------------------------- /aoetools-36/aoe-interfaces.8: -------------------------------------------------------------------------------- 1 | .TH aoe-interfaces 8 2 | .SH NAME 3 | aoe-interfaces \- restrict aoe driver to specified network interfaces 4 | .SH SYNOPSIS 5 | .nf 6 | .B aoe-interfaces [dev1] [dev2 ...] 7 | .B aoe-interfaces -c 8 | .fi 9 | .SH DESCRIPTION 10 | The 11 | .I aoe-interfaces 12 | command tells the aoe driver to ignore ATA over Ethernet (AoE) traffic 13 | on all but the specified network interfaces. It is analogous to the 14 | \fIaoe_iflist\fP module load option. 15 | .PP 16 | If neither the \fIaoe_iflist\fP module load option nor the 17 | \fIaoe-interfaces\fP command are used, the aoe driver will use any 18 | network interface for AoE traffic. Using \fIaoe-interfaces\fP to 19 | limit AoE to only trusted networks prevents the case where a rogue AoE 20 | target appears on a public network, diverting data from the legitimate 21 | AoE target. Such an imposter target effectively corrupts the data on 22 | the legitimate target. 23 | .PP 24 | If the aoe driver is a module, then calling 25 | .I aoe-interfaces 26 | without arguments will display the current interfaces list. If it 27 | hasn't been set then the output will be blank. 28 | .PP 29 | It's good to run the 30 | .I aoe-discover 31 | command after setting the AoE interfaces list. 32 | .SH OPTIONS 33 | .TP 34 | \fB-c\fP 35 | The \fB-c\fP flag will clear the interface access list, permitting any interface to be used. 36 | .SH EXAMPLE 37 | In this example, the root user on a host named 38 | .I nai 39 | loads the aoe module with only eth0 allowable for AoE traffic. After 40 | remembering that shelf 7 is on eth3, this 41 | sysadmin uses 42 | .I aoe-interfaces 43 | to add eth3 to the list of allowable network interfaces and then 44 | calls 45 | .I aoe-discover 46 | to ask the aoe driver to look for new AoE devices. 47 | .IP 48 | .EX 49 | .nf 50 | nai:~# modprobe aoe aoe_iflist="eth0" 51 | nai:~# aoe-stat 52 | e10.9 eth0 up 53 | nai:~# aoe-interfaces eth0 eth3 54 | nai:~# aoe-discover 55 | nai:~# aoe-stat 56 | e7.0 eth3 up 57 | e7.1 eth3 up 58 | e7.2 eth3 up 59 | e7.3 eth3 up 60 | e7.4 eth3 up 61 | e7.5 eth3 up 62 | e7.6 eth3 up 63 | e7.7 eth3 up 64 | e7.8 eth3 up 65 | e7.9 eth3 up 66 | e10.9 eth0 up 67 | nai:~# aoe-interfaces 68 | eth0 eth3 69 | .fi 70 | .EE 71 | .SH "SEE ALSO" 72 | .IR aoe-discover (8), 73 | .IR aoe-stat (8), 74 | .IR aoetools (8). 75 | .SH AUTHOR 76 | Ed L. Cashin (ecashin@coraid.com) 77 | -------------------------------------------------------------------------------- /conf/34.txt: -------------------------------------------------------------------------------- 1 | By 2.6.36, they had taken away the owner field in the struct attribute 2 | defined in include/linux/sysfs.h. There are some relevant changelog 3 | excerpts below. 4 | 5 | commit 6fd69dc578fa0b1bbc3aad70ae3af9a137211707 6 | Author: Guenter Roeck 7 | Date: Wed Jul 28 22:09:26 2010 -0700 8 | 9 | sysfs: Remove owner field from sysfs struct attribute 10 | 11 | Signed-off-by: Guenter Roeck 12 | Acked-by: Tejun Heo 13 | Signed-off-by: Greg Kroah-Hartman 14 | 15 | diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h 16 | ... 17 | commit 01e8ef11bc1a74e65678ed55795f59266d4add01 18 | Author: Parag Warudkar 19 | Date: Sat Oct 18 20:28:50 2008 -0700 20 | 21 | x86: sysfs: kill owner field from attribute 22 | 23 | Tejun's commit 7b595756ec1f49e0049a9e01a1298d53a7faaa15 made sysfs 24 | attribute->owner unnecessary. But the field was left in the structure to 25 | ease the merge. It's been over a year since that change and it is now 26 | time to start killing attribute->owner along with its users - one arch at 27 | a time! 28 | 29 | This patch is attempt #1 to get rid of attribute->owner only for 30 | CONFIG_X86_64 or CONFIG_X86_32 . We will deal with other arches later on 31 | as and when possible - avr32 will be the next since that is something I 32 | can test. Compile (make allyesconfig / make allmodconfig / custom config) 33 | and boot tested. 34 | 35 | akpm: the idea is that we put the declaration of sttribute.owner inside 36 | `#ifndef CONFIG_X86'. But that proved to be too ambitious for now because 37 | new usages kept on turning up in subsystem trees. 38 | ... 39 | commit 7b595756ec1f49e0049a9e01a1298d53a7faaa15 40 | Author: Tejun Heo 41 | Date: Thu Jun 14 03:45:17 2007 +0900 42 | 43 | sysfs: kill unnecessary attribute->owner 44 | 45 | sysfs is now completely out of driver/module lifetime game. After 46 | deletion, a sysfs node doesn't access anything outside sysfs proper, 47 | so there's no reason to hold onto the attribute owners. Note that 48 | often the wrong modules were accounted for as owners leading to 49 | accessing removed modules. 50 | 51 | This patch kills now unnecessary attribute->owner. Note that with 52 | this change, userland holding a sysfs node does not prevent the 53 | backing module from being unloaded. 54 | 55 | For more info regarding lifetime rule cleanup, please read the 56 | following message. 57 | 58 | http://article.gmane.org/gmane.linux.kernel/510293 59 | 60 | (tweaked by Greg to not delete the field just yet, to make it easier to 61 | merge things properly.) 62 | 63 | -------------------------------------------------------------------------------- /aoetools-36/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | # You can edit this file or override these variables on 4 | # the commandline. For example, "make install MANDIR=/tmp/man" 5 | # would use defaults for all variables except ${MANDIR}. 6 | 7 | 8 | # You can set this to something like /opt/aoetools-x 9 | # if you want to install everything in one place. 10 | # 11 | # Note that even with ${PREFIX} set, the devices in 12 | # /dev/etherd will be used unless you override ${DEVDIR}. 13 | PREFIX = 14 | 15 | # Your aoe-driver device files should be in ${DEVDIR}. 16 | DEVDIR = /dev/etherd 17 | 18 | # The programs will be installed in ${SBINDIR}. 19 | SBINDIR = ${PREFIX}/usr/sbin 20 | MANDIR = ${PREFIX}/usr/share/man 21 | 22 | # NPERSHELF is the number of slot addresses per shelf address. 23 | # This number must match the same setting in the aoe driver. 24 | # 25 | # Older aoe drivers have NPERSHELF set to 10, and newer ones 26 | # use 16. 27 | # 28 | # You can see the setting in your driver like this in the driver 29 | # source directory. (Change into the "linux" directory if you're 30 | # using the standalone driver from CORAID.) 31 | # 32 | # grep 'NPERSHELF.*=' drivers/block/aoe/aoe.h 33 | # 34 | NPERSHELF=16 35 | 36 | # end of user-configurable variables 37 | 38 | 39 | # these scripts are created from the *.in files 40 | CONF_SCRIPTS = aoe-discover aoe-interfaces aoe-mkshelf aoe-revalidate aoe-flush aoe-stat 41 | PROGS = aoeping aoecfg aoe-sancheck 42 | COMMANDS := ${CONF_SCRIPTS} aoe-mkdevs aoe-version coraid-update ${PROGS} 43 | CFLAGS = -Wall -O -g 44 | SANCHECKLIBS = -lpthread 45 | 46 | AOE_PING_OBJ = aoeping.o linux.o 47 | AOE_CFG_OBJ = aoecfg.o linux.o 48 | SANCHECK_OBJ = aoe-sancheck.o 49 | 50 | all : configure ${PROGS} 51 | @true 52 | 53 | configure : 54 | @for f in ${CONF_SCRIPTS}; do \ 55 | sh -xc "sed -e 's!@devdir@!${DEVDIR}!g' -e 's!@npershelf@!${NPERSHELF}!g' $$f.in > $$f" || break; \ 56 | done 57 | 58 | # DESTDIR was put in for Rob Holland to make gentoo packaging easier 59 | install : all 60 | mkdir -p ${DESTDIR}${SBINDIR} 61 | mkdir -p ${DESTDIR}${MANDIR}/man8 62 | @for f in ${COMMANDS}; do \ 63 | sh -xc "install -m 700 $$f ${DESTDIR}${SBINDIR}/$$f" || break; \ 64 | sh -xc "install -m 664 $$f.8 ${DESTDIR}${MANDIR}/man8/$$f.8" || break; \ 65 | done 66 | 67 | clean : 68 | rm -f ${CONF_SCRIPTS} ${AOE_PING_OBJ} ${AOE_CFG_OBJ} ${SANCHECK_OBJ} ${PROGS} 69 | 70 | aoeping : ${AOE_PING_OBJ} 71 | ${CC} ${CFLAGS} -o $@ ${AOE_PING_OBJ} 72 | aoeping.o : aoeping.c dat.h fns.h 73 | ${CC} ${CFLAGS} -o $@ -c $< 74 | linux.o : linux.c config.h 75 | ${CC} ${CFLAGS} -o $@ -c $< 76 | aoecfg: ${AOE_CFG_OBJ} 77 | ${CC} ${CFLAGS} -o $@ ${AOE_CFG_OBJ} 78 | aoecfg.o : aoecfg.c dat.h fns.h 79 | ${CC} ${CFLAGS} -o $@ -c $< 80 | aoe-sancheck : ${SANCHECK_OBJ} 81 | -$(CC) $(CFLAGS) -o $@ ${SANCHECK_OBJ} $(SANCHECKLIBS) 82 | aoe-sancheck.o : aoe-sancheck.c 83 | -$(CC) $(CFLAGS) -o $@ -c $< 84 | 85 | -------------------------------------------------------------------------------- /aoetools-36/aoe-sancheck.8: -------------------------------------------------------------------------------- 1 | .TH aoe-sancheck 8 2 | .SH NAME 3 | aoe-sancheck \- verify storage network capabilities 4 | .SH SYNOPSIS 5 | .nf 6 | .B aoe-sancheck [\-v] 7 | .fi 8 | .SH DESCRIPTION 9 | The 10 | .I aoe-sancheck 11 | command collects information about the local interfaces and probes the network for ATA over Ethernet devices, validating the paths for each device. It does not use the aoe kernel module but rather the bpf interface to evaluate the network. As such, the aoe module does not need to be loaded to perform the test. 12 | .PP 13 | The output of the command is divided into two sections: information about the local interfaces followed by a list of detected AoE devices. The first section displays the local interfaces, if the interface is up or down, its configured MTU, and the PCI ID for the interface. 14 | .PP 15 | The second section lists detected AoE devices, one per line, with the following information: 16 | .TP 17 | .BI Device 18 | The device name of the form 19 | .I eX.Y 20 | where 21 | .I X 22 | is the AoE device shelf address, and 23 | .I Y 24 | is the AoE device slot address. 25 | .TP 26 | .BI Macs 27 | The number of mac addresses detected for this device. 28 | .TP 29 | .BI Payload 30 | The number of bytes of data the device can handle in a single AoE request. This number does not represent the total frame size as it does not include bytes from ethernet or AoE headers. 31 | .TP 32 | .BI "Local Interfaces" 33 | The list of local interfaces from which the device is visible. 34 | .SS Options 35 | .TP 36 | \fB\-v\fP 37 | Prints out additional raw information. 38 | .SH DIAGNOSIS 39 | For each device, 40 | .I aoe-sancheck 41 | may print out additional lines of suggestions or warnings. The following checks are made: 42 | .TP 43 | .BI "The MTU of the local interfaces is set high enough to handle the AoE device's reported payload. " 44 | Depending on the host NIC's capabilities and storage network switch's capabilities, best performance may or may not be with local interface MTU set higher than a device's payload size. 45 | .TP 46 | .BI "The number of local interfaces matches the number of interfaces on the device. " 47 | Best performance comes from having a host and device with comparable bandwidth. \fIAoe-sancheck\fP simply counts the number of interfaces involved and does not figure link bandwidth in its comparison. 48 | .TP 49 | .BI "All local interfaces for an AoE device have the same MTU." 50 | If one interface for a device has a smaller MTU than the others, the AoE driver must use the smaller payload size for all interfaces. 51 | .TP 52 | .BI "Each path to the device is capable of the configured payload size." 53 | This check detects the situation where a local interface is configured for jumbo frames and the AoE device is capable of jumbo frames, but some aspect of the network is incapable of passing frames that size, for example, a misconfigured switch. \fIAoe-sancheck\fP reports the maximum payload size the path is capable of if less than the configured payload size. 54 | .SH BUGS 55 | The program may sometimes display inconsistent results between runs showing that a path is capable of a smaller frame size than it actually is. If you see this behavior, please email one of the authors with your verbose output. 56 | .SH "SEE ALSO" 57 | .IR aoeping (8), 58 | .IR aoetools (8) 59 | .SH AUTHORS 60 | Justin Sanders (justin@coraid.com), 61 | Sam Hopkins (sah@coraid.com) 62 | -------------------------------------------------------------------------------- /conf/25-patches/fs5-none.diff: -------------------------------------------------------------------------------- 1 | diff -upr fs5/linux/drivers/block/aoe/aoedbg.c none/linux/drivers/block/aoe/aoedbg.c 2 | --- fs5/linux/drivers/block/aoe/aoedbg.c 2008-10-17 11:35:32.000000000 -0400 3 | +++ none/linux/drivers/block/aoe/aoedbg.c 2008-10-17 11:51:51.000000000 -0400 4 | @@ -1,11 +1,59 @@ 5 | #include 6 | #include 7 | -#include 8 | +#include 9 | +#include 10 | +#include 11 | +#include 12 | +#include 13 | +#include 14 | #include "aoe.h" 15 | 16 | #define SUBBUF_SIZE 262144 17 | #define N_SUBBUFS 8 18 | 19 | +#undef AOEDBG_ACTIVE 20 | +#define AOEDBG_ACTIVE 0 21 | +/* dummy implementations for systems without relay */ 22 | +struct rchan { 23 | + int dummy; 24 | +}; 25 | +struct rchan_buf { 26 | + int dummy; 27 | +}; 28 | +static struct file_operations relay_file_operations; 29 | +struct rchan_callbacks 30 | +{ 31 | + int (*subbuf_start)(struct rchan_buf *buf, 32 | + void *subbuf, 33 | + void *prev_subbuf, 34 | + size_t prev_padding); 35 | + struct dentry *(*create_buf_file)(const char *filename, 36 | + struct dentry *parent, 37 | + int mode, 38 | + struct rchan_buf *buf, 39 | + int *is_global); 40 | + int (*remove_buf_file)(struct dentry *dentry); 41 | +}; 42 | +static struct dentry * 43 | +debugfs_create_file(const char *name, mode_t mode, 44 | + struct dentry *parent, void *data, 45 | + const struct file_operations *fops) 46 | +{ return NULL; } 47 | +void debugfs_remove(struct dentry *dentry) { } 48 | +struct rchan *relay_open(const char *base_filename, 49 | + struct dentry *parent, 50 | + size_t subbuf_size, 51 | + size_t n_subbufs, 52 | + struct rchan_callbacks *cb, 53 | + void *private_data) 54 | +{ return NULL; } 55 | +static void relay_write(struct rchan *chan, 56 | + const void *data, 57 | + size_t length) 58 | +{ } 59 | +extern void relay_flush(struct rchan *chan) { } 60 | +extern void relay_close(struct rchan *chan) { } 61 | + 62 | /* aoe module channel for ad hoc messages */ 63 | static struct rchan *chan; 64 | 65 | @@ -18,6 +65,24 @@ struct ddbg { 66 | static char buf[PAGE_SIZE]; 67 | static DEFINE_SPINLOCK(buflock); 68 | 69 | +/* required callbacks for using debugfs as host fs for relay */ 70 | +static struct dentry * 71 | +cfile(const char *filename, 72 | + struct dentry *parent, 73 | + int mode, 74 | + struct rchan_buf *buf, 75 | + int *is_global) 76 | +{ 77 | + return debugfs_create_file(filename, mode, parent, buf, 78 | + &relay_file_operations); 79 | +} 80 | +static int 81 | +rfile(struct dentry *dentry) 82 | +{ 83 | + debugfs_remove(dentry); 84 | + 85 | + return 0; 86 | +} 87 | static int 88 | subbuf_start(struct rchan_buf *buf, 89 | void *subbuf, 90 | @@ -28,6 +93,8 @@ subbuf_start(struct rchan_buf *buf, 91 | } 92 | static struct rchan_callbacks cb = { 93 | .subbuf_start = subbuf_start, 94 | + .create_buf_file = cfile, 95 | + .remove_buf_file = rfile, 96 | }; 97 | 98 | /* Use this xrelay_open instead of using relay_open directly, 99 | @@ -45,7 +112,7 @@ xrelay_open(const char *base_fnam, 100 | { 101 | struct rchan *c; 102 | 103 | - c = relay_open(base_fnam, parent, subbuf_size, n_subbufs, &cb); 104 | + c = relay_open(base_fnam, parent, subbuf_size, n_subbufs, &cb, NULL); 105 | 106 | if (!c) 107 | printk(KERN_ERR 108 | --------------------------------------------------------------------------------