diff options
-rw-r--r-- | drivers/scsi/scsi_tgt_if.c | 8 | ||||
-rw-r--r-- | include/scsi/scsi_tgt_if.h | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_tgt_if.c b/drivers/scsi/scsi_tgt_if.c index f2344ab8deff..0e08817fdecf 100644 --- a/drivers/scsi/scsi_tgt_if.c +++ b/drivers/scsi/scsi_tgt_if.c | |||
@@ -33,6 +33,14 @@ | |||
33 | 33 | ||
34 | #include "scsi_tgt_priv.h" | 34 | #include "scsi_tgt_priv.h" |
35 | 35 | ||
36 | #if TGT_RING_SIZE < PAGE_SIZE | ||
37 | # define TGT_RING_SIZE PAGE_SIZE | ||
38 | #endif | ||
39 | |||
40 | #define TGT_RING_PAGES (TGT_RING_SIZE >> PAGE_SHIFT) | ||
41 | #define TGT_EVENT_PER_PAGE (PAGE_SIZE / sizeof(struct tgt_event)) | ||
42 | #define TGT_MAX_EVENTS (TGT_EVENT_PER_PAGE * TGT_RING_PAGES) | ||
43 | |||
36 | struct tgt_ring { | 44 | struct tgt_ring { |
37 | u32 tr_idx; | 45 | u32 tr_idx; |
38 | unsigned long tr_pages[TGT_RING_PAGES]; | 46 | unsigned long tr_pages[TGT_RING_PAGES]; |
diff --git a/include/scsi/scsi_tgt_if.h b/include/scsi/scsi_tgt_if.h index 46d5e70d7215..07d6e77ae895 100644 --- a/include/scsi/scsi_tgt_if.h +++ b/include/scsi/scsi_tgt_if.h | |||
@@ -83,8 +83,5 @@ struct tgt_event { | |||
83 | } __attribute__ ((aligned (sizeof(uint64_t)))); | 83 | } __attribute__ ((aligned (sizeof(uint64_t)))); |
84 | 84 | ||
85 | #define TGT_RING_SIZE (1UL << 16) | 85 | #define TGT_RING_SIZE (1UL << 16) |
86 | #define TGT_RING_PAGES (TGT_RING_SIZE >> PAGE_SHIFT) | ||
87 | #define TGT_EVENT_PER_PAGE (PAGE_SIZE / sizeof(struct tgt_event)) | ||
88 | #define TGT_MAX_EVENTS (TGT_EVENT_PER_PAGE * TGT_RING_PAGES) | ||
89 | 86 | ||
90 | #endif | 87 | #endif |