From owner-freebsd-current@FreeBSD.ORG Thu Jan 17 15:12:57 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6F7516A417 for ; Thu, 17 Jan 2008 15:12:57 +0000 (UTC) (envelope-from urbansnap@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.224]) by mx1.freebsd.org (Postfix) with ESMTP id 896AF13C4EC for ; Thu, 17 Jan 2008 15:12:57 +0000 (UTC) (envelope-from urbansnap@gmail.com) Received: by wx-out-0506.google.com with SMTP id i29so389978wxd.7 for ; Thu, 17 Jan 2008 07:12:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:content-type:mime-version:subject:date:x-mailer; bh=7bSaJlDbxPjds3ubs0jFWctx2a1zXJuh7pXuuVFx140=; b=xKzyxjI/Al90wFKn9hvUPCF9+sn+YbciRbR+7VYLHRTpDcfm70hekbby42ZsYJD1B8VtDUyW1xS+A77KFSw5wYch/OJsJ0y1TJBUOoEPdA3zWkekAUvOkoECn/6YWTnqYefvn0RHcfqohvnG8PehdWe/w5N600KF7lg1tQ6YhSQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:mime-version:subject:date:x-mailer; b=KljhvJAchHelOD5D0UQNGqWvhNl9u993K66HmzFoeBSNEp/0U3SO1eNEq3egGX01y6r4fS6RpfiL7QUVgzl8JuUV3RfFbfAcoYmpIEQcyAUXVSyYaFX9ODcnCNX273Yzqv1OHuA9oppuUK5JiSq9k+X5yStj19Lg7/rY89CsqEQ= Received: by 10.142.158.17 with SMTP id g17mr1221410wfe.234.1200581162831; Thu, 17 Jan 2008 06:46:02 -0800 (PST) Received: from ?192.168.1.200? ( [24.218.111.132]) by mx.google.com with ESMTPS id h39sm7247746wxd.14.2008.01.17.06.46.01 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Jan 2008 06:46:02 -0800 (PST) Message-Id: <485228D5-8D0B-4CD5-9FB7-B0D551B172DA@gmail.com> From: Adam To: freebsd-current@freebsd.org Mime-Version: 1.0 (Apple Message framework v915) Date: Thu, 17 Jan 2008 09:46:00 -0500 X-Mailer: Apple Mail (2.915) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Reading and Writing to Block from di_spare X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jan 2008 15:12:57 -0000 Hi, I am working on a project for where I want to take the standard UFS/FFS file system that BSD ships with and add several blocks of information to the dinode. The simplest way of doing it seemed to be to allocate blocks to di_spare. I believe that I have figured out how to do that: ffs_alloc(inode, 0 , 0, (int)(inode->i_fs->fs_bsize), td->td_ucred, &addr); dinode->di_spare[1]=(int64_t)addr; I'm having problems taking that block address and reading/writing to it. As far as I can tell most of the buffer read routines (getblk, bread) seem to be geared toward reading and writing direct and indirect blocks in an inode. How do I read and write a block that is neither a direct nor an indirect block? I apologize in advance if this is has been posted before. I have spent a considerable amount of time searching past posts for the solution. Thanks, Adam