Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/libntfs
In directory usw-pr-cvs1:/tmp/cvs-serv9215/libntfs
Modified Files:
attrib.c mft.c volume.c
Log Message:
Update library for the new API.
Index: attrib.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/attrib.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -U2 -r1.20 -r1.21
--- attrib.c 15 Apr 2002 17:51:26 -0000 1.20
+++ attrib.c 15 Apr 2002 18:54:06 -0000 1.21
@@ -340,9 +340,8 @@
* files as well?
*/
- r = ntfs_pread(vol->fd, intbuf,
+ r = ntfs_pread(vol->fd, rl[i].lcn <<
+ vol->cluster_size_bits,
vol->cluster_size *
- rl[i].length,
- rl[i].lcn <<
- vol->cluster_size_bits);
+ rl[i].length, intbuf);
if (r != rl[i].length) {
#define ESTR "Error reading attribute value"
@@ -376,8 +375,8 @@
* be 16 (= compression unit size).
*/
- r = ntfs_pread(vol->fd, b + total,
+ r = ntfs_pread(vol->fd, rl[i].lcn <<
+ vol->cluster_size_bits,
vol->cluster_size *
- rl[i].length, rl[i].lcn <<
- vol->cluster_size_bits);
+ rl[i].length, b + total);
if (r != rl[i].length) {
#define ESTR "Error reading attribute value"
@@ -454,9 +453,10 @@
/* Now write all clusters to disk from b. */
for (i = 0, total = 0; rl[i].length && (l > 0); i++) {
- w = ntfs_pwrite(vol->fd, b + total,
- min(l, rl[i].length << vol->cluster_size_bits),
- rl[i].lcn << vol->cluster_size_bits);
+ w = ntfs_pwrite(vol->fd, rl[i].lcn <<
+ vol->cluster_size_bits, min(l,
+ rl[i].length << vol->cluster_size_bits),
+ b + total);
if (w != min(l, rl[i].length <<
- vol->cluster_size_bits)) {
+ vol->cluster_size_bits)) {
#define ESTR "Error writing attribute value"
if (w == -1) {
Index: mft.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/mft.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -U2 -r1.16 -r1.17
--- mft.c 15 Apr 2002 18:39:37 -0000 1.16
+++ mft.c 15 Apr 2002 18:54:07 -0000 1.17
@@ -181,5 +181,5 @@
return -EINVAL;
}
- if (!(m = malloc(vol->mft_record_size)))
+ if (!(m = (MFT_RECORD*)malloc(vol->mft_record_size)))
return -ENOMEM;
if ((er = get_mft_record(vol, m, mref)) != 1)
Index: volume.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/volume.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -U2 -r1.22 -r1.23
--- volume.c 15 Apr 2002 00:42:08 -0000 1.22
+++ volume.c 15 Apr 2002 18:54:07 -0000 1.23
@@ -137,5 +137,5 @@
}
/* Now read the bootsector. */
- br = ntfs_pread(vol->fd, bs, sizeof(NTFS_BOOT_SECTOR), 0);
+ br = ntfs_pread(vol->fd, 0, sizeof(NTFS_BOOT_SECTOR), bs);
if (br != 1) {
Dputs(FAILED);
@@ -230,6 +230,6 @@
}
/* Can't use any of the higher level functions yet! */
- br = mst_pread(vol->fd, (char*)mb, vol->mft_record_size, 1,
- vol->mft_lcn << vol->cluster_size_bits);
+ br = mst_pread(vol->fd, vol->mft_lcn << vol->cluster_size_bits, 1,
+ vol->mft_record_size, mb);
if (br != 1) {
Dputs(FAILED);
|