[Linux-NTFS-Dev] Re: [Linux-NTFS-cvs] CVS: ntfsprogs/libntfs attrib.c,1.178,1.179
Development moved to https://sourceforge.net/projects/ntfs-3g/
Brought to you by:
antona,
cha0smaster
From: Anton A. <ai...@ca...> - 2005-09-30 10:06:33
|
On Fri, 2005-09-30 at 11:04 +0100, Anton Altaparmakov wrote: > On Fri, 2005-09-30 at 11:02 +0100, Anton Altaparmakov wrote: > > 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. > > And then they will still be broken since upcase and upcase_len will be > NULL and 0 and ntfs_names_collate(IGNORE_CASE) will fail in > ntfs_attr_find(). My initial code using ntfs_attr_get_search_ctx(ni, NULL) was correct. It is just that you want to use ntfs_attr_find() instead of _lookup(). You complained ntfs_attr_find() is internal. That is correct. But you are writing internal code! Internal code is allowed to use internal code... Heck your functions are even in the same file so _find can still remain static! 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/ |