[Libsysio-commit] HEAD: libsysio/drivers/yod fs_yod.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2004-04-16 20:38:42
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30430/drivers/yod Modified Files: fs_yod.c Log Message: New operation for the drivers to implement -- take note! The drivers now need to implement inop_pos which takes an inode and a _SYSIO_OFF_T and should return the resulting position as though it were lseek(FD2INO(fd), off, SEEK_SET). As usual a negative return value is the negated errno. Lseek is altered to use this. Changes in fs_native.c to utilize pread/pwrite whenever positioning is required instead of an lseek/io-op pair of calls. This addresses a race to yod. Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- fs_yod.c 25 Feb 2004 16:23:59 -0000 1.11 +++ fs_yod.c 16 Apr 2004 20:38:34 -0000 1.12 @@ -176,6 +176,8 @@ static int yod_inop_ipreadv(struct inode struct ioctx *ioctx); static int yod_inop_ipwritev(struct inode *ino, struct ioctx *ioctx); +#define yod_inop_pos(ino, off) \ + (_SYSIO_OFF_T (*)(struct inode *, _SYSIO_OFF_T))_sysio_do_espipe static int yod_inop_iodone(struct ioctx *ioctx); static int yod_inop_fcntl(struct inode *ino, int cmd, va_list ap); static int yod_inop_sync(struct inode *ino); @@ -207,6 +209,7 @@ static struct inode_ops yod_i_ops = { yod_inop_rename, yod_inop_ipreadv, yod_inop_ipwritev, + yod_inop_pos, yod_inop_iodone, yod_inop_fcntl, yod_inop_sync, |