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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/ntfs/logfile.c b/fs/ntfs/logfile.c
index 5e280abafab3..8edb8e20fb08 100644
--- a/fs/ntfs/logfile.c
+++ b/fs/ntfs/logfile.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * logfile.c - NTFS kernel journal handling. Part of the Linux-NTFS project. 2 * logfile.c - NTFS kernel journal handling. Part of the Linux-NTFS project.
3 * 3 *
4 * Copyright (c) 2002-2004 Anton Altaparmakov 4 * Copyright (c) 2002-2005 Anton Altaparmakov
5 * 5 *
6 * This program/include file is free software; you can redistribute it and/or 6 * This program/include file is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as published 7 * modify it under the terms of the GNU General Public License as published
@@ -410,7 +410,7 @@ err_out:
410} 410}
411 411
412/** 412/**
413 * ntfs_ckeck_logfile - check in the journal if the volume is consistent 413 * ntfs_check_logfile - check the journal for consistency
414 * @log_vi: struct inode of loaded journal $LogFile to check 414 * @log_vi: struct inode of loaded journal $LogFile to check
415 * 415 *
416 * Check the $LogFile journal for consistency and return TRUE if it is 416 * Check the $LogFile journal for consistency and return TRUE if it is
@@ -443,7 +443,7 @@ BOOL ntfs_check_logfile(struct inode *log_vi)
443 /* An empty $LogFile must have been clean before it got emptied. */ 443 /* An empty $LogFile must have been clean before it got emptied. */
444 if (NVolLogFileEmpty(vol)) 444 if (NVolLogFileEmpty(vol))
445 goto is_empty; 445 goto is_empty;
446 size = log_vi->i_size; 446 size = i_size_read(log_vi);
447 /* Make sure the file doesn't exceed the maximum allowed size. */ 447 /* Make sure the file doesn't exceed the maximum allowed size. */
448 if (size > MaxLogFileSize) 448 if (size > MaxLogFileSize)
449 size = MaxLogFileSize; 449 size = MaxLogFileSize;
@@ -464,7 +464,7 @@ BOOL ntfs_check_logfile(struct inode *log_vi)
464 * optimize log_page_size and log_page_bits into constants. 464 * optimize log_page_size and log_page_bits into constants.
465 */ 465 */
466 log_page_bits = generic_ffs(log_page_size) - 1; 466 log_page_bits = generic_ffs(log_page_size) - 1;
467 size &= ~(log_page_size - 1); 467 size &= ~(s64)(log_page_size - 1);
468 /* 468 /*
469 * Ensure the log file is big enough to store at least the two restart 469 * Ensure the log file is big enough to store at least the two restart
470 * pages and the minimum number of log record pages. 470 * pages and the minimum number of log record pages.
@@ -689,7 +689,8 @@ BOOL ntfs_empty_logfile(struct inode *log_vi)
689 if (!NVolLogFileEmpty(vol)) { 689 if (!NVolLogFileEmpty(vol)) {
690 int err; 690 int err;
691 691
692 err = ntfs_attr_set(NTFS_I(log_vi), 0, log_vi->i_size, 0xff); 692 err = ntfs_attr_set(NTFS_I(log_vi), 0, i_size_read(log_vi),
693 0xff);
693 if (unlikely(err)) { 694 if (unlikely(err)) {
694 ntfs_error(vol->sb, "Failed to fill $LogFile with " 695 ntfs_error(vol->sb, "Failed to fill $LogFile with "
695 "0xff bytes (error code %i).", err); 696 "0xff bytes (error code %i).", err);