aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs/logfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ntfs/logfile.c')
-rw-r--r--fs/ntfs/logfile.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ntfs/logfile.c b/fs/ntfs/logfile.c
index c71de292c5ad..9d71213ca81e 100644
--- a/fs/ntfs/logfile.c
+++ b/fs/ntfs/logfile.c
@@ -381,7 +381,7 @@ static int ntfs_check_and_load_restart_page(struct inode *vi,
381 * completely inside @rp, just copy it from there. Otherwise map all 381 * completely inside @rp, just copy it from there. Otherwise map all
382 * the required pages and copy the data from them. 382 * the required pages and copy the data from them.
383 */ 383 */
384 size = PAGE_CACHE_SIZE - (pos & ~PAGE_CACHE_MASK); 384 size = PAGE_SIZE - (pos & ~PAGE_MASK);
385 if (size >= le32_to_cpu(rp->system_page_size)) { 385 if (size >= le32_to_cpu(rp->system_page_size)) {
386 memcpy(trp, rp, le32_to_cpu(rp->system_page_size)); 386 memcpy(trp, rp, le32_to_cpu(rp->system_page_size));
387 } else { 387 } else {
@@ -394,8 +394,8 @@ static int ntfs_check_and_load_restart_page(struct inode *vi,
394 /* Copy the remaining data one page at a time. */ 394 /* Copy the remaining data one page at a time. */
395 have_read = size; 395 have_read = size;
396 to_read = le32_to_cpu(rp->system_page_size) - size; 396 to_read = le32_to_cpu(rp->system_page_size) - size;
397 idx = (pos + size) >> PAGE_CACHE_SHIFT; 397 idx = (pos + size) >> PAGE_SHIFT;
398 BUG_ON((pos + size) & ~PAGE_CACHE_MASK); 398 BUG_ON((pos + size) & ~PAGE_MASK);
399 do { 399 do {
400 page = ntfs_map_page(vi->i_mapping, idx); 400 page = ntfs_map_page(vi->i_mapping, idx);
401 if (IS_ERR(page)) { 401 if (IS_ERR(page)) {
@@ -406,7 +406,7 @@ static int ntfs_check_and_load_restart_page(struct inode *vi,
406 err = -EIO; 406 err = -EIO;
407 goto err_out; 407 goto err_out;
408 } 408 }
409 size = min_t(int, to_read, PAGE_CACHE_SIZE); 409 size = min_t(int, to_read, PAGE_SIZE);
410 memcpy((u8*)trp + have_read, page_address(page), size); 410 memcpy((u8*)trp + have_read, page_address(page), size);
411 ntfs_unmap_page(page); 411 ntfs_unmap_page(page);
412 have_read += size; 412 have_read += size;
@@ -509,11 +509,11 @@ bool ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp)
509 * log page size if the page cache size is between the default log page 509 * log page size if the page cache size is between the default log page
510 * size and twice that. 510 * size and twice that.
511 */ 511 */
512 if (PAGE_CACHE_SIZE >= DefaultLogPageSize && PAGE_CACHE_SIZE <= 512 if (PAGE_SIZE >= DefaultLogPageSize && PAGE_SIZE <=
513 DefaultLogPageSize * 2) 513 DefaultLogPageSize * 2)
514 log_page_size = DefaultLogPageSize; 514 log_page_size = DefaultLogPageSize;
515 else 515 else
516 log_page_size = PAGE_CACHE_SIZE; 516 log_page_size = PAGE_SIZE;
517 log_page_mask = log_page_size - 1; 517 log_page_mask = log_page_size - 1;
518 /* 518 /*
519 * Use ntfs_ffs() instead of ffs() to enable the compiler to 519 * Use ntfs_ffs() instead of ffs() to enable the compiler to
@@ -539,7 +539,7 @@ bool ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp)
539 * to be empty. 539 * to be empty.
540 */ 540 */
541 for (pos = 0; pos < size; pos <<= 1) { 541 for (pos = 0; pos < size; pos <<= 1) {
542 pgoff_t idx = pos >> PAGE_CACHE_SHIFT; 542 pgoff_t idx = pos >> PAGE_SHIFT;
543 if (!page || page->index != idx) { 543 if (!page || page->index != idx) {
544 if (page) 544 if (page)
545 ntfs_unmap_page(page); 545 ntfs_unmap_page(page);
@@ -550,7 +550,7 @@ bool ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp)
550 goto err_out; 550 goto err_out;
551 } 551 }
552 } 552 }
553 kaddr = (u8*)page_address(page) + (pos & ~PAGE_CACHE_MASK); 553 kaddr = (u8*)page_address(page) + (pos & ~PAGE_MASK);
554 /* 554 /*
555 * A non-empty block means the logfile is not empty while an 555 * A non-empty block means the logfile is not empty while an
556 * empty block after a non-empty block has been encountered 556 * empty block after a non-empty block has been encountered