> I was learning writing basic filesystem step by step-- till now what i > wrote just mounts . > Now > can someone help me to clarify the difference between > > 1)blocksize we give when we do 'dd if=/dev/zero of=nnn bs=4096 count=10 > ans: in my view -- just to define size of file 4096 *10 > > 2)block size we give wen we do ./mkmyfs nnn 4096 > ans while writing -- filesystem information -- to file -- this block size > is used > > 3)block size we have as > #define MYFS_DEFAULT_BS which we set as sb->s_blocksize-- in fill_super > function -- before doing sb_bread of disk super block > while mounting -- while reading filesystem info from the file-- this > blocksize is used > > 4)in testfs --- sb_min_blocksize() was used --- before sb_bread in fill > super -- > wherein minimum of the two > 'MYFS_DEFAULT_BS' and bdev_hardsect_size(sb->s_bdev) > is set as sb->s_blocksize > what is bdev_hardsect_size ?? > what's d logic behind using minimum of these two Please CMIIW > > On Wed, Sep 2, 2009 at 4:11 PM, SandeepKsinha <[email protected]>wrote: > >> NIdhi, >> >> >> On Wed, Sep 2, 2009 at 2:45 PM, nidhi mittal >> hada<[email protected]> wrote: >> > >> > Hi All >> > "I am writing for learning purpose a basic filesystem that just mounts >> > loads super block and root inode from disk." >> > >> > Now i am facing a problem >> > when i do >> > >> > mount -t myfs2 utils/nnn /mnt -o loop ----- it stucks here .... >> > >> > then doing >> > ps -ax | grep -i mount shows the mount script is in RL state >> > where R - is in run queue >> > L -- pages locked in memory >> > >> > >> > and i found by using printks that >> > when i read disk inode block through sb_bread(sb,MYFS_INODE_BLOCK) >> > then it happens....and sb_bread doesnt return back . >> > >> > point to be noted is in my code snippet >> > just before reading inode block i read super block -- it works perfectly >> but >> > -- >> > as i read inode block it stucks ... >> > >> > /***************************** >> > >> > if(!(bh=(struct buffer_head *)sb_bread(sb,MYFS_SUPER_ >> > BLOCK))) >> > { >> > printk(KERN_ALERT"Cannot read superblock of MYFS \n"); >> > goto free; >> > } >> > >> > >> > printk(KERN_ALERT"i m going to read disk inode in block number >> > %d",MYFS_INODE_BLOCK); >> > /* IT Prints this message and stucks somewhere inside sb_bread*/ >> > if(!(bi=(struct buffer_head *)sb_bread(sb,MYFS_INODE_BLOCK))) >> > { >> > printk(KERN_ALERT"Cannot read inode clock of MYFS \n"); >> > goto free; >> > } >> > >> > >> > >> > ****************************/ >> > i have tested through many ways -- in userspace it shows that inode was >> > written perfectly ... >> > what can be this thing? >> > i checked all parameters of sb -- bdev,blocksize,blocknumber okay before >> > sb_bread >> > >> >> Can you provide the complete sources, so that it becomes easier to >> understand the problem? >> Also, I would suggest your to list out the problems in points. >> >> > >> > any help will be obliging !! >> > >> >> >> >> -- >> Regards, >> Sandeep. >> >> >> >> >> >> >> “To learn is to change. Education is a process that changes the learner.” >> > > > > -- > Thanks & Regards > Nidhi Mittal Hada >
-- Thanks & Regards Nidhi Mittal Hada
