Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 May 2010 17:07:16 +0200
From:      Gary Jennejohn <gljennjohn@googlemail.com>
To:        Dima Naumov <shadow_user@rambler.ru>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: FS to physical disk block conversion
Message-ID:  <20100526170716.11f24c4a@ernst.jennejohn.org>
In-Reply-To: <4BFD8E12.9040909@rambler.ru>
References:  <4BFD8E12.9040909@rambler.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 26 May 2010 21:09:38 +0000
Dima Naumov <shadow_user@rambler.ru> wrote:

> 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!
> 

See /usr/src/sbin/dump/traverse.c:getino() for how to do it.

--
Gary Jennejohn



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