aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs/attrib.c
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-03-17 05:51:33 -0500
committerAnton Altaparmakov <aia21@cantab.net>2005-05-05 06:39:30 -0400
commit53d59aad9326199ef5749c97513db498309a057e (patch)
tree3fc3e99673cf5c5c8f275cca1ec7ed2dfe5fa192 /fs/ntfs/attrib.c
parent1ef334d372d6a7006e20f56f7e85d8f4ec32e3c2 (diff)
NTFS: Fix compilation when configured read-only.
- Add ifdef NTFS_RW around write specific code if fs/ntfs/runlist.[hc] and fs/ntfs/attrib.[hc]. - Minor bugfix to fs/ntfs/attrib.c::ntfs_attr_make_non_resident() where the runlist was not freed in all error cases. - Add fs/ntfs/runlist.[hc]::ntfs_rl_find_vcn_nolock(). Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Diffstat (limited to 'fs/ntfs/attrib.c')
-rw-r--r--fs/ntfs/attrib.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c
index 97e6fb047aa0..1b95f39234a3 100644
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -1057,6 +1057,8 @@ void ntfs_attr_put_search_ctx(ntfs_attr_search_ctx *ctx)
1057 return; 1057 return;
1058} 1058}
1059 1059
1060#ifdef NTFS_RW
1061
1060/** 1062/**
1061 * ntfs_attr_find_in_attrdef - find an attribute in the $AttrDef system file 1063 * ntfs_attr_find_in_attrdef - find an attribute in the $AttrDef system file
1062 * @vol: ntfs volume to which the attribute belongs 1064 * @vol: ntfs volume to which the attribute belongs
@@ -1243,6 +1245,13 @@ int ntfs_attr_record_resize(MFT_RECORD *m, ATTR_RECORD *a, u32 new_size)
1243 * -ENOSPC - Not enough disk space. 1245 * -ENOSPC - Not enough disk space.
1244 * -EINVAL - Attribute not defined on the volume. 1246 * -EINVAL - Attribute not defined on the volume.
1245 * -EIO - I/o error or other error. 1247 * -EIO - I/o error or other error.
1248 * Note that -ENOSPC is also returned in the case that there is not enough
1249 * space in the mft record to do the conversion. This can happen when the mft
1250 * record is already very full. The caller is responsible for trying to make
1251 * space in the mft record and trying again. FIXME: Do we need a separate
1252 * error return code for this kind of -ENOSPC or is it always worth trying
1253 * again in case the attribute may then fit in a resident state so no need to
1254 * make it non-resident at all? Ho-hum... (AIA)
1246 * 1255 *
1247 * NOTE to self: No changes in the attribute list are required to move from 1256 * NOTE to self: No changes in the attribute list are required to move from
1248 * a resident to a non-resident attribute. 1257 * a resident to a non-resident attribute.
@@ -1520,13 +1529,13 @@ err_out:
1520rl_err_out: 1529rl_err_out:
1521 if (rl) { 1530 if (rl) {
1522 if (ntfs_cluster_free_from_rl(vol, rl) < 0) { 1531 if (ntfs_cluster_free_from_rl(vol, rl) < 0) {
1523 ntfs_free(rl);
1524 ntfs_error(vol->sb, "Failed to release allocated " 1532 ntfs_error(vol->sb, "Failed to release allocated "
1525 "cluster(s) in error code path. Run " 1533 "cluster(s) in error code path. Run "
1526 "chkdsk to recover the lost " 1534 "chkdsk to recover the lost "
1527 "cluster(s)."); 1535 "cluster(s).");
1528 NVolSetErrors(vol); 1536 NVolSetErrors(vol);
1529 } 1537 }
1538 ntfs_free(rl);
1530page_err_out: 1539page_err_out:
1531 unlock_page(page); 1540 unlock_page(page);
1532 page_cache_release(page); 1541 page_cache_release(page);
@@ -1680,3 +1689,5 @@ done:
1680 ntfs_debug("Done."); 1689 ntfs_debug("Done.");
1681 return 0; 1690 return 0;
1682} 1691}
1692
1693#endif /* NTFS_RW */