[Libsysio-commit] HEAD: libsysio/drivers/native fs_native.c
Brought to you by:
lward
|
From: Ruth K. <rk...@us...> - 2003-08-01 18:05:10
|
Update of /cvsroot/libsysio/libsysio/drivers/native
In directory sc8-pr-cvs1:/tmp/cvs-serv2804
Modified Files:
fs_native.c
Log Message:
fixed mode check, rename so the if's make sense
Index: fs_native.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -b -B -p -r1.13 -r1.14
--- fs_native.c 29 Jul 2003 18:29:32 -0000 1.13
+++ fs_native.c 1 Aug 2003 18:05:07 -0000 1.14
@@ -504,24 +504,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;
}
/*
@@ -553,7 +553,7 @@ native_iget(struct filesys *fs,
* Validate?
*/
if (*inop) {
- if (!native_i_validate(*inop, stbuf))
+ if (!native_i_invalid(*inop, stbuf))
return 0;
/*
* Invalidate.
@@ -577,7 +577,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
@@ -1006,7 +1006,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)
|