aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs/attrib.c
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-10-04 09:36:56 -0400
committerAnton Altaparmakov <aia21@cantab.net>2005-10-04 09:36:56 -0400
commitfc0fa7dc7d243afabdb3fb6a11d59a944a9c91f8 (patch)
tree67f28282e658eba6ed0daac0553a77f8352c21bc /fs/ntfs/attrib.c
parent511bea5ea2b2b330e67c9e58ffb5027caebf9052 (diff)
NTFS: - Change ntfs_cluster_alloc() to take an extra boolean parameter
specifying whether the cluster are being allocated to extend an attribute or to fill a hole. - Change ntfs_attr_make_non_resident() to call ntfs_cluster_alloc() with @is_extension set to TRUE and remove the runlist terminator fixup code as this is now done by ntfs_cluster_alloc(). Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Diffstat (limited to 'fs/ntfs/attrib.c')
-rw-r--r--fs/ntfs/attrib.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c
index 2aafc87e9601..33e689f82a55 100644
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -1566,8 +1566,6 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni)
1566 new_size = (i_size_read(vi) + vol->cluster_size - 1) & 1566 new_size = (i_size_read(vi) + vol->cluster_size - 1) &
1567 ~(vol->cluster_size - 1); 1567 ~(vol->cluster_size - 1);
1568 if (new_size > 0) { 1568 if (new_size > 0) {
1569 runlist_element *rl2;
1570
1571 /* 1569 /*
1572 * Will need the page later and since the page lock nests 1570 * Will need the page later and since the page lock nests
1573 * outside all ntfs locks, we need to get the page now. 1571 * outside all ntfs locks, we need to get the page now.
@@ -1578,7 +1576,7 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni)
1578 return -ENOMEM; 1576 return -ENOMEM;
1579 /* Start by allocating clusters to hold the attribute value. */ 1577 /* Start by allocating clusters to hold the attribute value. */
1580 rl = ntfs_cluster_alloc(vol, 0, new_size >> 1578 rl = ntfs_cluster_alloc(vol, 0, new_size >>
1581 vol->cluster_size_bits, -1, DATA_ZONE); 1579 vol->cluster_size_bits, -1, DATA_ZONE, TRUE);
1582 if (IS_ERR(rl)) { 1580 if (IS_ERR(rl)) {
1583 err = PTR_ERR(rl); 1581 err = PTR_ERR(rl);
1584 ntfs_debug("Failed to allocate cluster%s, error code " 1582 ntfs_debug("Failed to allocate cluster%s, error code "
@@ -1587,12 +1585,6 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni)
1587 err); 1585 err);
1588 goto page_err_out; 1586 goto page_err_out;
1589 } 1587 }
1590 /* Change the runlist terminator to LCN_ENOENT. */
1591 rl2 = rl;
1592 while (rl2->length)
1593 rl2++;
1594 BUG_ON(rl2->lcn != LCN_RL_NOT_MAPPED);
1595 rl2->lcn = LCN_ENOENT;
1596 } else { 1588 } else {
1597 rl = NULL; 1589 rl = NULL;
1598 page = NULL; 1590 page = NULL;