SLUB: Use this_cpu operations in slub
[safe/jmp/linux-2.6] / fs / ntfs / inode.c
index b532a73..dc2505a 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/pagemap.h>
 #include <linux/quotaops.h>
 #include <linux/slab.h>
+#include <linux/log2.h>
 
 #include "aops.h"
 #include "attrib.h"
@@ -34,7 +35,6 @@
 #include "dir.h"
 #include "debug.h"
 #include "inode.h"
-#include "attrib.h"
 #include "lcnalloc.h"
 #include "malloc.h"
 #include "mft.h"
@@ -530,7 +530,7 @@ err_corrupt_attr:
  * the ntfs inode.
  *
  * Q: What locks are held when the function is called?
- * A: i_state has I_LOCK set, hence the inode is locked, also
+ * A: i_state has I_NEW set, hence the inode is locked, also
  *    i_count is set to 1, so it is not going to go away
  *    i_flags is set to 0 and we have no business touching it.  Only an ioctl()
  *    is allowed to write to them. We should of course be honouring them but
@@ -1207,7 +1207,7 @@ err_out:
  * necessary fields in @vi as well as initializing the ntfs inode.
  *
  * Q: What locks are held when the function is called?
- * A: i_state has I_LOCK set, hence the inode is locked, also
+ * A: i_state has I_NEW set, hence the inode is locked, also
  *    i_count is set to 1, so it is not going to go away
  *
  * Return 0 on success and -errno on error.  In the error case, the inode will
@@ -1407,9 +1407,6 @@ static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi)
                ni->allocated_size = sle64_to_cpu(
                                a->data.non_resident.allocated_size);
        }
-       /* Setup the operations for this attribute inode. */
-       vi->i_op = NULL;
-       vi->i_fop = NULL;
        if (NInoMstProtected(ni))
                vi->i_mapping->a_ops = &ntfs_mst_aops;
        else
@@ -1477,7 +1474,7 @@ err_out:
  * normal directory inodes.
  *
  * Q: What locks are held when the function is called?
- * A: i_state has I_LOCK set, hence the inode is locked, also
+ * A: i_state has I_NEW set, hence the inode is locked, also
  *    i_count is set to 1, so it is not going to go away
  *
  * Return 0 on success and -errno on error.  In the error case, the inode will
@@ -1574,7 +1571,7 @@ static int ntfs_read_locked_index_inode(struct inode *base_vi, struct inode *vi)
        ntfs_debug("Index collation rule is 0x%x.",
                        le32_to_cpu(ir->collation_rule));
        ni->itype.index.block_size = le32_to_cpu(ir->index_block_size);
-       if (ni->itype.index.block_size & (ni->itype.index.block_size - 1)) {
+       if (!is_power_of_2(ni->itype.index.block_size)) {
                ntfs_error(vi->i_sb, "Index block size (%u) is not a power of "
                                "two.", ni->itype.index.block_size);
                goto unm_err_out;
@@ -1979,8 +1976,7 @@ int ntfs_read_inode_mount(struct inode *vi)
                                goto em_put_err_out;
                        next_al_entry = (ATTR_LIST_ENTRY*)((u8*)al_entry +
                                        le16_to_cpu(al_entry->length));
-                       if (le32_to_cpu(al_entry->type) >
-                                       const_le32_to_cpu(AT_DATA))
+                       if (le32_to_cpu(al_entry->type) > le32_to_cpu(AT_DATA))
                                goto em_put_err_out;
                        if (AT_DATA != al_entry->type)
                                continue;
@@ -2500,8 +2496,6 @@ retry_truncate:
        /* Resize the attribute record to best fit the new attribute size. */
        if (new_size < vol->mft_record_size &&
                        !ntfs_resident_attr_value_resize(m, a, new_size)) {
-               unsigned long flags;
-
                /* The resize succeeded! */
                flush_dcache_mft_record_page(ctx->ntfs_ino);
                mark_mft_record_dirty(ctx->ntfs_ino);