Skip to content

Commit 18dabf4

Browse files
author
Jens Axboe
committed
Change table chaining layout
Change the page member of the scatterlist structure to be an unsigned long, and encode more stuff in the lower bits: - Bits 0 and 1 zero: this is a normal sg entry. Next sg entry is located at sg + 1. - Bit 0 set: this is a chain entry, the next real entry is at ->page_link with the two low bits masked off. - Bit 1 set: this is the final entry in the sg entry. sg_next() will return NULL when passed such an entry. It's thus important that sg table users use the proper accessors to get and set the page member. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
1 parent 58b053e commit 18dabf4

File tree

25 files changed

+79
-49
lines changed

25 files changed

+79
-49
lines changed

include/asm-alpha/scatterlist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <asm/types.h>
66

77
struct scatterlist {
8-
struct page *page;
8+
unsigned long page_link;
99
unsigned int offset;
1010

1111
unsigned int length;

include/asm-arm/scatterlist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <asm/types.h>
66

77
struct scatterlist {
8-
struct page *page; /* buffer page */
8+
unsigned long page_link;
99
unsigned int offset; /* buffer offset */
1010
dma_addr_t dma_address; /* dma address */
1111
unsigned int length; /* length */

include/asm-avr32/scatterlist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <asm/types.h>
55

66
struct scatterlist {
7-
struct page *page;
7+
unsigned long page_link;
88
unsigned int offset;
99
dma_addr_t dma_address;
1010
unsigned int length;

include/asm-blackfin/scatterlist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <linux/mm.h>
55

66
struct scatterlist {
7-
struct page *page;
7+
unsigned long page_link;
88
unsigned int offset;
99
dma_addr_t dma_address;
1010
unsigned int length;

include/asm-cris/scatterlist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ struct scatterlist {
66
unsigned int length;
77

88
/* The following is i386 highmem junk - not used by us */
9-
struct page * page; /* Location for highmem page, if any */
9+
unsigned long page_link;
1010
unsigned int offset;/* for highmem, page offset */
1111

1212
};

include/asm-frv/scatterlist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* and that's it. There's no excuse for not highmem enabling YOUR driver. /jens
2323
*/
2424
struct scatterlist {
25-
struct page *page; /* Location for highmem page, if any */
25+
unsigned long page_link;
2626
unsigned int offset; /* for highmem, page offset */
2727

2828
dma_addr_t dma_address;

include/asm-h8300/scatterlist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <asm/types.h>
55

66
struct scatterlist {
7-
struct page *page;
7+
unsigned long page_link;
88
unsigned int offset;
99
dma_addr_t dma_address;
1010
unsigned int length;

include/asm-ia64/scatterlist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <asm/types.h>
1010

1111
struct scatterlist {
12-
struct page *page;
12+
unsigned long page_link;
1313
unsigned int offset;
1414
unsigned int length; /* buffer length */
1515

include/asm-m32r/scatterlist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
struct scatterlist {
77
char * address; /* Location data is to be transferred to, NULL for
88
* highmem page */
9-
struct page * page; /* Location for highmem page, if any */
9+
unsigned long page_link;
1010
unsigned int offset;/* for highmem, page offset */
1111

1212
dma_addr_t dma_address;

include/asm-m68k/scatterlist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <linux/types.h>
55

66
struct scatterlist {
7-
struct page *page;
7+
unsigned long page_link;
88
unsigned int offset;
99
unsigned int length;
1010

0 commit comments

Comments
 (0)