Commit Graph

24 Commits

Author SHA1 Message Date
Anton Altaparmakov
2a6fc4e1b0 NTFS: Fix ntfs_attr_make_non_resident() to update the vfs inode i_blocks
which is zero for a resident attribute but should no longer be zero
      once the attribute is non-resident as it then has real clusters
      allocated.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-10-04 14:57:15 +01:00
Anton Altaparmakov
8925d4f0d3 NTFS: Change ntfs_attr_make_non_resident to take the attribute value size
as an extra parameter.  This is needed since we need to know the size
      before we can map the mft record and our callers always know it.  The
      reason we cannot simply read the size from the vfs inode i_size is
      that this is not necessarily uptodate.  This happens when
      ntfs_attr_make_non_resident() is called in the ->truncate call path.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-10-04 14:48:20 +01:00
Anton Altaparmakov
fc0fa7dc7d 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>
2005-10-04 14:36:56 +01:00
Anton Altaparmakov
69b41e3c02 NTFS: Change ntfs_attr_find_vcn_nolock() to also take an optional attribute
search context as argument.  This allows calling it with the mft
      record mapped.  Update all callers.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-10-04 14:01:14 +01:00
Anton Altaparmakov
fd9d63678d NTFS: Change ntfs_map_runlist_nolock() to also take an optional attribute
search context.  This allows calling it with the mft record mapped.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-10-04 13:44:48 +01:00
Anton Altaparmakov
807c453de7 NTFS: Fix handling of sparse attributes in ntfs_attr_make_non_resident().
Also, add BUG() checks to ntfs_attr_make_non_resident() and
      ntfs_attr_set() to ensure that these functions are never called
      for compressed or encrypted attributes.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-09-08 21:01:17 +01:00
Anton Altaparmakov
2983d1bd1a NTFS: Fix several bugs in fs/ntfs/attrib.c.
- Fix a bug in ntfs_map_runlist_nolock() where we forgot to protect
  access to the allocated size in the ntfs inode with the size lock.
- Fix ntfs_attr_vcn_to_lcn_nolock() and ntfs_attr_find_vcn_nolock() to
  return LCN_ENOENT when there is no runlist and the allocated size is
  zero.
- Fix load_attribute_list() to handle the case of a NULL runlist.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-09-08 20:56:09 +01:00
Anton Altaparmakov
0aacceacf3 NTFS: Add fs/ntfs/attrib.[hc]::ntfs_resident_attr_value_resize().
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-09-08 20:40:32 +01:00
Anton Altaparmakov
af859a42d7 NTFS: Prepare for 2.1.23 release: Update documentation and bump version.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-06-25 21:07:27 +01:00
Anton Altaparmakov
4757d7dff6 NTFS: Change ntfs_map_runlist_nolock() to only decompress the mapping pairs
if the requested vcn is inside it.  Otherwise we get into problems
      when we try to map an out of bounds vcn because we then try to map
      the already mapped runlist fragment which causes
      ntfs_mapping_pairs_decompress() to fail and return error.  Update
      ntfs_attr_find_vcn_nolock() accordingly.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-06-25 17:24:08 +01:00
Anton Altaparmakov
fa3be92317 NTFS: Add an extra parameter @last_vcn to ntfs_get_size_for_mapping_pairs()
and ntfs_mapping_pairs_build() to allow the runlist encoding to be
      partial which is desirable when filling holes in sparse attributes.
      Update all callers.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-06-25 17:15:36 +01:00
Anton Altaparmakov
1d58b27b8d NTFS: Change the runlist terminator of the newly allocated cluster(s) to
LCN_ENOENT in ntfs_attr_make_non_resident().  Otherwise the runlist
      code gets confused.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-06-25 17:04:55 +01:00
Anton Altaparmakov
442d207eb0 NTFS: Use C99 style structure initialization after memory allocation where
possible (fs/ntfs/{attrib.c,index.c,super.c}).  Thanks to Al Viro and
      Pekka Enberg.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-05-27 16:42:56 +01:00
Anton Altaparmakov
bb3cf33509 NTFS: Update attribute definition handling.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-05-05 11:46:17 +01:00
Anton Altaparmakov
53d59aad93 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>
2005-05-05 11:39:30 +01:00
Anton Altaparmakov
1ef334d372 NTFS: Include linux/swap.h in fs/ntfs/attrib.c for mark_page_accessed().
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-05-05 11:27:45 +01:00
Anton Altaparmakov
905685f68f NTFS: - Modify ->readpage and ->writepage (fs/ntfs/aops.c) so they detect
and handle the case where an attribute is converted from resident
        to non-resident by a concurrent file write.
      - Reorder some operations when converting an attribute from resident
        to non-resident (fs/ntfs/attrib.c) so it is safe wrt concurrent
        ->readpage and ->writepage.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-05-05 11:26:01 +01:00
Anton Altaparmakov
2bfb4fff3e NTFS: Add fs/ntfs/attrib.[hc]::ntfs_attr_make_non_resident().
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-05-05 11:22:07 +01:00
Anton Altaparmakov
c0c1cc0e46 NTFS: - Fix bug in fs/ntfs/attrib.c::ntfs_find_vcn_nolock() where after
dropping the read lock and taking the write lock we were not checking
        whether someone else did not already do the work we wanted to do.
      - Rename ntfs_find_vcn_nolock() to ntfs_attr_find_vcn_nolock().
      - Tidy up some comments in fs/ntfs/runlist.c.
      - Add LCN_ENOMEM and LCN_EIO definitions to fs/ntfs/runlist.h.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-05-05 11:20:49 +01:00
Anton Altaparmakov
271849a988 NTFS: Add fs/ntfs/attrib.[hc]::ntfs_attr_vcn_to_lcn_nolock() used by the new
write code.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-05-05 11:18:43 +01:00
Anton Altaparmakov
7e693073a9 NTFS: Add AT_EA in addition to AT_DATA to whitelist for being allowed to be
non-resident in fs/ntfs/attrib.c::ntfs_attr_can_be_non_resident().

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-05-05 11:17:08 +01:00
Anton Altaparmakov
b6ad6c52fe NTFS: - Split ntfs_map_runlist() into ntfs_map_runlist() and a non-locking
helper ntfs_map_runlist_nolock() which is used by ntfs_map_runlist().
	This allows us to map runlist fragments with the runlist lock already
	held without having to drop and reacquire it around the call.  Adapt
	all callers.
      - Change ntfs_find_vcn() to ntfs_find_vcn_nolock() which takes a locked
	runlist.  This allows us to find runlist elements with the runlist
	lock already held without having to drop and reacquire it around the
	call.  Adapt all callers.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-05-05 10:56:31 +01:00
Anton Altaparmakov
da28438cae NTFS: Use i_size_read() in fs/ntfs/attrib.c::ntfs_attr_set().
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
2005-05-04 14:24:16 +01:00
Linus Torvalds
1da177e4c3 Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
2005-04-16 15:20:36 -07:00