# HG changeset patch # User menikon # Date 1580800296 -32400 # Node ID b40deb55b7db011ddf8588ff8ae063e7eb416d30 # Parent f26b3dcbc6db6a60f4b40a170554debd58b43fb0 build success diff -r f26b3dcbc6db -r b40deb55b7db src/gearsTools/lib/Gears/Context/Template/XV6.pm --- a/src/gearsTools/lib/Gears/Context/Template/XV6.pm Mon Feb 03 15:41:24 2020 +0900 +++ b/src/gearsTools/lib/Gears/Context/Template/XV6.pm Tue Feb 04 16:11:36 2020 +0900 @@ -168,6 +168,7 @@ typedef struct superblock superblock; typedef struct buf buf; typedef struct dinode dinode; +typedef struct dirent dirent; EOFEOF print $out $str; } diff -r f26b3dcbc6db -r b40deb55b7db src/impl/fs_impl.cbc --- a/src/impl/fs_impl.cbc Mon Feb 03 15:41:24 2020 +0900 +++ b/src/impl/fs_impl.cbc Tue Feb 04 16:11:36 2020 +0900 @@ -172,9 +172,13 @@ goto next(strncmp_val, ...); } -__code dirlookupfs_impl(struct inode* dp, char* name, uint* poff, __code next(...)) { - - goto next(...); +__code dirlookupfs_impl(struct fs_impl* fs, struct inode* dp, char* name, uint* poff, dirent* de, __code next(...)) { //:skip + if (dp->type != T_DIR) { + /* + panic("dirlookup not DIR"); + */ + } + goto dirlookup_loopcheck(fs, dp, name, poff, de, next(...)); } __code dirlinkfs_impl(struct fs_impl* fs, struct inode* dp, char* name, uint inum, __code next(...)) { diff -r f26b3dcbc6db -r b40deb55b7db src/impl/fs_impl.h --- a/src/impl/fs_impl.h Mon Feb 03 15:41:24 2020 +0900 +++ b/src/impl/fs_impl.h Tue Feb 04 16:11:36 2020 +0900 @@ -7,15 +7,20 @@ struct dinode* dip; int inum; int iget_val; + struct inode* dp; + char* name; + uint* poff; + dirent* de; - __code allocinode(struct fs_impl* fs_impl, uint dev, short type, __code next(int iget_val, ...)); - __code allocinode_loop(struct fs_impl* fs_impl, int inum, uint dev, struct superblock* sb, struct buf* bp, struct dinode* dip, __code next(int iget_val, ...)); + __code allocinode(Type* fs_impl, uint dev, short type, __code next(int iget_val, ...)); + __code allocinode_loop(Type* fs_impl, int inum, uint dev, struct superblock* sb, struct buf* bp, struct dinode* dip, __code next(int iget_val, ...)); __code allocinode_loopcheck(Type* fs_impl, int inum, uint dev, struct superblock* sb, struct buf* bp, struct dinode* dip, __code next(int iget_val, ...)); - __code allocinode_noloop(struct fs_impl* fs_impl, int inum, uint dev, struct superblock* sb, struct buf* bp, struct dinode* dip, __code next(int iget_val, ...)); + __code allocinode_noloop(Type* fs_impl, int inum, uint dev, struct superblock* sb, struct buf* bp, struct dinode* dip, __code next(int iget_val, ...)); __code lockinode1(Type* fs_impl, struct inode *ip, struct buf *bp, struct dinode *dip, __code next(...)); - __code lockinode2(struct fs_impl* fs_impl, struct inode* ip, struct buf* bp, struct dinode* dip, __code next(...)); - __code lockinode_sleepcheck(struct fs_impl* fs_impl, struct inode* ip, __code next(...)); - __code iput_check(struct fs_impl* fs_impl, struct inode* ip, __code next(...)); - __code iput_inode_nolink(struct fs_impl* fs_impl, struct inode* ip, __code next(...)); + __code lockinode2(Type* fs_impl, struct inode* ip, struct buf* bp, struct dinode* dip, __code next(...)); + __code lockinode_sleepcheck(Type* fs_impl, struct inode* ip, __code next(...)); + __code iput_check(Type* fs_impl, struct inode* ip, __code next(...)); + __code iput_inode_nolink(Type* fs_impl, struct inode* ip, __code next(...)); + __code dirlookup_loopcheck(Type* fs_impl, struct inode* dp, char* name, uint* poff, dirent* de, next(...)); __code next(...); } fs_impl; diff -r f26b3dcbc6db -r b40deb55b7db src/impl/fs_impl_private.cbc --- a/src/impl/fs_impl_private.cbc Mon Feb 03 15:41:24 2020 +0900 +++ b/src/impl/fs_impl_private.cbc Tue Feb 04 16:11:36 2020 +0900 @@ -234,5 +234,7 @@ wakeup(ip); goto next(...); } - - +typedef struct dirent dirent; +__code dirlookup_loopcheck(struct fs_impl* fs_impl, struct inode* dp, char* name, uint* poff, dirent* de, __code next(...)){ //:skip + goto next(...); +} diff -r f26b3dcbc6db -r b40deb55b7db src/interface/fs.dg --- a/src/interface/fs.dg Mon Feb 03 15:41:24 2020 +0900 +++ b/src/interface/fs.dg Tue Feb 04 16:11:36 2020 +0900 @@ -18,6 +18,7 @@ char* src; int namex_val; int strncmp_val; + dirent* de; __code readsb(Impl* fs, uint dev, struct superblock* sb, __code next(...)); __code iinit(Impl* fs, __code next(...)); @@ -32,7 +33,7 @@ __code readi(Impl* fs, struct inode* ip, char* dst, uint off, uint n, __code next(...)); __code writei(Impl* fs, struct inode* ip, char* src, uint off, uint n, __code next(...)); __code namecmp(Impl* fs, const char* s, const char* t, __code next(int strncmp_val, ...)); - __code dirlookup(struct inode* dp, char* name, uint* poff, __code next(...)); + __code dirlookup(struct inode* dp, char* name, uint* poff, dirent* de, __code next(...)); __code dirlink(Impl* fs, struct inode* dp, char* name, uint inum, __code next(...)); __code namei(Impl* fs, char* path, __code next(int namex_val, ...)); __code nameiparent(Impl* fs, char* path, char* name, __code next(int namex_val, ...));