diff options
author | Cong Wang <amwang@redhat.com> | 2011-11-25 10:14:31 -0500 |
---|---|---|
committer | Cong Wang <xiyou.wangcong@gmail.com> | 2012-03-20 09:48:24 -0400 |
commit | 50bc9b65b6e32f146c3c9812a9d62fe7ff518b5a (patch) | |
tree | 02d0206da0f4ea6a472708da02d5e4083570960c /fs/logfs | |
parent | 303a8f2afc7ba01083b50b7fceac2a412f28da4e (diff) |
logfs: remove the second argument of k[un]map_atomic()
Signed-off-by: Cong Wang <amwang@redhat.com>
Diffstat (limited to 'fs/logfs')
-rw-r--r-- | fs/logfs/dir.c | 18 | ||||
-rw-r--r-- | fs/logfs/readwrite.c | 38 | ||||
-rw-r--r-- | fs/logfs/segment.c | 4 |
3 files changed, 30 insertions, 30 deletions
diff --git a/fs/logfs/dir.c b/fs/logfs/dir.c index 3de7a32cadbe..1b6e21dda286 100644 --- a/fs/logfs/dir.c +++ b/fs/logfs/dir.c | |||
@@ -177,17 +177,17 @@ static struct page *logfs_get_dd_page(struct inode *dir, struct dentry *dentry) | |||
177 | (filler_t *)logfs_readpage, NULL); | 177 | (filler_t *)logfs_readpage, NULL); |
178 | if (IS_ERR(page)) | 178 | if (IS_ERR(page)) |
179 | return page; | 179 | return page; |
180 | dd = kmap_atomic(page, KM_USER0); | 180 | dd = kmap_atomic(page); |
181 | BUG_ON(dd->namelen == 0); | 181 | BUG_ON(dd->namelen == 0); |
182 | 182 | ||
183 | if (name->len != be16_to_cpu(dd->namelen) || | 183 | if (name->len != be16_to_cpu(dd->namelen) || |
184 | memcmp(name->name, dd->name, name->len)) { | 184 | memcmp(name->name, dd->name, name->len)) { |
185 | kunmap_atomic(dd, KM_USER0); | 185 | kunmap_atomic(dd); |
186 | page_cache_release(page); | 186 | page_cache_release(page); |
187 | continue; | 187 | continue; |
188 | } | 188 | } |
189 | 189 | ||
190 | kunmap_atomic(dd, KM_USER0); | 190 | kunmap_atomic(dd); |
191 | return page; | 191 | return page; |
192 | } | 192 | } |
193 | return NULL; | 193 | return NULL; |
@@ -365,9 +365,9 @@ static struct dentry *logfs_lookup(struct inode *dir, struct dentry *dentry, | |||
365 | return NULL; | 365 | return NULL; |
366 | } | 366 | } |
367 | index = page->index; | 367 | index = page->index; |
368 | dd = kmap_atomic(page, KM_USER0); | 368 | dd = kmap_atomic(page); |
369 | ino = be64_to_cpu(dd->ino); | 369 | ino = be64_to_cpu(dd->ino); |
370 | kunmap_atomic(dd, KM_USER0); | 370 | kunmap_atomic(dd); |
371 | page_cache_release(page); | 371 | page_cache_release(page); |
372 | 372 | ||
373 | inode = logfs_iget(dir->i_sb, ino); | 373 | inode = logfs_iget(dir->i_sb, ino); |
@@ -402,12 +402,12 @@ static int logfs_write_dir(struct inode *dir, struct dentry *dentry, | |||
402 | if (!page) | 402 | if (!page) |
403 | return -ENOMEM; | 403 | return -ENOMEM; |
404 | 404 | ||
405 | dd = kmap_atomic(page, KM_USER0); | 405 | dd = kmap_atomic(page); |
406 | memset(dd, 0, sizeof(*dd)); | 406 | memset(dd, 0, sizeof(*dd)); |
407 | dd->ino = cpu_to_be64(inode->i_ino); | 407 | dd->ino = cpu_to_be64(inode->i_ino); |
408 | dd->type = logfs_type(inode); | 408 | dd->type = logfs_type(inode); |
409 | logfs_set_name(dd, &dentry->d_name); | 409 | logfs_set_name(dd, &dentry->d_name); |
410 | kunmap_atomic(dd, KM_USER0); | 410 | kunmap_atomic(dd); |
411 | 411 | ||
412 | err = logfs_write_buf(dir, page, WF_LOCK); | 412 | err = logfs_write_buf(dir, page, WF_LOCK); |
413 | unlock_page(page); | 413 | unlock_page(page); |
@@ -579,9 +579,9 @@ static int logfs_get_dd(struct inode *dir, struct dentry *dentry, | |||
579 | if (IS_ERR(page)) | 579 | if (IS_ERR(page)) |
580 | return PTR_ERR(page); | 580 | return PTR_ERR(page); |
581 | *pos = page->index; | 581 | *pos = page->index; |
582 | map = kmap_atomic(page, KM_USER0); | 582 | map = kmap_atomic(page); |
583 | memcpy(dd, map, sizeof(*dd)); | 583 | memcpy(dd, map, sizeof(*dd)); |
584 | kunmap_atomic(map, KM_USER0); | 584 | kunmap_atomic(map); |
585 | page_cache_release(page); | 585 | page_cache_release(page); |
586 | return 0; | 586 | return 0; |
587 | } | 587 | } |
diff --git a/fs/logfs/readwrite.c b/fs/logfs/readwrite.c index 4153e65b0148..e3ab5e5a904c 100644 --- a/fs/logfs/readwrite.c +++ b/fs/logfs/readwrite.c | |||
@@ -517,9 +517,9 @@ static int indirect_write_alias(struct super_block *sb, | |||
517 | 517 | ||
518 | ino = page->mapping->host->i_ino; | 518 | ino = page->mapping->host->i_ino; |
519 | logfs_unpack_index(page->index, &bix, &level); | 519 | logfs_unpack_index(page->index, &bix, &level); |
520 | child = kmap_atomic(page, KM_USER0); | 520 | child = kmap_atomic(page); |
521 | val = child[pos]; | 521 | val = child[pos]; |
522 | kunmap_atomic(child, KM_USER0); | 522 | kunmap_atomic(child); |
523 | err = write_one_alias(sb, ino, bix, level, pos, val); | 523 | err = write_one_alias(sb, ino, bix, level, pos, val); |
524 | if (err) | 524 | if (err) |
525 | return err; | 525 | return err; |
@@ -673,9 +673,9 @@ static void alloc_indirect_block(struct inode *inode, struct page *page, | |||
673 | alloc_data_block(inode, page); | 673 | alloc_data_block(inode, page); |
674 | 674 | ||
675 | block = logfs_block(page); | 675 | block = logfs_block(page); |
676 | array = kmap_atomic(page, KM_USER0); | 676 | array = kmap_atomic(page); |
677 | initialize_block_counters(page, block, array, page_is_empty); | 677 | initialize_block_counters(page, block, array, page_is_empty); |
678 | kunmap_atomic(array, KM_USER0); | 678 | kunmap_atomic(array); |
679 | } | 679 | } |
680 | 680 | ||
681 | static void block_set_pointer(struct page *page, int index, u64 ptr) | 681 | static void block_set_pointer(struct page *page, int index, u64 ptr) |
@@ -685,10 +685,10 @@ static void block_set_pointer(struct page *page, int index, u64 ptr) | |||
685 | u64 oldptr; | 685 | u64 oldptr; |
686 | 686 | ||
687 | BUG_ON(!block); | 687 | BUG_ON(!block); |
688 | array = kmap_atomic(page, KM_USER0); | 688 | array = kmap_atomic(page); |
689 | oldptr = be64_to_cpu(array[index]); | 689 | oldptr = be64_to_cpu(array[index]); |
690 | array[index] = cpu_to_be64(ptr); | 690 | array[index] = cpu_to_be64(ptr); |
691 | kunmap_atomic(array, KM_USER0); | 691 | kunmap_atomic(array); |
692 | SetPageUptodate(page); | 692 | SetPageUptodate(page); |
693 | 693 | ||
694 | block->full += !!(ptr & LOGFS_FULLY_POPULATED) | 694 | block->full += !!(ptr & LOGFS_FULLY_POPULATED) |
@@ -701,9 +701,9 @@ static u64 block_get_pointer(struct page *page, int index) | |||
701 | __be64 *block; | 701 | __be64 *block; |
702 | u64 ptr; | 702 | u64 ptr; |
703 | 703 | ||
704 | block = kmap_atomic(page, KM_USER0); | 704 | block = kmap_atomic(page); |
705 | ptr = be64_to_cpu(block[index]); | 705 | ptr = be64_to_cpu(block[index]); |
706 | kunmap_atomic(block, KM_USER0); | 706 | kunmap_atomic(block); |
707 | return ptr; | 707 | return ptr; |
708 | } | 708 | } |
709 | 709 | ||
@@ -850,7 +850,7 @@ static u64 seek_holedata_loop(struct inode *inode, u64 bix, int data) | |||
850 | } | 850 | } |
851 | 851 | ||
852 | slot = get_bits(bix, SUBLEVEL(level)); | 852 | slot = get_bits(bix, SUBLEVEL(level)); |
853 | rblock = kmap_atomic(page, KM_USER0); | 853 | rblock = kmap_atomic(page); |
854 | while (slot < LOGFS_BLOCK_FACTOR) { | 854 | while (slot < LOGFS_BLOCK_FACTOR) { |
855 | if (data && (rblock[slot] != 0)) | 855 | if (data && (rblock[slot] != 0)) |
856 | break; | 856 | break; |
@@ -861,12 +861,12 @@ static u64 seek_holedata_loop(struct inode *inode, u64 bix, int data) | |||
861 | bix &= ~(increment - 1); | 861 | bix &= ~(increment - 1); |
862 | } | 862 | } |
863 | if (slot >= LOGFS_BLOCK_FACTOR) { | 863 | if (slot >= LOGFS_BLOCK_FACTOR) { |
864 | kunmap_atomic(rblock, KM_USER0); | 864 | kunmap_atomic(rblock); |
865 | logfs_put_read_page(page); | 865 | logfs_put_read_page(page); |
866 | return bix; | 866 | return bix; |
867 | } | 867 | } |
868 | bofs = be64_to_cpu(rblock[slot]); | 868 | bofs = be64_to_cpu(rblock[slot]); |
869 | kunmap_atomic(rblock, KM_USER0); | 869 | kunmap_atomic(rblock); |
870 | logfs_put_read_page(page); | 870 | logfs_put_read_page(page); |
871 | if (!bofs) { | 871 | if (!bofs) { |
872 | BUG_ON(data); | 872 | BUG_ON(data); |
@@ -1961,9 +1961,9 @@ int logfs_read_inode(struct inode *inode) | |||
1961 | if (IS_ERR(page)) | 1961 | if (IS_ERR(page)) |
1962 | return PTR_ERR(page); | 1962 | return PTR_ERR(page); |
1963 | 1963 | ||
1964 | di = kmap_atomic(page, KM_USER0); | 1964 | di = kmap_atomic(page); |
1965 | logfs_disk_to_inode(di, inode); | 1965 | logfs_disk_to_inode(di, inode); |
1966 | kunmap_atomic(di, KM_USER0); | 1966 | kunmap_atomic(di); |
1967 | move_page_to_inode(inode, page); | 1967 | move_page_to_inode(inode, page); |
1968 | page_cache_release(page); | 1968 | page_cache_release(page); |
1969 | return 0; | 1969 | return 0; |
@@ -1982,9 +1982,9 @@ static struct page *inode_to_page(struct inode *inode) | |||
1982 | if (!page) | 1982 | if (!page) |
1983 | return NULL; | 1983 | return NULL; |
1984 | 1984 | ||
1985 | di = kmap_atomic(page, KM_USER0); | 1985 | di = kmap_atomic(page); |
1986 | logfs_inode_to_disk(inode, di); | 1986 | logfs_inode_to_disk(inode, di); |
1987 | kunmap_atomic(di, KM_USER0); | 1987 | kunmap_atomic(di); |
1988 | move_inode_to_page(page, inode); | 1988 | move_inode_to_page(page, inode); |
1989 | return page; | 1989 | return page; |
1990 | } | 1990 | } |
@@ -2041,13 +2041,13 @@ static void logfs_mod_segment_entry(struct super_block *sb, u32 segno, | |||
2041 | 2041 | ||
2042 | if (write) | 2042 | if (write) |
2043 | alloc_indirect_block(inode, page, 0); | 2043 | alloc_indirect_block(inode, page, 0); |
2044 | se = kmap_atomic(page, KM_USER0); | 2044 | se = kmap_atomic(page); |
2045 | change_se(se + child_no, arg); | 2045 | change_se(se + child_no, arg); |
2046 | if (write) { | 2046 | if (write) { |
2047 | logfs_set_alias(sb, logfs_block(page), child_no); | 2047 | logfs_set_alias(sb, logfs_block(page), child_no); |
2048 | BUG_ON((int)be32_to_cpu(se[child_no].valid) > super->s_segsize); | 2048 | BUG_ON((int)be32_to_cpu(se[child_no].valid) > super->s_segsize); |
2049 | } | 2049 | } |
2050 | kunmap_atomic(se, KM_USER0); | 2050 | kunmap_atomic(se); |
2051 | 2051 | ||
2052 | logfs_put_write_page(page); | 2052 | logfs_put_write_page(page); |
2053 | } | 2053 | } |
@@ -2245,10 +2245,10 @@ int logfs_inode_write(struct inode *inode, const void *buf, size_t count, | |||
2245 | if (!page) | 2245 | if (!page) |
2246 | return -ENOMEM; | 2246 | return -ENOMEM; |
2247 | 2247 | ||
2248 | pagebuf = kmap_atomic(page, KM_USER0); | 2248 | pagebuf = kmap_atomic(page); |
2249 | memcpy(pagebuf, buf, count); | 2249 | memcpy(pagebuf, buf, count); |
2250 | flush_dcache_page(page); | 2250 | flush_dcache_page(page); |
2251 | kunmap_atomic(pagebuf, KM_USER0); | 2251 | kunmap_atomic(pagebuf); |
2252 | 2252 | ||
2253 | if (i_size_read(inode) < pos + LOGFS_BLOCKSIZE) | 2253 | if (i_size_read(inode) < pos + LOGFS_BLOCKSIZE) |
2254 | i_size_write(inode, pos + LOGFS_BLOCKSIZE); | 2254 | i_size_write(inode, pos + LOGFS_BLOCKSIZE); |
diff --git a/fs/logfs/segment.c b/fs/logfs/segment.c index ab798ed1cc88..e28d090c98d6 100644 --- a/fs/logfs/segment.c +++ b/fs/logfs/segment.c | |||
@@ -543,9 +543,9 @@ void move_page_to_btree(struct page *page) | |||
543 | BUG_ON(!item); /* mempool empty */ | 543 | BUG_ON(!item); /* mempool empty */ |
544 | memset(item, 0, sizeof(*item)); | 544 | memset(item, 0, sizeof(*item)); |
545 | 545 | ||
546 | child = kmap_atomic(page, KM_USER0); | 546 | child = kmap_atomic(page); |
547 | item->val = child[pos]; | 547 | item->val = child[pos]; |
548 | kunmap_atomic(child, KM_USER0); | 548 | kunmap_atomic(child); |
549 | item->child_no = pos; | 549 | item->child_no = pos; |
550 | list_add(&item->list, &block->item_list); | 550 | list_add(&item->list, &block->item_list); |
551 | } | 551 | } |