xfs
[Top] [All Lists]

TAKE - Fix error return problems.

Subject: TAKE - Fix error return problems.
From: Eric Sandeen <sandeen@xxxxxxx>
Date: Fri, 6 Apr 2001 14:52:17 -0400
Sender: owner-linux-xfs@xxxxxxxxxxx
This is a cleanup of error returns from the linvfs layer.

In general, tried to follow the rule that "linux-y" functions expect and 
return negative error values, while "XFS-y" functions expect and return 
positive error values.  The linvfs layer is the interface between the two, 
so it expects positive error values, and returns negative error values 
up to Linux.

So:

pagebuf functions expect and return negative errors
linvfs layer functions* expect positive errors and return negative errors
modified core XFS functions in xfs_lrw.c expect and return POSITIVE errors.

*except linvfs_ioctl - Many functions that this calls have overloaded
error values, and return positive byte counts indicating success.
This is clearly noted in the comments, and everything below it seems 
to be consistent, so I have left it unchanged for now.

ALSO

xfs_read() and xfs_write() no longer overload their return value with
negative errors and positive byte counts.  Any non-zero return indicates
an error, and read/write byte counts are passed back via the uio_resid.

FINALLY

an unrelated change - in xfs_write, bypass sync code if
pagebuf_generic_file_write fails, and return immediately.

=====================

Date:  Fri Apr  6 11:36:11 PDT 2001
Workarea:  gibble.americas.sgi.com:/export/xfs1/eric/workarea

The following file(s) were checked into:
  bonnie.engr.sgi.com:/isms/slinx/2.4.x-xfs


Modid:  2.4.x-xfs:slinx:91863a
linux/fs/xfs/linux/xfs_lrw.c - 1.89
        - fix sign problems with error returns, don't overload 
xfs_read,xfs_write returns
          Also changed logic so we don't go through sync code after a pagebuf 
error

linux/fs/xfs/linux/xfs_file.c - 1.42
        - fix sign problems with error returns

linux/fs/xfs/linux/xfs_vnode.c - 1.53
linux/fs/xfs/linux/xfs_super.c - 1.114
        - minor error return cleanups

linux/fs/xfs/linux/xfs_iops.c - 1.99
        - fix sign problems with error returns, other minor error 
cleanups/simplifications

linux/fs/xfs/linux/xfs_ioctl.c - 1.34
        - fix sign problems with error returns, return 0 explicitly when no 
error



<Prev in Thread] Current Thread [Next in Thread>
  • TAKE - Fix error return problems., Eric Sandeen <=