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
The following file(s) were checked into:
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).