VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / fs / ntfs / logfile.c
index 6b9547c..5b448b1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * logfile.c - NTFS kernel journal handling. Part of the Linux-NTFS project.
  *
- * Copyright (c) 2002-2004 Anton Altaparmakov.
+ * Copyright (c) 2002-2004 Anton Altaparmakov
  *
  * This program/include file is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as published
@@ -25,6 +25,7 @@
 #include <linux/fs.h>
 #include <linux/highmem.h>
 #include <linux/buffer_head.h>
+#include <linux/bitops.h>
 
 #include "logfile.h"
 #include "volume.h"
@@ -455,7 +456,11 @@ BOOL ntfs_check_logfile(struct inode *log_vi)
        else
                log_page_size = PAGE_CACHE_SIZE;
        log_page_mask = log_page_size - 1;
-       log_page_bits = ffs(log_page_size) - 1;
+       /*
+        * Use generic_ffs() instead of ffs() to enable the compiler to
+        * optimize log_page_size and log_page_bits into constants.
+        */
+       log_page_bits = generic_ffs(log_page_size) - 1;
        size &= ~(log_page_size - 1);
        /*
         * Ensure the log file is big enough to store at least the two restart
@@ -667,7 +672,7 @@ err_out:
  * @log_vi:    struct inode of loaded journal $LogFile to empty
  *
  * Empty the contents of the $LogFile journal @log_vi and return TRUE on
- * success FALSE on error.
+ * success and FALSE on error.
  *
  * This function assumes that the $LogFile journal has already been consistency
  * checked by a call to ntfs_check_logfile() and that ntfs_is_logfile_clean()