From owner-freebsd-fs@FreeBSD.ORG Wed May 26 14:27:08 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EBB1106566C for ; Wed, 26 May 2010 14:27:08 +0000 (UTC) (envelope-from shadow_user@rambler.ru) Received: from mxb.rambler.ru (mxb.rambler.ru [81.19.66.30]) by mx1.freebsd.org (Postfix) with ESMTP id EE3B78FC15 for ; Wed, 26 May 2010 14:27:07 +0000 (UTC) Received: from maild.rambler.ru (maild.rambler.ru [81.19.66.33]) by mxb.rambler.ru (Postfix) with ESMTP id A927B1BBF77 for ; Wed, 26 May 2010 18:09:52 +0400 (MSD) Received: from [188.186.250.247] (unknown [188.186.250.247]) (Authenticated sender: shadow_user@rambler.ru) by maild.rambler.ru (Postfix) with ESMTP id 809AA84414 for ; Wed, 26 May 2010 18:09:50 +0400 (MSD) Message-ID: <4BFD8E12.9040909@rambler.ru> Date: Wed, 26 May 2010 21:09:38 +0000 From: Dima Naumov User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100524 Thunderbird/3.0.4 MIME-Version: 1.0 To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: FS to physical disk block conversion X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 14:27:08 -0000 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!