From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 13:47:45 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A84A16A4CE for ; Wed, 21 Apr 2004 13:47:45 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A44143D53 for ; Wed, 21 Apr 2004 13:47:45 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc13) with ESMTP id <2004042120474401500q0qeke>; Wed, 21 Apr 2004 20:47:44 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA34030; Wed, 21 Apr 2004 13:47:44 -0700 (PDT) Date: Wed, 21 Apr 2004 13:47:43 -0700 (PDT) From: Julian Elischer To: Garance A Drosihn In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 20:47:45 -0000 On Wed, 21 Apr 2004, Garance A Drosihn wrote: > At 12:23 PM -0700 4/21/04, Julian Elischer wrote: > >Ok so I have an application where I need to > >reread a file I have just written to ensure that it went to disk > >correctly.. > > > >Other than reading a few GB of data, is there a way to flush > >out the cache copy of a file I've written? > > > >possibilities include: > > > >a file flag saying "don't keep a copy after it's written to disk"? > >a syscall discard_cached_blocks(fd); > > > > > >? > >any other suggestions? > > > >julian > >(BTW this would be for 4.x initially) > > Hmm. That means you couldn't use a 'snapshot' to force the > issue, right? If you *could* use snapshots, you could close > the file, snapshot the partition, mount the snapshot, and > read the file from it's copy in the snapshot-filesystem. ingenious, but, no we can't do that.. As I mentionned.. someone suggested using 'dump' to extract the file from raw disk and checksumming that... :-) > > -- > Garance Alistair Drosehn = gad@gilead.netel.rpi.edu > Senior Systems Programmer or gad@freebsd.org > Rensselaer Polytechnic Institute or drosih@rpi.edu >