Changes by: uvman
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15396/libntfs
Modified Files:
attrib.c mft.c
Log Message:
Match parameter names between .h and .c files
Index: attrib.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/attrib.c,v
retrieving revision 1.189
retrieving revision 1.190
diff -u -p -r1.189 -r1.190
--- attrib.c 27 Oct 2005 21:20:30 -0000 1.189
+++ attrib.c 28 Oct 2005 12:47:49 -0000 1.190
@@ -1358,7 +1358,7 @@ err_out:
* @pos: byte position in the attribute to begin reading from
* @bk_cnt: number of mst protected blocks to read
* @bk_size: size of each mst protected block in bytes
- * @b: output data buffer
+ * @dst: output data buffer
*
* This function will read @bk_cnt blocks of size @bk_size bytes each starting
* at offset @pos from the ntfs attribute @na into the data buffer @b.
@@ -1382,7 +1382,7 @@ err_out:
* errors can be repaired.
*/
s64 ntfs_attr_mst_pread(ntfs_attr *na, const s64 pos, const s64 bk_cnt,
- const u32 bk_size, void *b)
+ const u32 bk_size, void *dst)
{
s64 br;
u8 *end;
@@ -1394,12 +1394,13 @@ s64 ntfs_attr_mst_pread(ntfs_attr *na, c
errno = EINVAL;
return -1;
}
- br = ntfs_attr_pread(na, pos, bk_cnt * bk_size, b);
+ br = ntfs_attr_pread(na, pos, bk_cnt * bk_size, dst);
if (br <= 0)
return br;
br /= bk_size;
- for (end = (u8*)b + br * bk_size; (u8*)b < end; b = (u8*)b + bk_size)
- ntfs_mst_post_read_fixup((NTFS_RECORD*)b, bk_size);
+ for (end = (u8*)dst + br * bk_size; (u8*)dst < end; dst = (u8*)dst +
+ bk_size)
+ ntfs_mst_post_read_fixup((NTFS_RECORD*)dst, bk_size);
/* Finally, return the number of blocks read. */
return br;
}
@@ -1410,7 +1411,7 @@ s64 ntfs_attr_mst_pread(ntfs_attr *na, c
* @pos: position in the attribute to write to
* @bk_cnt: number of mst protected blocks to write
* @bk_size: size of each mst protected block in bytes
- * @b: data buffer to write to disk
+ * @src: data buffer to write to disk
*
* This function will write @bk_cnt blocks of size @bk_size bytes each from
* data buffer @b to multi sector transfer (mst) protected ntfs attribute @na
@@ -1435,7 +1436,7 @@ s64 ntfs_attr_mst_pread(ntfs_attr *na, c
* achieved.
*/
s64 ntfs_attr_mst_pwrite(ntfs_attr *na, const s64 pos, s64 bk_cnt,
- const u32 bk_size, void *b)
+ const u32 bk_size, void *src)
{
s64 written, i;
@@ -1453,7 +1454,7 @@ s64 ntfs_attr_mst_pwrite(ntfs_attr *na,
int err;
err = ntfs_mst_pre_write_fixup((NTFS_RECORD*)
- ((u8*)b + i * bk_size), bk_size);
+ ((u8*)src + i * bk_size), bk_size);
if (err < 0) {
/* Abort write at this position. */
if (!i)
@@ -1463,10 +1464,11 @@ s64 ntfs_attr_mst_pwrite(ntfs_attr *na,
}
}
/* Write the prepared data. */
- written = ntfs_attr_pwrite(na, pos, bk_cnt * bk_size, b);
+ written = ntfs_attr_pwrite(na, pos, bk_cnt * bk_size, src);
/* Quickly deprotect the data again. */
for (i = 0; i < bk_cnt; ++i)
- ntfs_mst_post_write_fixup((NTFS_RECORD*)((u8*)b + i * bk_size));
+ ntfs_mst_post_write_fixup((NTFS_RECORD*)((u8*)src + i *
+ bk_size));
if (written <= 0)
return written;
/* Finally, return the number of complete blocks written. */
Index: mft.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/mft.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -p -r1.37 -r1.38
--- mft.c 28 Oct 2005 04:32:21 -0000 1.37
+++ mft.c 28 Oct 2005 12:47:49 -0000 1.38
@@ -273,7 +273,7 @@ read_failed:
* ntfs_mft_record_layout - layout an mft record into a memory buffer
* @vol: volume to which the mft record will belong
* @mref: mft reference specifying the mft record number
- * @m: destination buffer of size >= @vol->mft_record_size bytes
+ * @mrec: destination buffer of size >= @vol->mft_record_size bytes
*
* Layout an empty, unused mft record with the mft reference @mref into the
* buffer @m. The volume @vol is needed because the mft record structure was
@@ -283,17 +283,17 @@ read_failed:
* On success return 0 and on error return -1 with errno set to the error code.
*/
int ntfs_mft_record_layout(const ntfs_volume *vol, const MFT_REF mref,
- MFT_RECORD *m)
+ MFT_RECORD *mrec)
{
ATTR_RECORD *a;
- if (!vol || !m) {
+ if (!vol || !mrec) {
errno = EINVAL;
return -1;
}
/* Aligned to 2-byte boundary. */
if (vol->major_ver < 3 || (vol->major_ver == 3 && !vol->minor_ver))
- m->usa_ofs = cpu_to_le16((sizeof(MFT_RECORD_OLD) + 1) & ~1);
+ mrec->usa_ofs = cpu_to_le16((sizeof(MFT_RECORD_OLD) + 1) & ~1);
else {
/* Abort if mref is > 32 bits. */
if (MREF(mref) & 0x0000ffff00000000ull) {
@@ -301,20 +301,20 @@ int ntfs_mft_record_layout(const ntfs_vo
errno = ERANGE;
return -1;
}
- m->usa_ofs = cpu_to_le16((sizeof(MFT_RECORD) + 1) & ~1);
+ mrec->usa_ofs = cpu_to_le16((sizeof(MFT_RECORD) + 1) & ~1);
/*
* Set the NTFS 3.1+ specific fields while we know that the
* volume version is 3.1+.
*/
- m->reserved = cpu_to_le16(0);
- m->mft_record_number = cpu_to_le32(MREF(mref));
+ mrec->reserved = cpu_to_le16(0);
+ mrec->mft_record_number = cpu_to_le32(MREF(mref));
}
- m->magic = magic_FILE;
+ mrec->magic = magic_FILE;
if (vol->mft_record_size >= NTFS_BLOCK_SIZE)
- m->usa_count = cpu_to_le16(vol->mft_record_size /
+ mrec->usa_count = cpu_to_le16(vol->mft_record_size /
NTFS_BLOCK_SIZE + 1);
else {
- m->usa_count = cpu_to_le16(1);
+ mrec->usa_count = cpu_to_le16(1);
ntfs_log_debug("Sector size is bigger than MFT record size. "
"Setting usa_count to 1. If Windows\n");
ntfs_log_debug("chkdsk reports this as corruption, please email "
@@ -324,28 +324,28 @@ int ntfs_mft_record_layout(const ntfs_vo
ntfs_log_debug("Thank you.\n");
}
/* Set the update sequence number to 1. */
- *(u16*)((u8*)m + le16_to_cpu(m->usa_ofs)) = cpu_to_le16(1);
- m->lsn = cpu_to_le64(0ull);
- m->sequence_number = cpu_to_le16(1);
- m->link_count = cpu_to_le16(0);
+ *(u16*)((u8*)mrec + le16_to_cpu(mrec->usa_ofs)) = cpu_to_le16(1);
+ mrec->lsn = cpu_to_le64(0ull);
+ mrec->sequence_number = cpu_to_le16(1);
+ mrec->link_count = cpu_to_le16(0);
/* Aligned to 8-byte boundary. */
- m->attrs_offset = cpu_to_le16((le16_to_cpu(m->usa_ofs) +
- (le16_to_cpu(m->usa_count) << 1) + 7) & ~7);
- m->flags = cpu_to_le16(0);
+ mrec->attrs_offset = cpu_to_le16((le16_to_cpu(mrec->usa_ofs) +
+ (le16_to_cpu(mrec->usa_count) << 1) + 7) & ~7);
+ mrec->flags = cpu_to_le16(0);
/*
* Using attrs_offset plus eight bytes (for the termination attribute),
* aligned to 8-byte boundary.
*/
- m->bytes_in_use = cpu_to_le32((le16_to_cpu(m->attrs_offset) + 8 + 7) &
- ~7);
- m->bytes_allocated = cpu_to_le32(vol->mft_record_size);
- m->base_mft_record = cpu_to_le64((MFT_REF)0);
- m->next_attr_instance = cpu_to_le16(0);
- a = (ATTR_RECORD*)((u8*)m + le16_to_cpu(m->attrs_offset));
+ mrec->bytes_in_use = cpu_to_le32((le16_to_cpu(mrec->attrs_offset) + 8 +
+ 7) & ~7);
+ mrec->bytes_allocated = cpu_to_le32(vol->mft_record_size);
+ mrec->base_mft_record = cpu_to_le64((MFT_REF)0);
+ mrec->next_attr_instance = cpu_to_le16(0);
+ a = (ATTR_RECORD*)((u8*)mrec + le16_to_cpu(mrec->attrs_offset));
a->type = AT_END;
a->length = cpu_to_le32(0);
/* Finally, clear the unused part of the mft record. */
- memset((u8*)a + 8, 0, vol->mft_record_size - ((u8*)a + 8 - (u8*)m));
+ memset((u8*)a + 8, 0, vol->mft_record_size - ((u8*)a + 8 - (u8*)mrec));
return 0;
}
|