From: Matthew Wilcox Subject: Re: help on buffer cache Date: Thu, 11 Sep 2003 12:15:30 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030911111530.GG21596@parcelfarce.linux.theplanet.co.uk> References: <20030911104316.30381.qmail@webmail25.rediffmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:18338 "EHLO www.linux.org.uk") by vger.kernel.org with ESMTP id S261207AbTIKLPb (ORCPT ); Thu, 11 Sep 2003 07:15:31 -0400 To: vadiraj c s Content-Disposition: inline In-Reply-To: <20030911104316.30381.qmail@webmail25.rediffmail.com> List-Id: linux-fsdevel.vger.kernel.org On Thu, Sep 11, 2003 at 10:43:16AM -0000, vadiraj c s wrote: > I need to use buffer cache function in my program, I need > linux/fs.h header file in the program. Can any one help me how to > compile the program in order to use the functions declared in > linux/fs.h. > > TO be very clear, I need function sb_bread to be executed in my > program, the program is in user space. My Q is can I use this > fuctions as noraml header file functions? If yes then, is there > any specific way of compiling it. I get a error message undefined > reference to the function. I'm not sure why you think you need to do this. Just open the block device (/dev/sda, for example) and use read(). The page/buffer caches will be used by the kernel on your behalf. There is no way for you to access the buffer cache directly from userspace. -- "It's not Hollywood. War is real, war is primarily not about defeat or victory, it is about death. I've seen thousands and thousands of dead bodies. Do you think I want to have an academic debate on this subject?" -- Robert Fisk