[Libsysio-commit] cplant: libsysio/drivers/native fs_native.c
Brought to you by:
lward
From: Ruth K. <rk...@us...> - 2003-08-01 18:49:15
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1:/tmp/cvs-serv15671 Modified Files: Tag: cplant fs_native.c Log Message: merge head changes into cplant branch Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.8.2.5 retrieving revision 1.8.2.6 diff -u -w -b -B -p -r1.8.2.5 -r1.8.2.6 --- fs_native.c 24 Jul 2003 22:52:57 -0000 1.8.2.5 +++ fs_native.c 1 Aug 2003 18:49:11 -0000 1.8.2.6 @@ -516,24 +516,24 @@ native_fsswop_mount(const char *source, } static int -native_i_validate(struct inode *inop, struct intnl_stat stbuf) +native_i_invalid(struct inode *inop, struct intnl_stat stbuf) { /* * Validate passed in inode against stat struct info */ struct native_inode *nino = I2NI(inop); - if ((nino->ni_ident.dev == stbuf.st_dev && - nino->ni_ident.ino == stbuf.st_ino && + if ((nino->ni_ident.dev != stbuf.st_dev || + nino->ni_ident.ino != stbuf.st_ino || #ifdef HAVE_GENERATION - nino->ni_ident.gen == stbuf.st_gen && + nino->ni_ident.gen != stbuf.st_gen || #endif - ((inop)->i_mode & stbuf.st_mode) == (inop)->i_mode) && - ((!(S_ISCHR((inop)->i_mode) || S_ISBLK((inop)->i_mode)) || - (inop)->i_rdev == stbuf.st_rdev))) - return 0; - + ((inop)->i_mode & S_IFMT) != (stbuf.st_mode & S_IFMT)) || + (((inop)->i_rdev != stbuf.st_rdev) && + (S_ISCHR((inop)->i_mode) || S_ISBLK((inop)->i_mode)))) return 1; + + return 0; } /* @@ -565,7 +565,7 @@ native_iget(struct filesys *fs, * Validate? */ if (*inop) { - if (!native_i_validate(*inop, stbuf)) + if (!native_i_invalid(*inop, stbuf)) return 0; /* * Invalidate. @@ -589,7 +589,7 @@ native_iget(struct filesys *fs, /* * Insertion was forced but it's already present! */ - if (native_i_validate(ino, stbuf)) { + if (native_i_invalid(ino, stbuf)) { /* * Cached inode has stale attrs * make way for the new one @@ -1017,7 +1017,7 @@ static int native_inop_unlink(struct pnode *pno) { char *path; - int err; + int err = 0; path = _sysio_pb_path(pno->p_base, '/'); if (!path) @@ -1035,7 +1035,8 @@ native_inop_unlink(struct pnode *pno) * (usually .NFSXXXXXX, where the X's are replaced by the PID and some * unique characters) in order to simulate the proper semantic. */ - err = syscall(SYS_unlink, path); + if (!syscall(SYS_unlink, path)) + err = -errno; free(path); return err; } |