Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 May 2010 21:09:38 +0000
From:      Dima Naumov <shadow_user@rambler.ru>
To:        freebsd-fs@freebsd.org
Subject:   FS to physical disk block conversion
Message-ID:  <4BFD8E12.9040909@rambler.ru>

next in thread | raw e-mail | index | archive | help
I am sorry for my English. OK my problem: i do not understand how i can 
get real address of disk block, when i use macros fsbtodb() to convert 
fs address to physical disk block address i receive odd result, explain 
me please where my error.
Example:
         struct fs *sblock;
         ino_t inode = 2;
         caddr_t inoblock;
         struct ufs2_dinode * ino;
         ...
         if(pread(dev_fd, ino, sizeof(struct ufs2_dinode),\
                 (sblock->fs_bsize * fsbtodb(sblock, \
                 ino_to_fsba(sblock, inode)))) != sizeof(struct 
ufs2_dinode))
                                 error(__LINE__, errno);
After executing this string a not get correct inode in "ino". Please 
explain, it important to me!




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BFD8E12.9040909>