Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=930e99bd1320d78c7d8866595e81b8fc7dc8739b
Commit:     930e99bd1320d78c7d8866595e81b8fc7dc8739b
Parent:     8f3334edae93f8b664417f4140d4d9dc9a003fe4
Author:     FUJITA Tomonori <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 13 23:21:52 2007 +0900
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Fri Feb 16 09:40:56 2007 -0600

    [SCSI] tgt: fix the user/kernel ring buffer interface
    
    This patches fixes two bugs in the scsi target infrastructure's
    user/kernel interface.
    
    - It wrongly assumes that the ring buffer size of the interface (64KB)
    is larger than or equal to the system page size. This patch sets the
    ring buffer size to PAGE_SIZE if the system page size is larger.
    
    - It uses PAGE_SIZE in the header file exported to userspace. This
    patch removes it.
    
    Signed-off-by: FUJITA Tomonori <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/scsi/scsi_tgt_if.c |    8 ++++++++
 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 f2344ab..0e08817 100644
--- a/drivers/scsi/scsi_tgt_if.c
+++ b/drivers/scsi/scsi_tgt_if.c
@@ -33,6 +33,14 @@
 
 #include "scsi_tgt_priv.h"
 
+#if TGT_RING_SIZE < PAGE_SIZE
+#  define TGT_RING_SIZE PAGE_SIZE
+#endif
+
+#define TGT_RING_PAGES (TGT_RING_SIZE >> PAGE_SHIFT)
+#define TGT_EVENT_PER_PAGE (PAGE_SIZE / sizeof(struct tgt_event))
+#define TGT_MAX_EVENTS (TGT_EVENT_PER_PAGE * TGT_RING_PAGES)
+
 struct tgt_ring {
        u32 tr_idx;
        unsigned long tr_pages[TGT_RING_PAGES];
diff --git a/include/scsi/scsi_tgt_if.h b/include/scsi/scsi_tgt_if.h
index 46d5e70..07d6e77 100644
--- a/include/scsi/scsi_tgt_if.h
+++ b/include/scsi/scsi_tgt_if.h
@@ -83,8 +83,5 @@ struct tgt_event {
 } __attribute__ ((aligned (sizeof(uint64_t))));
 
 #define TGT_RING_SIZE (1UL << 16)
-#define TGT_RING_PAGES (TGT_RING_SIZE >> PAGE_SHIFT)
-#define TGT_EVENT_PER_PAGE (PAGE_SIZE / sizeof(struct tgt_event))
-#define TGT_MAX_EVENTS (TGT_EVENT_PER_PAGE * TGT_RING_PAGES)
 
 #endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to