Hi Yura,
On Fri, 2005-09-30 at 02:52 -0700, Yura Pakhuchiy wrote:
> Changes by: cha0smaster
>
> Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3398/libntfs
>
> Modified Files:
> attrib.c
> Log Message:
> Revert Anton's code that breaks functions needed for attribute resize.
>
>
> Index: attrib.c
> ===================================================================
> RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/attrib.c,v
> retrieving revision 1.178
> retrieving revision 1.179
> diff -u -p -r1.178 -r1.179
> --- attrib.c 28 Sep 2005 13:47:47 -0000 1.178
> +++ attrib.c 30 Sep 2005 09:52:05 -0000 1.179
> @@ -2554,7 +2554,7 @@ int ntfs_resident_attr_record_add(ntfs_i
> }
>
> /* Locate place where record should be. */
> - ctx = ntfs_attr_get_search_ctx(ni, NULL);
> + ctx = ntfs_attr_get_search_ctx(NULL, ni->mrec);
> if (!ctx)
> return -1;
> if (!ntfs_attr_lookup(type, name, name_len,
> @@ -2679,7 +2679,7 @@ int ntfs_non_resident_attr_record_add(nt
> }
>
> /* Locate place where record should be. */
> - ctx = ntfs_attr_get_search_ctx(ni, NULL);
> + ctx = ntfs_attr_get_search_ctx(NULL, ni->mrec);
> if (!ctx)
> return -1;
> if (!ntfs_attr_lookup(type, name, name_len, CASE_SENSITIVE,
> @@ -3342,7 +3342,7 @@ int ntfs_attr_record_move_to(ntfs_attr_s
>
> /* Find place in MFT record where attribute will be moved. */
> a = ctx->attr;
> - nctx = ntfs_attr_get_search_ctx(ni, NULL);
> + nctx = ntfs_attr_get_search_ctx(NULL, ni->mrec);
> if (!nctx) {
> err = errno;
> Dprintf("%s(): Couldn't obtain search context.\n",
The above three will now always fail when name != NULL in the call to
ntfs_attr_lookup(). You must use ntfs_attr_find() instead.
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
|