Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/libntfs
In directory usw-pr-cvs1:/tmp/cvs-serv27644a/libntfs
Modified Files:
attrib_RE.c inode.c mft.c volume.c
Log Message:
Rename mft code adding ntfs_ prefix. Change all return values to zero on success. Thanks to mattjf for pointing out the inconsistencies.
Index: attrib_RE.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/attrib_RE.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -U2 -r1.2 -r1.3
--- attrib_RE.c 19 Apr 2002 21:09:55 -0000 1.2
+++ attrib_RE.c 20 Apr 2002 01:53:02 -0000 1.3
@@ -140,5 +140,5 @@
if (!type)
return FALSE;
- if (read_file_record(vol, mref, &ctx->mrec, &ctx->attr) < 0)
+ if (ntfs_read_file_record(vol, mref, &ctx->mrec, &ctx->attr) < 0)
return FALSE;
ctx->base = ctx->mrec;
@@ -207,6 +207,7 @@
ctx->base = 0;
}
- if (read_file_record(vol, le64_to_cpu(al_pos->mft_reference),
- &m, &attr_pos) < 0)
+ if (ntfs_read_file_record(vol,
+ le64_to_cpu(al_pos->mft_reference),
+ &m, &attr_pos) < 0)
return FALSE;
mrec = ctx->mrec;
@@ -266,5 +267,5 @@
if (!type)
return FALSE;
- if (read_file_record(vol, mref, &mrec, &ctx->attr) < 0)
+ if (ntfs_read_file_record(vol, mref, &mrec, &ctx->attr) < 0)
return FALSE;
ctx->base = mrec;
@@ -296,5 +297,5 @@
if (ctx->base)
goto already_have_the_base;
- if (read_file_record(vol, mref, &m, &a) < 0)
+ if (ntfs_read_file_record(vol, mref, &m, &a) < 0)
return FALSE;
ctx->base = ctx->mrec = m;
Index: inode.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/inode.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -U2 -r1.3 -r1.4
--- inode.c 19 Apr 2002 21:21:46 -0000 1.3
+++ inode.c 20 Apr 2002 01:53:02 -0000 1.4
@@ -93,5 +93,5 @@
if (!ni)
return NULL;
- if (read_file_record(vol, mref, &ni->mrec, NULL))
+ if (ntfs_read_file_record(vol, mref, &ni->mrec, NULL))
goto err_out;
ni->mft_no = MREF(mref);
Index: mft.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/mft.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -U2 -r1.20 -r1.21
--- mft.c 16 Apr 2002 12:13:53 -0000 1.20
+++ mft.c 20 Apr 2002 01:53:02 -0000 1.21
@@ -39,5 +39,5 @@
*
* Read @count mft records starting at @mref from volume @vol into buffer
- * @b. Return @count on success or -1 on error, with errno set to the error
+ * @b. Return 0 on success or -1 on error, with errno set to the error
* code.
*
@@ -48,5 +48,5 @@
* NOTE: @b has to be at least of size @count * vol->mft_record_size.
*/
-__s64 read_mft_records(const ntfs_volume *vol, const MFT_REF mref,
+int ntfs_read_mft_records(const ntfs_volume *vol, const MFT_REF mref,
const __s64 count, const MFT_RECORD *b)
{
@@ -94,9 +94,9 @@
return -1;
}
- return br;
+ return 0;
}
/**
- * write_mft_records - write mft records to disk
+ * ntfs_write_mft_records - write mft records to disk
* @vol: volume to write to
* @mref: starting mft record number to write
@@ -105,5 +105,5 @@
*
* Write mft records starting with @mref from buffer @b to volume @vol. Return
- * @count on success or -1 on error, with errno set to the error code.
+ * 0 on success or -1 on error, with errno set to the error code.
*
* Before the mft records are written, they are mst protected. After the write,
@@ -111,5 +111,5 @@
* sequence number inside the buffer @b.
*/
-__s64 write_mft_records(const ntfs_volume *vol, const MFT_REF mref,
+int ntfs_write_mft_records(const ntfs_volume *vol, const MFT_REF mref,
const __s64 count, const MFT_RECORD *b)
{
@@ -158,9 +158,9 @@
return -1;
}
- return bw;
+ return 0;
}
/**
- * read_file_record - read a FILE record from the mft from disk
+ * ntfs_read_file_record - read a FILE record from the mft from disk
* @vol: volume to read from
* @mref: mft reference specifying mft record to read
@@ -185,9 +185,9 @@
* If either of these fails, -1 is returned and errno is set to EIO. If you get
* this, but you still want to read the mft record (e.g. in order to correct
- * it), use read_mft_record() directly.
+ * it), use ntfs_read_mft_record() directly.
*
* Note: Caller has to free *@mrec when finished.
*/
-int read_file_record(const ntfs_volume *vol, const MFT_REF mref,
+int ntfs_read_file_record(const ntfs_volume *vol, const MFT_REF mref,
MFT_RECORD **mrec, ATTR_RECORD **attr)
{
@@ -203,6 +203,6 @@
if (!m)
return -1;
- er = read_mft_record(vol, mref, m);
- if (er != 1) {
+ er = ntfs_read_mft_record(vol, mref, m);
+ if (er) {
if (er != -1)
errno = EIO;
Index: volume.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/volume.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -U2 -r1.29 -r1.30
--- volume.c 19 Apr 2002 21:09:55 -0000 1.29
+++ volume.c 20 Apr 2002 01:53:02 -0000 1.30
@@ -345,7 +345,6 @@
Dprintf("Loading $Bitmap... ");
mref = (MFT_REF)FILE_$Bitmap;
- if ((err = read_file_record(vol, mref, &mb, NULL))) {
+ if (ntfs_read_file_record(vol, mref, &mb, NULL)) {
Dputs(FAILED);
- errno = -err;
goto error_exit;
}
@@ -396,7 +395,6 @@
Dprintf("Loading $UpCase... ");
mref = (MFT_REF)FILE_$UpCase;
- if ((err = read_file_record(vol, mref, &mb, NULL))) {
+ if (ntfs_read_file_record(vol, mref, &mb, NULL)) {
Dputs(FAILED);
- errno = -err;
goto error_exit;
}
@@ -460,7 +458,6 @@
Dprintf("Loading $Volume... ");
mref = (MFT_REF)FILE_$Volume;
- if ((err = read_file_record(vol, mref, &mb, NULL))) {
+ if (ntfs_read_file_record(vol, mref, &mb, NULL)) {
Dputs(FAILED);
- errno = -err;
goto error_exit;
}
|