[Libsysio-commit] HEAD: libsysio/src mount.c
Brought to you by:
lward
From: jaschut <ja...@us...> - 2003-10-27 23:49:49
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv20287 Modified Files: mount.c Log Message: In _sysio_do_mount(), change the inop_getattr() call to _sysio_p_validate(), since the latter should be checking the inode mode bits, and is potentially cheaper. Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- mount.c 13 Oct 2003 01:04:35 -0000 1.8 +++ mount.c 27 Oct 2003 23:49:10 -0000 1.9 @@ -102,8 +102,6 @@ _sysio_do_mount(struct filesys *fs, { struct mount *mnt; int err; - struct intnl_stat stbuf; - struct inode *ino; /* * It's really poor form to allow the new root to be a @@ -148,14 +146,15 @@ _sysio_do_mount(struct filesys *fs, err = -ENOMEM; goto error; } - ino = mnt->mnt_root->p_base->pb_ino; - err = ino->i_ops.inop_getattr(mnt->mnt_root, ino, &stbuf); - if (err) - goto error; /* - * Begtter be a directory object! + * It may have been a while since the root inode was validated; + * better validate again. And it better be a directory! */ - if (!S_ISDIR(stbuf.st_mode)) { + err = _sysio_p_validate(mnt->mnt_root, NULL, NULL); + if (err) + goto error; + + if (!S_ISDIR(mnt->mnt_root->p_base->pb_ino->i_mode)) { err = -ENOTDIR; goto error; } |