[Libsysio-commit] cplant: libsysio/drivers/yod fs_yod.c
Brought to you by:
lward
From: Ruth K. <rk...@us...> - 2003-08-01 19:09:17
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1:/tmp/cvs-serv19210 Modified Files: Tag: cplant fs_yod.c Log Message: changes to i_invalid fn as in native driver Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/Attic/fs_yod.c,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -w -b -B -p -r1.1.2.6 -r1.1.2.7 --- fs_yod.c 24 Jul 2003 22:52:57 -0000 1.1.2.6 +++ fs_yod.c 1 Aug 2003 19:09:15 -0000 1.1.2.7 @@ -284,7 +284,6 @@ yod_i_new(struct filesys *fs, struct int nino = malloc(sizeof(struct yod_inode)); if (!nino) return NULL; - bzero(&nino->ni_ident, sizeof(nino->ni_ident)); nino->ni_ident.dev = buf->st_dev; nino->ni_ident.ino = buf->st_ino; #ifdef HAVE_GENERATION @@ -474,25 +473,25 @@ yod_fsswop_mount(const char *source, return err; } +static int +yod_i_invalid(struct inode *inop, struct intnl_stat stbuf) +{ /* * Validate passed in inode against stat struct info */ -static int -yod_i_validate(struct inode *inop, struct intnl_stat stbuf) -{ struct yod_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; } /* @@ -524,7 +523,7 @@ yod_iget(struct filesys *fs, * Validate? */ if (*inop) { - if (!yod_i_validate(*inop, stbuf)) + if (!yod_i_invalid(*inop, stbuf)) return 0; /* * Invalidate. @@ -535,7 +534,6 @@ yod_iget(struct filesys *fs, /* * I-node is not already known. Find or create it. */ - bzero(&ident, sizeof(ident)); ident.dev = stbuf.st_dev; ident.ino = stbuf.st_ino; #ifdef HAVE_GENERATION @@ -548,7 +546,7 @@ yod_iget(struct filesys *fs, /* * Insertion was forced but it's already present! */ - if (yod_i_validate(ino, stbuf)) { + if (yod_i_invalid(ino, stbuf)) { /* * Cached inode has stale attrs * make way for the new one |