From: Theodore Ts'o <tytso@mit.edu>
To: linux-ext4@vger.kernel.org
Cc: Andreas Dilger <adilger@sun.com>, Alex Tomas <bzzz@sun.com>,
Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH, RFC -V2 2/4] ext4: Display the mballoc flags in mb_history in hex instead of decimal
Date: Sun, 9 Aug 2009 23:23:53 -0400 [thread overview]
Message-ID: <1249874635-24250-3-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1249874635-24250-1-git-send-email-tytso@mit.edu>
Displaying the flags in base 16 makes it easier to see which flags
have been set.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
fs/ext4/ext4.h | 22 +++++++++++-----------
fs/ext4/mballoc.c | 4 ++--
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 9714db3..e267727 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -67,27 +67,27 @@ typedef unsigned int ext4_group_t;
/* prefer goal again. length */
-#define EXT4_MB_HINT_MERGE 1
+#define EXT4_MB_HINT_MERGE 0x0001
/* blocks already reserved */
-#define EXT4_MB_HINT_RESERVED 2
+#define EXT4_MB_HINT_RESERVED 0x0002
/* metadata is being allocated */
-#define EXT4_MB_HINT_METADATA 4
+#define EXT4_MB_HINT_METADATA 0x0004
/* first blocks in the file */
-#define EXT4_MB_HINT_FIRST 8
+#define EXT4_MB_HINT_FIRST 0x0008
/* search for the best chunk */
-#define EXT4_MB_HINT_BEST 16
+#define EXT4_MB_HINT_BEST 0x0010
/* data is being allocated */
-#define EXT4_MB_HINT_DATA 32
+#define EXT4_MB_HINT_DATA 0x0020
/* don't preallocate (for tails) */
-#define EXT4_MB_HINT_NOPREALLOC 64
+#define EXT4_MB_HINT_NOPREALLOC 0x0040
/* allocate for locality group */
-#define EXT4_MB_HINT_GROUP_ALLOC 128
+#define EXT4_MB_HINT_GROUP_ALLOC 0x0080
/* allocate goal blocks or none */
-#define EXT4_MB_HINT_GOAL_ONLY 256
+#define EXT4_MB_HINT_GOAL_ONLY 0x0100
/* goal is meaningful */
-#define EXT4_MB_HINT_TRY_GOAL 512
+#define EXT4_MB_HINT_TRY_GOAL 0x0200
/* blocks already pre-reserved by delayed allocation */
-#define EXT4_MB_DELALLOC_RESERVED 1024
+#define EXT4_MB_DELALLOC_RESERVED 0x0400
struct ext4_allocation_request {
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 2c81240..f510a58 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2157,7 +2157,7 @@ static int ext4_mb_seq_history_show(struct seq_file *seq, void *v)
if (v == SEQ_START_TOKEN) {
seq_printf(seq, "%-5s %-8s %-23s %-23s %-23s %-5s "
- "%-5s %-2s %-5s %-5s %-5s %-6s\n",
+ "%-5s %-2s %-6s %-5s %-5s %-6s\n",
"pid", "inode", "original", "goal", "result", "found",
"grps", "cr", "flags", "merge", "tail", "broken");
return 0;
@@ -2165,7 +2165,7 @@ static int ext4_mb_seq_history_show(struct seq_file *seq, void *v)
if (hs->op == EXT4_MB_HISTORY_ALLOC) {
fmt = "%-5u %-8u %-23s %-23s %-23s %-5u %-5u %-2u "
- "%-5u %-5s %-5u %-6u\n";
+ "0x%04x %-5s %-5u %-6u\n";
sprintf(buf2, "%u/%d/%u@%u", hs->result.fe_group,
hs->result.fe_start, hs->result.fe_len,
hs->result.fe_logical);
--
1.6.3.2.1.gb9f7d.dirty
next prev parent reply other threads:[~2009-08-10 3:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-10 3:23 [PATCH, RFC -V2 0/4] mballoc patches for ext4 Theodore Ts'o
2009-08-10 3:23 ` [PATCH, RFC -V2 1/4] ext4: Add configurable run-time mballoc debugging Theodore Ts'o
2009-08-10 3:42 ` Eric Sandeen
2009-08-10 20:23 ` Theodore Tso
2009-08-11 18:15 ` Xiang Wang
2009-08-11 18:53 ` Theodore Tso
2009-08-10 3:23 ` Theodore Ts'o [this message]
2009-08-10 3:44 ` [PATCH, RFC -V2 2/4] ext4: Display the mballoc flags in mb_history in hex instead of decimal Eric Sandeen
2009-08-10 3:23 ` [PATCH, RFC -V2 3/4] ext4: Fix bugs in mballoc's stream allocation mode Theodore Ts'o
2009-08-20 7:22 ` Aneesh Kumar K.V
2009-08-20 18:20 ` Theodore Tso
2009-08-10 3:23 ` [PATCH, RFC -V2 4/4] ext4: Avoid group preallocation for closed files Theodore Ts'o
2009-08-20 6:40 ` Aneesh Kumar K.V
2009-08-21 2:45 ` Theodore Tso
2009-08-21 12:23 ` Theodore Tso
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=1249874635-24250-3-git-send-email-tytso@mit.edu \
--to=tytso@mit.edu \
--cc=adilger@sun.com \
--cc=bzzz@sun.com \
--cc=linux-ext4@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).