Re: [patch] aio: remove spurious ring head index modulo info->nr

2007-01-02 Thread Zach Brown
This makes the modulo of ring->head into local variable head  
unnecessary.

This patch removes that bogus code.


Looks fine to me:

Acked-by: Zach Brown <[EMAIL PROTECTED]>

- z
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] aio: remove spurious ring head index modulo info-nr

2007-01-02 Thread Zach Brown
This makes the modulo of ring-head into local variable head  
unnecessary.

This patch removes that bogus code.


Looks fine to me:

Acked-by: Zach Brown [EMAIL PROTECTED]

- z
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] aio: remove spurious ring head index modulo info->nr

2006-12-29 Thread Chen, Kenneth W
In aio_read_evt(), the ring->head will never wrap info->nr because
we already does the wrap when updating the ring head index:

if (head != ring->tail) {
...
head = (head + 1) % info->nr;
ring->head = head;
}

This makes the modulo of ring->head into local variable head unnecessary.
This patch removes that bogus code.


Signed-off-by: Ken Chen <[EMAIL PROTECTED]>


--- ./fs/aio.c.orig 2006-12-24 22:01:36.0 -0800
+++ ./fs/aio.c  2006-12-24 22:34:48.0 -0800
@@ -1019,7 +1019,7 @@ static int aio_read_evt(struct kioctx *i
 {
struct aio_ring_info *info = >ring_info;
struct aio_ring *ring;
-   unsigned long head;
+   unsigned int head;
int ret = 0;
 
ring = kmap_atomic(info->ring_pages[0], KM_USER0);
@@ -1032,7 +1032,7 @@ static int aio_read_evt(struct kioctx *i
 
spin_lock(>ring_lock);
 
-   head = ring->head % info->nr;
+   head = ring->head;
if (head != ring->tail) {
struct io_event *evp = aio_ring_event(info, head, KM_USER1);
*ent = *evp;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] aio: remove spurious ring head index modulo info-nr

2006-12-29 Thread Chen, Kenneth W
In aio_read_evt(), the ring-head will never wrap info-nr because
we already does the wrap when updating the ring head index:

if (head != ring-tail) {
...
head = (head + 1) % info-nr;
ring-head = head;
}

This makes the modulo of ring-head into local variable head unnecessary.
This patch removes that bogus code.


Signed-off-by: Ken Chen [EMAIL PROTECTED]


--- ./fs/aio.c.orig 2006-12-24 22:01:36.0 -0800
+++ ./fs/aio.c  2006-12-24 22:34:48.0 -0800
@@ -1019,7 +1019,7 @@ static int aio_read_evt(struct kioctx *i
 {
struct aio_ring_info *info = ioctx-ring_info;
struct aio_ring *ring;
-   unsigned long head;
+   unsigned int head;
int ret = 0;
 
ring = kmap_atomic(info-ring_pages[0], KM_USER0);
@@ -1032,7 +1032,7 @@ static int aio_read_evt(struct kioctx *i
 
spin_lock(info-ring_lock);
 
-   head = ring-head % info-nr;
+   head = ring-head;
if (head != ring-tail) {
struct io_event *evp = aio_ring_event(info, head, KM_USER1);
*ent = *evp;
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/