Re: [RFC][PATCH v5] readahead: introduce O_RANDOM for POSIX_FADV_RANDOM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <fcntl.h>
#include <stdio.h>

#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-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux