* [PATCH] CramFS and HighMem
@ 2001-08-18 21:59 Herbert Xu
0 siblings, 0 replies; only message in thread
From: Herbert Xu @ 2001-08-18 21:59 UTC (permalink / raw)
To: Linus Torvalds, Alan Cox, Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 281 bytes --]
This patch replaces page_address in fs/cramfs with kmap.
--
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
[-- Attachment #2: p --]
[-- Type: text/plain, Size: 1062 bytes --]
diff -u -r1.1.1.6 -r1.6
--- fs/cramfs/inode.c 19 Jul 2001 23:14:53 -0000 1.1.1.6
+++ fs/cramfs/inode.c 18 Aug 2001 08:11:14 -0000 1.6
@@ -374,6 +374,7 @@
{
struct inode *inode = page->mapping->host;
u32 maxblock, bytes_filled;
+ void *pgdata;
maxblock = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
bytes_filled = 0;
@@ -387,15 +388,18 @@
start_offset = *(u32 *) cramfs_read(sb, blkptr_offset-4, 4);
compr_len = (*(u32 *) cramfs_read(sb, blkptr_offset, 4)
- start_offset);
+ pgdata = kmap(page);
if (compr_len == 0)
; /* hole */
else
- bytes_filled = cramfs_uncompress_block(page_address(page),
+ bytes_filled = cramfs_uncompress_block(pgdata,
PAGE_CACHE_SIZE,
cramfs_read(sb, start_offset, compr_len),
compr_len);
- }
- memset(page_address(page) + bytes_filled, 0, PAGE_CACHE_SIZE - bytes_filled);
+ } else
+ pgdata = kmap(page);
+ memset(pgdata + bytes_filled, 0, PAGE_CACHE_SIZE - bytes_filled);
+ kunmap(page);
flush_dcache_page(page);
SetPageUptodate(page);
UnlockPage(page);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-08-18 21:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-18 21:59 [PATCH] CramFS and HighMem Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).