Commit 7f70e6f2 authored by Anton Altaparmakov's avatar Anton Altaparmakov

NTFS: Pages are no longer kmapped around calls to

->{prepare,commit}_write, adapt NTFS appropriately.
parent fd16fd23
...@@ -1018,7 +1018,6 @@ static int ntfs_prepare_nonresident_write(struct page *page, ...@@ -1018,7 +1018,6 @@ static int ntfs_prepare_nonresident_write(struct page *page,
ntfs_volume *vol; ntfs_volume *vol;
run_list_element *rl; run_list_element *rl;
struct buffer_head *bh, *head, *wait[2], **wait_bh = wait; struct buffer_head *bh, *head, *wait[2], **wait_bh = wait;
char *kaddr = page_address(page);
unsigned int vcn_ofs, block_start, block_end, blocksize; unsigned int vcn_ofs, block_start, block_end, blocksize;
int err; int err;
BOOL is_retry; BOOL is_retry;
...@@ -1267,13 +1266,20 @@ static int ntfs_prepare_nonresident_write(struct page *page, ...@@ -1267,13 +1266,20 @@ static int ntfs_prepare_nonresident_write(struct page *page,
* region. NOTE: This is how we decide if to * region. NOTE: This is how we decide if to
* zero or not! * zero or not!
*/ */
if (block_end > to || block_start < from) {
void *kaddr;
kaddr = kmap_atomic(page, KM_USER0);
if (block_end > to) if (block_end > to)
memset(kaddr + to, 0, block_end - to); memset(kaddr + to, 0,
block_end - to);
if (block_start < from) if (block_start < from)
memset(kaddr + block_start, 0, memset(kaddr + block_start, 0,
from - block_start); from -
if (block_end > to || block_start < from) block_start);
flush_dcache_page(page); flush_dcache_page(page);
kunmap_atomic(kaddr, KM_USER0);
}
continue; continue;
} }
} }
...@@ -1330,10 +1336,14 @@ static int ntfs_prepare_nonresident_write(struct page *page, ...@@ -1330,10 +1336,14 @@ static int ntfs_prepare_nonresident_write(struct page *page,
if (block_start >= to) if (block_start >= to)
break; break;
if (buffer_new(bh)) { if (buffer_new(bh)) {
void *kaddr;
clear_buffer_new(bh); clear_buffer_new(bh);
if (buffer_uptodate(bh)) if (buffer_uptodate(bh))
buffer_error(); buffer_error();
kaddr = kmap_atomic(page, KM_USER0);
memset(kaddr + block_start, 0, bh->b_size); memset(kaddr + block_start, 0, bh->b_size);
kunmap_atomic(kaddr, KM_USER0);
set_buffer_uptodate(bh); set_buffer_uptodate(bh);
mark_buffer_dirty(bh); mark_buffer_dirty(bh);
is_retry = TRUE; is_retry = TRUE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment