+xfsprogs-2.8.x
+ - Fix up xfs_io mmap read that read from the wrong offset.
+ - Updated xfs_io man page.
+ Thanks to Utako Kusaka <utako@tnes.nec.co.jp> for these.
+
xfsprogs-2.8.17
- Fix up libxfs SEGV when attempting to mount a non-XFS filesystem.
- Thanks to Utako Kuzaka <utako@tnes.nec.co.jp> for this.
+ Thanks to Utako Kusaka <utako@tnes.nec.co.jp> for this.
- Fix up xfs_repair aborting if it finds an inode with an invalid
inode type.
- Fix up default realtime extent size for large block sizes.
xfsprogs-2.8.14 (6 October 2006)
- Fix up the ring command in xfs_db,
- Thanks to Utako Kuzaka <utako@tnes.nec.co.jp> for this.
+ Thanks to Utako Kusaka <utako@tnes.nec.co.jp> for this.
- Set the blocksize on the device to the given sector
size which is _not_ necessarily 512 bytes;
idea suggested by Shailendra Tripathi.
return 0;
}
-static int
-read_mapping(
- char *dest,
- off64_t offset,
- int dump,
- off64_t dumpoffset,
- size_t dumplength)
-{
- *dest = *(((char *)mapping->addr) + offset);
-
- if (offset % pagesize == 0) {
- if (dump == 2)
- dumpoffset += mapping->offset;
- if (dump)
- dump_buffer(dumpoffset, dumplength);
- return 1;
- }
- return 0;
-}
-
static void
mread_help(void)
{
int argc,
char **argv)
{
- off64_t offset, tmp;
+ off64_t offset, tmp, dumpoffset, printoffset;
ssize_t length;
- size_t dumplen;
+ size_t dumplen, cnt = 0;
char *bp;
void *start;
int dump = 0, rflag = 0, c;
start = check_mapping_range(mapping, offset, length, 0);
if (!start)
return 0;
+ dumpoffset = offset - mapping->offset;
+ if (dump == 2)
+ printoffset = offset;
+ else
+ printoffset = dumpoffset;
if (alloc_buffer(pagesize, 0, 0) < 0)
return 0;
dumplen = pagesize;
if (rflag) {
- for (tmp = length, c = 0; tmp > 0; tmp--, bp++, c = 1)
- if (read_mapping(bp, tmp, c? dump:0, offset, dumplen)) {
+ for (tmp = length - 1, c = 0; tmp >= 0; tmp--, c = 1) {
+ *bp = *(((char *)mapping->addr) + dumpoffset + tmp);
+ cnt++;
+ if (c && cnt == dumplen) {
+ if (dump) {
+ dump_buffer(printoffset, dumplen);
+ printoffset += dumplen;
+ }
bp = (char *)buffer;
dumplen = pagesize;
+ cnt = 0;
+ } else {
+ bp++;
}
+ }
} else {
- for (tmp = 0, c = 0; tmp < length; tmp++, bp++, c = 1)
- if (read_mapping(bp, tmp, c? dump:0, offset, dumplen)) {
+ for (tmp = 0, c = 0; tmp < length; tmp++, c = 1) {
+ *bp = *(((char *)mapping->addr) + dumpoffset + tmp);
+ cnt++;
+ if (c && cnt == dumplen) {
+ if (dump)
+ dump_buffer(printoffset + tmp -
+ (dumplen - 1), dumplen);
bp = (char *)buffer;
dumplen = pagesize;
+ cnt = 0;
+ } else {
+ bp++;
}
- }
- /* dump the remaining (partial page) part of the read buffer */
- if (dump) {
- if (rflag)
- dumplen = length % pagesize;
- else
- dumplen = tmp % pagesize;
- if (dumplen) {
- if (dump == 2)
- tmp += mapping->offset;
- dump_buffer(tmp, dumplen);
}
}
return 0;
return 0;
if (rflag) {
- for (tmp = offset + length; tmp > offset; tmp--)
+ for (tmp = offset + length -1; tmp >= offset; tmp--)
((char *)mapping->addr)[tmp] = seed;
} else {
for (tmp = offset; tmp < offset + length; tmp++)
\f3c\f1
See the \f3close\f1 command.
.TP
-\f3pread\f1 [ \f2\-b bsize\f1 ] [ \f2\-v\f1 ]
+\f3pread\f1 [ \f2\-b bsize\f1 ] [ \f2\-v\f1 ] \f2offset\f1 \f2length\f1
Reads a range of bytes in a specified blocksize from the given offset.
.br
The \f3\-b\f1 option can be used to set the blocksize into which the
\f3r\f1
See the \f3pread\f1 command.
.TP
-\f3pwrite\f1 [ \f2\-i file\f1 ] [ \f2\-d\f1 ] [ \f2\-s skip\f1 ] [ \f2\-b size\f1 ] [ \f2\-S seed\f1 ]
+\f3pwrite\f1 [ \f2\-i file\f1 ] [ \f2\-d\f1 ] [ \f2\-s skip\f1 ] [ \f2\-b size\f1 ] [ \f2\-S seed\f1 ] \f2offset\f1 \f2length\f1
Writes a range of bytes in a specified blocksize from the given offset.
The bytes written can be either a set pattern or read in from another
file before writing.
\f3mu\f1
See the \f3munmap\f1 command.
.TP
-\f3mread\f1 [ \-\f2frv\f1 ]
+\f3mread\f1 [ \-\f2frv\f1 ] [ \f2offset\f1 \f2length\f1 ]
Accesses a segment of the current memory mapping, optionally dumping it to
the standard output stream (with \f2-v\f1 or \f2-f\f1 option) for inspection.
The accesses are performed sequentially from the start offset by default,
\f3mr\f1
See the \f3mread\f1 command.
.TP
-\f3mwrite\f1 [ \f2-r\f1 ] [ \f2-S seed\f1 ]
+\f3mwrite\f1 [ \f2-r\f1 ] [ \f2-S seed\f1 ] [ \f2offset\f1 \f2length\f1 ]
Stores a byte into memory for a range within a mapping.
The default stored value is 'X', repeated to fill the range specified,
but this can be changed using the \f2-S\f1 option.