Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754318Ab0AED1V (ORCPT ); Mon, 4 Jan 2010 22:27:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754040Ab0AED1U (ORCPT ); Mon, 4 Jan 2010 22:27:20 -0500 Received: from mga03.intel.com ([143.182.124.21]:32300 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753973Ab0AED1U (ORCPT ); Mon, 4 Jan 2010 22:27:20 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,316,1257148800"; d="scan'208";a="229212194" Date: Tue, 5 Jan 2010 11:27:15 +0800 From: Wu Fengguang To: Stephen Rothwell Cc: Christoph Hellwig , Andi Kleen , Andrew Morton , Quentin Barnes , "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , Nick Piggin , Steven Whitehouse , David Howells , Al Viro , Jonathan Corbet , Eric Paris Subject: Re: [RFC][PATCH v5] readahead: introduce O_RANDOM for POSIX_FADV_RANDOM Message-ID: <20100105032715.GA1044@localhost> References: <20091230052402.GB26364@localhost> <873a2s8hmp.fsf@basil.nowhere.org> <20100104045020.GA21021@localhost> <20100104161719.a0bb35ad.sfr@canb.auug.org.au> <20100104073328.GA3422@infradead.org> <20100104125620.GB12266@localhost> <20100105130322.006c03ee.sfr@canb.auug.org.au> <20100105022650.GB29428@localhost> <20100105132824.e6c0fb7f.sfr@canb.auug.org.au> <20100105031801.GA591@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100105031801.GA591@localhost> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1215 Lines: 42 On Tue, Jan 05, 2010 at 11:18:01AM +0800, Wu Fengguang wrote: > > +/* > + * usage of open(O_RANDOM) is disabled: __dentry_open() will nuke this bit > + */ > +#ifndef O_RANDOM > +#define O_RANDOM 0200000000 /* random access pattern hint */ > +#endif > + Tested with this program, output is flags=0x9001 O_SYNC=0x1000 O_RANDOM=0 My user space O_SYNC is still the old O_DSYNC. But should be OK to test the sparc O_SYNC. ------------------------------------------------------------------------------ #include #include #define O_RANDOM 040000000 /* random access pattern hint */ int main (void) { int fd, flags; fd = open("/tmp/fcntl-test", O_WRONLY | O_CREAT | O_SYNC | O_RANDOM, 0666); flags = fcntl(fd, F_GETFL, 0); printf("flags=%#lx O_SYNC=%#lx O_RANDOM=%#lx\n", flags, flags & O_SYNC, flags & O_RANDOM); } ------------------------------------------------------------------------------ Thanks, Fengguang -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/