From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Mahoney Subject: Re: Access content of file via inodes Date: Tue, 05 Apr 2005 21:50:27 -0400 Message-ID: <42534063.2050509@suse.com> References: <4252E09B.9020606@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from locomotive.csh.rit.edu ([129.21.60.149]:10280 "EHLO locomotive.unixthugs.org") by vger.kernel.org with ESMTP id S262073AbVDFBue (ORCPT ); Tue, 5 Apr 2005 21:50:34 -0400 To: "Kathy KN (HK)" In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Kathy KN (HK) wrote: >>Hi Kathy - >> >>If performance is more important or you really do only have access to an >>inode, you can read from the page cache directly using inode->i_mapping >>and read_cache_page. This has the advantage that you don't need to copy >>the data to access it, but the disadvantage that it is more complex and >>can be tricky to get right. > > Hi Jeff, > > I felt that the second suggestion seems to be more of an elegant > solution, though I need to find out how to actually do it correctly. > > Thanks for the tip. If you have example code, that would be splendid. It's not the prettiest, and in fact I'm in the process of reworking it, but code similar to what you're looking at implementing can be found in fs/reiserfs/xattr.c; Start your analysis at reiserfs_xattr_get(). -Jeff -- Jeff Mahoney SuSE Labs