Re: [Jfs4bsd-devel] Draft version of jfs_mount for review and addition
Status: Alpha
Brought to you by:
h_pandya
|
From: Sergey L. <de...@as...> - 2002-06-24 08:17:40
|
On Sun, Jun 23, 2002 at 06:53:46PM -0700, Hiten Pandya wrote: > Hi all. > > I have made this little version of my jfs_mount() function, which is based > on the HPFS_mountfs() framework, but none of the original code remains. The > URL for the patch->/dev/null is available at: > > http://www.pittgoth.com/~hiten/jfs/jfs_nmount.patch > > Basically, it is a merge of the jfs_mount() from OS/2 codebase, and the > jfs_mount() from the Linux codebase. I have taken the bits which I found > useful and merged them together. Hi Hiten, few comments about the patch. line 187: you're calling chkSuper, but superblock has not being read into memory yet, and mout structure has not being alloc-ed. i suggest to move lines starting from 253 (device checking and allocating mount struct) to the beginning of the function. then, you have to alloc the space for the superblock. I've done that when allocing mount struct : line 286, MALLOC(jmp, struct jfsmount *, sizeof(struct jfsmount) + sizeof(struct jfs_superblock), M_JFSMNT, M_WAITOK | M_ZERO); jmp->sbp = (struct jfs_superblock *) ((char *) jmp + sizeof(struct jfsmount)) then, before suberblock sanity checking, when devvp is open, read the superblock into memory, something like struct buf *bp = NULL; bread(devvp, SUPER1_B, DEV_BSIZE, NOCRED, &bp); bcopy(jmp->sbp, bp->b_data, sizeof(struct jfs_superblock)); we allocate 3 inodes during mount: aggregate 'self' inode (jmp->ipaimap), filesystem 'self' inode (jmp->ipimap), and block allocation map inode (jmp->ipbmap). i think the comment in jfsmoun.h about ipimap inode, should be changed. it is the 'filesystem' imap inode, not an aggregate one. regards, Sergey |