From: Theodore Ts'o <tytso@mit.edu>
To: linux-fsdevel@vger.kernel.org
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>,
Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH, RFC 1/3] fs: add new open flags O_HOT and O_COLD
Date: Thu, 19 Apr 2012 15:20:09 -0400 [thread overview]
Message-ID: <1334863211-19504-2-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1334863211-19504-1-git-send-email-tytso@mit.edu>
The O_HOT and O_COLD flag are hints to the file system that the file
is going to be frequently accessed (a "hot" file) and or very
infrequently accessed (a "cold" file). It is up the file system to
decide how these flags should be interpreted; in some cases, such as
O_HOT, the file system may require appropriate privileges or implement
check some kind of per-user quota before deciding to honor the flag.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
fs/fcntl.c | 5 +++--
include/asm-generic/fcntl.h | 7 +++++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/fs/fcntl.c b/fs/fcntl.c
index 75e7c1f..463352d 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -835,14 +835,15 @@ static int __init fcntl_init(void)
* Exceptions: O_NONBLOCK is a two bit define on parisc; O_NDELAY
* is defined as O_NONBLOCK on some platforms and not on others.
*/
- BUILD_BUG_ON(19 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32(
+ BUILD_BUG_ON(21 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32(
O_RDONLY | O_WRONLY | O_RDWR |
O_CREAT | O_EXCL | O_NOCTTY |
O_TRUNC | O_APPEND | /* O_NONBLOCK | */
__O_SYNC | O_DSYNC | FASYNC |
O_DIRECT | O_LARGEFILE | O_DIRECTORY |
O_NOFOLLOW | O_NOATIME | O_CLOEXEC |
- __FMODE_EXEC | O_PATH
+ __FMODE_EXEC | O_PATH | O_HOT |
+ O_COLD
));
fasync_cache = kmem_cache_create("fasync_cache",
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h
index 9e5b035..1fdcbb1 100644
--- a/include/asm-generic/fcntl.h
+++ b/include/asm-generic/fcntl.h
@@ -84,6 +84,13 @@
#define O_PATH 010000000
#endif
+#ifndef O_HOT
+#define O_HOT 020000000
+#endif
+#ifndef O_COLD
+#define O_COLD 040000000
+#endif
+
#ifndef O_NDELAY
#define O_NDELAY O_NONBLOCK
#endif
--
1.7.10.rc3
next prev parent reply other threads:[~2012-04-19 19:20 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-19 19:20 [PATCH, RFC 0/3] Introduce new O_HOT and O_COLD flags Theodore Ts'o
2012-04-19 19:20 ` Theodore Ts'o [this message]
2012-04-19 19:20 ` [PATCH, RFC 2/3] fs: propagate the open_flags structure down to the low-level fs's create() Theodore Ts'o
2012-04-19 19:20 ` [PATCH, RFC 3/3] ext4: use the O_HOT and O_COLD open flags to influence inode allocation Theodore Ts'o
2012-04-19 19:45 ` Eric Sandeen
2012-04-19 19:59 ` Ted Ts'o
2012-04-19 22:55 ` Andreas Dilger
2012-04-19 23:27 ` Dave Chinner
2012-04-20 2:26 ` Ted Ts'o
2012-04-21 0:57 ` Dave Chinner
2012-04-20 0:26 ` [PATCH, RFC 0/3] Introduce new O_HOT and O_COLD flags Alex Elder
2012-04-20 2:45 ` Ted Ts'o
2012-04-20 9:31 ` Boaz Harrosh
2012-04-20 9:12 ` Boaz Harrosh
2012-04-20 9:45 ` Lukas Czerner
2012-04-20 11:01 ` James Bottomley
2012-04-20 11:23 ` Lukas Czerner
2012-04-20 14:07 ` Christoph Lameter
2012-04-20 14:42 ` James Bottomley
2012-04-20 14:58 ` Ted Ts'o
2012-04-21 23:56 ` KOSAKI Motohiro
2012-04-22 6:30 ` Nick Piggin
2012-04-23 8:23 ` James Bottomley
2012-04-23 11:47 ` Nick Piggin
2012-04-24 6:18 ` Nick Piggin
2012-04-24 15:00 ` KOSAKI Motohiro
2012-04-21 18:26 ` Jeff Garzik
2012-04-20 10:16 ` Bernd Schubert
2012-04-20 10:38 ` Lukas Czerner
2012-04-21 18:24 ` Jeff Garzik
2012-04-24 16:07 ` Alex Elder
2012-04-24 19:33 ` Jamie Lokier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1334863211-19504-2-git-send-email-tytso@mit.edu \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).