XFS generally lives with positive error values, and does not overload
returns to hold errors + bytes written. Linux in general uses - errors
to overload returns.
xfs_write was returning positive values for errors -and- for bytes
written, which made it hard to distinguish EINVAL from 22 bytes
written, for example. :(
Usually the switch-over is made in the "linvfs" functions, but in this
case it's going in xfs_write; xfs_read is already like this.
This fixes at least 1 bug of not failing correctly when attempting
unaligned direct IO writes.
Date: Fri Aug 2 12:39:17 PDT 2002
Workarea:
stout.americas.sgi.com:/localhome/src/sandeen/2.4.x-xfs/workarea-alwaysclean
The following file(s) were checked into:
bonnie.engr.sgi.com:/isms/slinx/2.4.x-xfs
Modid: 2.4.x-xfs:slinx:124225a
linux/fs/xfs/xfs_dmapi.c - 1.75
- Use ssize_t variable for return of xfs_read/write, not int
linux/fs/xfs/linux/xfs_lrw.c - 1.163
- Make xfs_write return (-) errors and (+) bytes written.
Fix comment on xfs_read about about return val (same as xfs_write).
|