[Libsysio-commit] b_lustre: libsysio/src chdir.c chmod.c chown.c dup.c fcntl.c fsync.c getdirentries
Brought to you by:
lward
Update of /cvsroot/libsysio/libsysio/src
In directory sc8-pr-cvs1:/tmp/cvs-serv5026/src
Modified Files:
Tag: b_lustre
chdir.c chmod.c chown.c dup.c fcntl.c fsync.c getdirentries.c
init.c ioctl.c lseek.c mkdir.c mknod.c open.c read.c rmdir.c
stat.c stat64.c statvfs.c statvfs64.c symlink.c truncate.c
unlink.c write.c
Log Message:
make lustre could hook functions on when enter/leave system calls.
Index: chdir.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v
retrieving revision 1.3.8.1
retrieving revision 1.3.8.2
diff -u -w -b -B -p -r1.3.8.1 -r1.3.8.2
--- chdir.c 17 Jun 2003 05:46:57 -0000 1.3.8.1
+++ chdir.c 29 Jun 2003 10:15:32 -0000 1.3.8.2
@@ -84,10 +84,12 @@ chdir(const char *path)
{
int err;
struct pnode *pno;
+ SYSIO_ENTER;
err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno);
if (err) {
errno = -err;
+ SYSIO_LEAVE;
return -1;
}
@@ -95,6 +97,7 @@ chdir(const char *path)
P_RELE(_sysio_cwd);
_sysio_cwd = pno;
+ SYSIO_LEAVE;
return 0;
}
@@ -104,6 +107,7 @@ getwd(char *buf)
size_t len, n;
struct pnode *tmp;
char *cp;
+ SYSIO_ENTER;
/*
* First pass: Traverse to the root of the sub-tree, remembering
@@ -151,6 +155,7 @@ getwd(char *buf)
tmp = tmp->p_mount->mnt_root;
} while (tmp != tmp->p_parent);
+ SYSIO_LEAVE;
return buf;
}
@@ -240,11 +245,14 @@ char *
getcwd(char *buf, size_t size)
{
int err;
+ SYSIO_ENTER;
err = _sysio_p_path(_sysio_cwd, &buf, buf ? size : 0);
if (err) {
errno = -err;
+ SYSIO_LEAVE;
return NULL;
}
+ SYSIO_LEAVE;
return buf;
}
Index: chmod.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v
retrieving revision 1.3.4.1
retrieving revision 1.3.4.2
diff -u -w -b -B -p -r1.3.4.1 -r1.3.4.2
--- chmod.c 17 Jun 2003 03:38:31 -0000 1.3.4.1
+++ chmod.c 29 Jun 2003 10:15:32 -0000 1.3.4.2
@@ -59,6 +59,7 @@ chmod(const char *path, mode_t mode)
struct pnode *pno;
struct intnl_stat stbuf;
unsigned mask;
+ SYSIO_ENTER;
err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno);
if (err)
@@ -73,5 +74,6 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: chown.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -b -B -p -r1.3 -r1.3.4.1
--- chown.c 24 Mar 2003 22:09:06 -0000 1.3
+++ chown.c 29 Jun 2003 10:15:32 -0000 1.3.4.1
@@ -59,6 +59,7 @@ chown(const char *path, uid_t owner, gid
struct pnode *pno;
struct intnl_stat stbuf;
unsigned mask;
+ SYSIO_ENTER;
err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno);
if (err)
@@ -83,5 +84,6 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: dup.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.12.1
diff -u -w -b -B -p -r1.1.1.1 -r1.1.1.1.12.1
--- dup.c 22 Feb 2003 16:33:05 -0000 1.1.1.1
+++ dup.c 29 Jun 2003 10:15:32 -0000 1.1.1.1.12.1
@@ -52,21 +52,34 @@
int
dup2(int oldfd, int newfd)
{
+ int rc;
+ SYSIO_ENTER;
if (newfd < 0) {
errno = EBADF;
+ SYSIO_LEAVE;
return -1;
}
- if (oldfd == newfd)
+ if (oldfd == newfd) {
+ SYSIO_LEAVE;
return newfd;
+ }
+
+ rc = _sysio_fd_dup2(oldfd, newfd);
- return _sysio_fd_dup2(oldfd, newfd);
+ SYSIO_LEAVE;
+ return rc;
}
int
dup(int oldfd)
{
+ int rc;
+ SYSIO_ENTER;
+
+ rc = _sysio_fd_dup2(oldfd, -1);
- return _sysio_fd_dup2(oldfd, -1);
+ SYSIO_LEAVE;
+ return rc;
}
Index: fcntl.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v
retrieving revision 1.3.2.3
retrieving revision 1.3.2.4
diff -u -w -b -B -p -r1.3.2.3 -r1.3.2.4
--- fcntl.c 19 Jun 2003 12:18:29 -0000 1.3.2.3
+++ fcntl.c 29 Jun 2003 10:15:32 -0000 1.3.2.4
@@ -59,6 +59,7 @@ fcntl(int fd, int cmd, ...)
int err;
struct file *fil;
va_list ap;
+ SYSIO_ENTER;
err = 0;
fil = _sysio_fd_find(fd);
@@ -66,6 +67,7 @@ fcntl(int fd, int cmd, ...)
va_start(ap, cmd);
err = __bypass_fcntl(fd, cmd, ap);
va_end(ap);
+ SYSIO_LEAVE;
return err;
}
@@ -74,6 +76,7 @@ fcntl(int fd, int cmd, ...)
case F_DUPFD:
{
long newfd;
+ int rc;
va_start(ap, cmd);
newfd = va_arg(ap, long);
@@ -82,7 +85,10 @@ fcntl(int fd, int cmd, ...)
err = -EBADF;
goto out;
}
- return _sysio_fd_dup2(fd, (int )newfd);
+ rc = _sysio_fd_dup2(fd, (int )newfd);
+
+ SYSIO_LEAVE;
+ return rc;
}
break;
default:
@@ -97,5 +103,6 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: fsync.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v
retrieving revision 1.2
retrieving revision 1.2.8.1
diff -u -w -b -B -p -r1.2 -r1.2.8.1
--- fsync.c 9 Mar 2003 06:22:43 -0000 1.2
+++ fsync.c 29 Jun 2003 10:15:32 -0000 1.2.8.1
@@ -55,17 +55,22 @@ fsync(int fd)
{
struct file *fil;
int err;
+ SYSIO_ENTER;
fil = _sysio_fd_find(fd);
if (!(fil && fil->f_ino)) {
errno = -EBADF;
+ SYSIO_LEAVE;
return -1;
}
err = (*fil->f_ino->i_ops.inop_sync)(fil->f_ino);
if (err) {
errno = -err;
+ SYSIO_LEAVE;
return -1;
}
+
+ SYSIO_LEAVE;
return 0;
}
@@ -74,16 +79,21 @@ fdatasync(int fd)
{
struct file *fil;
int err;
+ SYSIO_ENTER;
fil = _sysio_fd_find(fd);
if (!(fil && fil->f_ino)) {
errno = -EBADF;
+ SYSIO_LEAVE;
return -1;
}
err = (*fil->f_ino->i_ops.inop_datasync)(fil->f_ino);
if (err) {
errno = -err;
+ SYSIO_LEAVE;
return -1;
}
+
+ SYSIO_LEAVE;
return 0;
}
Index: getdirentries.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v
retrieving revision 1.1
retrieving revision 1.1.8.1
diff -u -w -b -B -p -r1.1 -r1.1.8.1
--- getdirentries.c 9 Mar 2003 13:53:53 -0000 1.1
+++ getdirentries.c 29 Jun 2003 10:15:32 -0000 1.1.8.1
@@ -68,6 +67,7 @@ getdirentries(int fd, char *buf, size_t
size_t n;
size_t reclen;
char *cp;
+ SYSIO_ENTER;
#define _dbaselen ((size_t )&((struct dirent *)0)->d_name[0])
#ifdef __GNUC__
@@ -93,6 +93,7 @@ getdirentries(int fd, char *buf, size_t
ibuf = _fast_alloc(inbytes);
if (!ibuf) {
errno = ENOMEM;
+ SYSIO_LEAVE;
return -1;
}
@@ -150,11 +151,13 @@ out:
if (dp == (struct dirent *)buf && cc < 0) {
errno = (int )-cc;
+ SYSIO_LEAVE;
return -1;
}
cc = (char *)dp - buf;
if (cc)
*basep = od64p->d_off;
+ SYSIO_LEAVE;
return cc;
#ifdef __GNUC__
Index: init.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/init.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -b -B -p -r1.3 -r1.3.4.1
--- init.c 24 Mar 2003 22:09:06 -0000 1.3
+++ init.c 29 Jun 2003 10:15:32 -0000 1.3.4.1
@@ -56,6 +56,9 @@
#include "stdfd.h"
#endif
+int __sysio_in_syscall = 0;
+__sysio_hook_func *__sysio_hook_sys_enter = NULL;
+__sysio_hook_func *__sysio_hook_sys_leave = NULL;
/*
* Sysio library initialization. Must be called before anything else in the
* library.
Index: ioctl.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.12.1
diff -u -w -b -B -p -r1.1.1.1 -r1.1.1.1.12.1
--- ioctl.c 22 Feb 2003 16:33:07 -0000 1.1.1.1
+++ ioctl.c 29 Jun 2003 10:15:32 -0000 1.1.1.1.12.1
@@ -56,6 +56,7 @@ ioctl(int fd, unsigned long request, ...
int err;
struct file *fil;
va_list ap;
+ SYSIO_ENTER;
err = 0;
fil = _sysio_fd_find(fd);
@@ -73,5 +74,6 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: lseek.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -w -b -B -p -r1.4 -r1.4.2.1
--- lseek.c 27 Apr 2003 13:20:01 -0000 1.4
+++ lseek.c 29 Jun 2003 10:15:32 -0000 1.4.2.1
@@ -110,6 +110,11 @@ sysio_sym_weak_alias(_sysio_lseek, lseek
extern off_t
lseek(int fd, off_t offset, int whence)
{
+ off_t rc;
+ SYSIO_ENTER;
- return (off_t )_sysio_lseek(fd, offset, whence);
+ rc = (off_t )_sysio_lseek(fd, offset, whence);
+
+ SYSIO_LEAVE;
+ return rc;
}
Index: mkdir.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -b -B -p -r1.3 -r1.3.4.1
--- mkdir.c 24 Mar 2003 22:09:06 -0000 1.3
+++ mkdir.c 29 Jun 2003 10:15:32 -0000 1.3.4.1
@@ -58,6 +58,7 @@ mkdir(const char *path, mode_t mode)
int err;
struct intent intent;
struct pnode *pno;
+ SYSIO_ENTER;
INTENT_INIT(&intent, INT_CREAT, &mode, NULL);
err = _sysio_namei(_sysio_cwd, path, ND_NEGOK, &intent, &pno);
@@ -80,5 +81,7 @@ out:
errno = -err;
err = -1;
}
+
+ SYSIO_LEAVE;
return err;
}
Index: mknod.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -b -B -p -r1.3 -r1.3.4.1
--- mknod.c 26 Mar 2003 00:06:05 -0000 1.3
+++ mknod.c 29 Jun 2003 10:15:32 -0000 1.3.4.1
@@ -110,8 +110,13 @@ out:
static int
__mknod(const char *path, mode_t mode, dev_t dev)
{
+ int rc;
+ SYSIO_ENTER;
- return __xmknod(_MKNOD_VER, path, mode, &dev);
+ rc = __xmknod(_MKNOD_VER, path, mode, &dev);
+
+ SYSIO_LEAVE;
+ return rc;
}
sysio_sym_weak_alias(__mknod, mknod)
Index: open.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/open.c,v
retrieving revision 1.7.2.1
retrieving revision 1.7.2.2
diff -u -w -b -B -p -r1.7.2.1 -r1.7.2.2
--- open.c 17 May 2003 11:59:56 -0000 1.7.2.1
+++ open.c 29 Jun 2003 10:15:32 -0000 1.7.2.2
@@ -125,6 +125,7 @@ open(const char *path, int flags, ...)
int err;
struct pnode *pno;
struct file *fil;
+ SYSIO_ENTER;
/*
* Get mode argument and determine parameters for namei
@@ -187,6 +188,7 @@ open(const char *path, int flags, ...)
P_RELE(pno);
+ SYSIO_LEAVE;
return err;
error:
@@ -195,6 +197,7 @@ error:
if (pno)
P_RELE(pno);
errno = -err;
+ SYSIO_LEAVE;
return -1;
}
@@ -202,10 +205,12 @@ int
close(int fd)
{
int err;
+ SYSIO_ENTER;
err = _sysio_fd_close(fd);
if (err)
errno = -err;
+ SYSIO_LEAVE;
return err ? -1 : 0;
}
Index: read.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/read.c,v
retrieving revision 1.2.8.2
retrieving revision 1.2.8.3
diff -u -w -b -B -p -r1.2.8.2 -r1.2.8.3
--- read.c 19 Jun 2003 12:18:29 -0000 1.2.8.2
+++ read.c 29 Jun 2003 10:15:32 -0000 1.2.8.3
@@ -101,13 +101,19 @@ ipreadv(int fd, const struct iovec *iov,
{
struct file *fil;
struct ioctx *ioctxp;
- int i;
+ ioid_t rc;
+ SYSIO_ENTER;
fil = _sysio_fd_find(fd);
- if (!fil)
- return __bypass_preadv(fd, iov, count, offset);
+ if (!fil) {
+ rc = __bypass_preadv(fd, iov, count, offset);
+ SYSIO_LEAVE;
+ return rc;
+ }
ioctxp = do_ipreadv(fil, iov, count, offset);
+
+ SYSIO_LEAVE;
return ioctxp ? ioctxp->ioctx_id : IOID_FAIL;
}
@@ -162,15 +168,20 @@ ireadv(int fd, const struct iovec *iov,
{
struct file *fil;
struct ioctx *ioctxp;
+ ioid_t rc;
+ SYSIO_ENTER;
fil = _sysio_fd_find(fd);
- if (!fil)
- return __bypass_ireadv(fd, iov, count);
+ if (!fil) {
+ rc = __bypass_ireadv(fd, iov, count);
+ SYSIO_LEAVE;
+ return rc;
+ }
ioctxp = do_ipreadv(fil, iov, count, fil->f_pos);
- if (!ioctxp)
- return IOID_FAIL;
- return ioctxp->ioctx_id;
+
+ SYSIO_LEAVE;
+ return ioctxp ? ioctxp->ioctx_id : IOID_FAIL;
}
/*
Index: rmdir.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -b -B -p -r1.3 -r1.3.4.1
--- rmdir.c 24 Mar 2003 22:09:06 -0000 1.3
+++ rmdir.c 29 Jun 2003 10:15:32 -0000 1.3.4.1
@@ -58,6 +58,7 @@ rmdir(const char *path)
struct intent intent;
int err;
struct pnode *pno;
+ SYSIO_ENTER;
INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL);
err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno);
@@ -75,5 +76,6 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: stat.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -b -B -p -r1.3 -r1.3.4.1
--- stat.c 24 Mar 2003 22:09:07 -0000 1.3
+++ stat.c 29 Jun 2003 10:15:32 -0000 1.3.4.1
@@ -98,8 +98,13 @@ out:
static int
__fstat(int fd, struct stat *buf)
{
+ int rc;
+ SYSIO_ENTER;
- return __fxstat(_STAT_VER, fd, buf);
+ rc = __fxstat(_STAT_VER, fd, buf);
+
+ SYSIO_LEAVE;
+ return rc;
}
sysio_sym_weak_alias(__fstat, fstat)
@@ -138,8 +143,13 @@ out:
int
__stat(const char *filename, struct stat *buf)
{
+ int rc;
+ SYSIO_ENTER;
+
+ rc = __xstat(_STAT_VER, filename, buf);
- return __xstat(_STAT_VER, filename, buf);
+ SYSIO_LEAVE;
+ return rc;
}
sysio_sym_weak_alias(__stat, stat)
@@ -178,8 +188,13 @@ out:
static int
__lstat(const char *filename, struct stat *buf)
{
+ int rc;
+ SYSIO_ENTER;
+
+ rc = __lxstat(_STAT_VER, filename, buf);
- return __lxstat(_STAT_VER, filename, buf);
+ SYSIO_LEAVE;
+ return rc;
}
sysio_sym_weak_alias(__lstat, lstat)
Index: stat64.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/stat64.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -b -B -p -r1.3 -r1.3.4.1
--- stat64.c 24 Mar 2003 22:09:07 -0000 1.3
+++ stat64.c 29 Jun 2003 10:15:32 -0000 1.3.4.1
@@ -89,8 +89,13 @@ out:
int
fstat64(int fd, struct stat64 *buf)
{
+ int rc;
+ SYSIO_ENTER;
- return __fxstat64(_STAT_VER, fd, buf);
+ rc = __fxstat64(_STAT_VER, fd, buf);
+
+ SYSIO_LEAVE;
+ return rc;
}
int
@@ -125,8 +130,13 @@ out:
int
stat64(const char *filename, struct stat64 *buf)
{
+ int rc;
+ SYSIO_ENTER;
+
+ rc = __xstat64(_STAT_VER, filename, buf);
- return __xstat64(_STAT_VER, filename, buf);
+ SYSIO_LEAVE;
+ return rc;
}
int
@@ -161,6 +171,11 @@ out:
int
lstat64(const char *filename, struct stat64 *buf)
{
+ int rc;
+ SYSIO_ENTER;
+
+ rc = __lxstat64(_STAT_VER, filename, buf);
- return __lxstat64(_STAT_VER, filename, buf);
+ SYSIO_LEAVE;
+ return rc;
}
Index: statvfs.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -b -B -p -r1.3 -r1.3.4.1
--- statvfs.c 24 Mar 2003 22:09:07 -0000 1.3
+++ statvfs.c 29 Jun 2003 10:15:32 -0000 1.3.4.1
@@ -84,6 +84,7 @@ statvfs(const char *path, struct statvfs
struct intnl_statvfs _call_buffer;
struct intnl_statvfs *_call_buf = &_call_buffer;
#endif
+ SYSIO_ENTER;
err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno);
if (err)
@@ -101,6 +102,7 @@ err:
errno = -err;
err = -1;
out:
+ SYSIO_LEAVE;
return err;
}
@@ -115,6 +117,7 @@ fstatvfs(int fd, struct statvfs *buf)
struct intnl_statvfs _call_buffer;
struct intnl_statvfs *_call_buf = &_call_buffer;
#endif
+ SYSIO_ENTER;
err = 0;
filp = _sysio_fd_find(fd);
@@ -134,5 +137,6 @@ err:
errno = -err;
err = -1;
out:
+ SYSIO_LEAVE;
return err;
}
Index: statvfs64.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -b -B -p -r1.3 -r1.3.4.1
--- statvfs64.c 24 Mar 2003 22:09:07 -0000 1.3
+++ statvfs64.c 29 Jun 2003 10:15:32 -0000 1.3.4.1
@@ -57,6 +57,7 @@ statvfs64(const char *path, struct statv
{
int err;
struct pnode *pno;
+ SYSIO_ENTER;
err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno);
if (err)
@@ -69,6 +70,8 @@ out:
errno = -err;
err = -1;
}
+
+ SYSIO_LEAVE;
return err;
}
@@ -77,6 +80,7 @@ fstatvfs(int fd, struct statvfs64 *buf)
{
int err;
struct file *filp;
+ SYSIO_ENTER;
err = 0;
filp = _sysio_fd_find(fd);
@@ -91,5 +95,7 @@ out:
errno = -err;
err = -1;
}
+
+ SYSIO_LEAVE;
return err;
}
Index: symlink.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -b -B -p -r1.3 -r1.3.4.1
--- symlink.c 24 Mar 2003 22:09:07 -0000 1.3
+++ symlink.c 29 Jun 2003 10:15:32 -0000 1.3.4.1
@@ -58,6 +58,7 @@ symlink(const char *oldpath, const char
int err;
struct intent intent;
struct pnode *pno;
+ SYSIO_ENTER;
INTENT_INIT(&intent, INT_CREAT, NULL, NULL);
err = _sysio_namei(_sysio_cwd, newpath, ND_NEGOK, &intent, &pno);
@@ -81,5 +82,6 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: truncate.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -b -B -p -r1.3 -r1.3.4.1
--- truncate.c 24 Mar 2003 22:09:07 -0000 1.3
+++ truncate.c 29 Jun 2003 10:15:32 -0000 1.3.4.1
@@ -80,6 +80,7 @@ truncate(const char *path, off_t length)
{
int err;
struct pnode *pno;
+ SYSIO_ENTER;
err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno);
if (err)
@@ -92,6 +93,7 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
@@ -100,6 +102,7 @@ ftruncate(int fd, off_t length)
{
int err;
struct file *fil;
+ SYSIO_ENTER;
err = 0;
fil = _sysio_fd_find(fd);
@@ -113,5 +116,6 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: unlink.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v
retrieving revision 1.3.4.1
retrieving revision 1.3.4.2
diff -u -w -b -B -p -r1.3.4.1 -r1.3.4.2
--- unlink.c 29 Jun 2003 07:56:47 -0000 1.3.4.1
+++ unlink.c 29 Jun 2003 10:15:32 -0000 1.3.4.2
@@ -58,6 +58,7 @@ unlink(const char *path)
struct intent intent;
int err;
struct pnode *pno;
+ SYSIO_ENTER;
INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL);
err = _sysio_namei(_sysio_cwd, path, ND_NOFOLLOW, &intent, &pno);
@@ -75,5 +76,6 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: write.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/write.c,v
retrieving revision 1.2.10.2
retrieving revision 1.2.10.3
diff -u -w -b -B -p -r1.2.10.2 -r1.2.10.3
--- write.c 19 Jun 2003 12:18:29 -0000 1.2.10.2
+++ write.c 29 Jun 2003 10:15:32 -0000 1.2.10.3
@@ -107,12 +107,19 @@ ipwritev(int fd, const struct iovec *iov
{
struct file *fil;
struct ioctx *ioctxp;
+ ioid_t rc;
+ SYSIO_ENTER;
fil = _sysio_fd_find(fd);
- if (!fil)
- return __bypass_pwritev(fd, iov, count, offset);
+ if (!fil) {
+ rc = __bypass_pwritev(fd, iov, count, offset);
+ SYSIO_LEAVE;
+ return rc;
+ }
ioctxp = do_ipwritev(fil, iov, count, offset);
+
+ SYSIO_LEAVE;
return ioctxp ? ioctxp->ioctx_id : IOID_FAIL;
}
@@ -166,15 +173,20 @@ iwritev(int fd, const struct iovec *iov,
{
struct file *fil;
struct ioctx *ioctxp;
+ ioid_t rc;
+ SYSIO_ENTER;
fil = _sysio_fd_find(fd);
- if (!fil)
- return __bypass_iwritev(fd, iov, count);
+ if (!fil) {
+ rc = __bypass_iwritev(fd, iov, count);
+ SYSIO_LEAVE;
+ return rc;
+ }
ioctxp = do_ipwritev(fil, iov, count, fil->f_pos);
- if (!ioctxp)
- return IOID_FAIL;
- return ioctxp->ioctx_id;
+
+ SYSIO_LEAVE;
+ return ioctxp ? ioctxp->ioctx_id : IOID_FAIL;
}
/*
|