From owner-freebsd-current@FreeBSD.ORG Thu Jan 17 20:08:44 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 12E9E16A418 for ; Thu, 17 Jan 2008 20:08:44 +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 65E8413C457 for ; Thu, 17 Jan 2008 20:08:42 +0000 (UTC) (envelope-from urbansnap@gmail.com) Received: by wx-out-0506.google.com with SMTP id i29so492579wxd.7 for ; Thu, 17 Jan 2008 12:08:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=5qYKH3UvCm2Dh+N8YuIr5Anowb+bQ71yhyC/m78A9MI=; b=vmDbOXqhEdyxLQDLrMM/p6D6ZhCtLsPn8QrxhDwgXQU2nCWBuX3w/K0YTh/jbyfDj17S/kQTmD5hBrAUerDHI2mb2cSZLyWKNvqtm3Naz3hObyfm9/XKAbwnmlwf2/SMPxDVuhj7LWWalQnw0lLikzOwh3B7LekmkQR0ZIf3phQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; b=tKqa5bsWIajpT3ED0gEkFj8efVY1aWC1tOVnAWV1hT6H/ETGElmeSeJc4VgNX7da9v8n8helDN1NqjUA6dm1jDB9B2EefafiOT2lni6DZpuBmA2LanSpEt3JzqUMlv7ZcpPj3sEPZPU2WOzQALC7r195bxvu485/h2pZgd9BNOI= Received: by 10.142.106.18 with SMTP id e18mr1559691wfc.33.1200600520071; Thu, 17 Jan 2008 12:08:40 -0800 (PST) Received: from ?192.168.1.200? ( [24.218.111.132]) by mx.google.com with ESMTPS id 5sm3610078wrh.20.2008.01.17.12.08.38 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Jan 2008 12:08:39 -0800 (PST) Message-Id: From: Adam To: David Schultz In-Reply-To: <20080117194457.GA84887@VARK.MIT.EDU> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Date: Thu, 17 Jan 2008 15:08:36 -0500 References: <485228D5-8D0B-4CD5-9FB7-B0D551B172DA@gmail.com> <20080117194457.GA84887@VARK.MIT.EDU> X-Mailer: Apple Mail (2.915) Cc: freebsd-current@FreeBSD.ORG Subject: Re: 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 20:08:44 -0000 David, I understand that there is no routine to read and write specifically to an address contained in the di_spare. I also understand that di_spare is currently unused and has no specific manipulators. Allow me to clarify. I am looking for a way to take a ufs2_daddr_t (which is neither a direct nor indirect block of a di_node) and read/ write to that address. Regards, Adam On Jan 17, 2008, at 2:44 PM, David Schultz wrote: > On Thu, Jan 17, 2008, Adam wrote: >> 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? > > Maybe I'm misunderstanding your question, but I don't see how you > could expect FreeBSD to have routines to read and write things > that don't exist in FreeBSD. :) > > See extattr(2). It may be possible that the "extra information" > you want to store with files can be stored in user space using the > relatively standard extended attributes API.