[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new version of loop.c patch
On 24 September 2001, beldridg@best.com <beldridg@best.com> wrote:
> it looks like the loop.c patch hasn't been integrated into 2.4.10.
You may of course correct this little problem yourself (just remove the
--dry-run option from the patch line and then apply the rejected file
by hand.
For the lazy people here you have the new diff file
--
Regards,
Emil
--
"Can you imagine the silence if everyone said only what he knows?" - K.Capek
--- loop.c-2.4.original Mon Sep 24 09:40:19 2001
+++ patched-loop.c Mon Sep 24 09:43:03 2001
@@ -185,7 +185,7 @@
len = bh->b_size;
data = bh->b_data;
while (len > 0) {
- int IV = index * (PAGE_CACHE_SIZE/bsize) + offset/bsize;
+ int IV = index * (PAGE_CACHE_SIZE >> 9) + (offset >> 9);
size = PAGE_CACHE_SIZE - offset;
if (size > len)
size = len;
@@ -236,7 +236,7 @@
unsigned long count = desc->count;
struct lo_read_data *p = (struct lo_read_data*)desc->buf;
struct loop_device *lo = p->lo;
- int IV = page->index * (PAGE_CACHE_SIZE/p->bsize) + offset/p->bsize;
+ int IV = page->index * (PAGE_CACHE_SIZE >> 9) + (offset >> 9);
if (size > count)
size = count;
@@ -494,7 +494,7 @@
* piggy old buffer on original, and submit for I/O
*/
bh = loop_get_buffer(lo, rbh);
- IV = loop_get_iv(lo, rbh->b_rsector);
+ IV = bh->b_rsector;
if (rw == WRITE) {
set_bit(BH_Dirty, &bh->b_state);
if (lo_do_transfer(lo, WRITE, bh->b_data, rbh->b_data,
@@ -531,7 +531,7 @@
bh->b_end_io(bh, !ret);
} else {
struct buffer_head *rbh = bh->b_private;
- unsigned long IV = loop_get_iv(lo, rbh->b_rsector);
+ unsigned int IV = bh->b_rsector;
ret = lo_do_transfer(lo, READ, bh->b_data, rbh->b_data,
bh->b_size, IV);
@@ -1034,6 +1034,7 @@
for (i = 0; i < max_loop; i++)
register_disk(NULL, MKDEV(MAJOR_NR, i), 1, &lo_fops, 0);
+ { extern int init_module_aes(void); init_module_aes(); }
printk(KERN_INFO "loop: loaded (max %d devices)\n", max_loop);
return 0;
@@ -1047,6 +1048,7 @@
void loop_exit(void)
{
+ { extern void cleanup_module_aes(void); cleanup_module_aes(); }
devfs_unregister(devfs_handle);
if (devfs_unregister_blkdev(MAJOR_NR, "loop"))
printk(KERN_WARNING "loop: cannot unregister blkdev\n");