From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 03/16] GFS2: Add "top dir" flag support
Date: Mon, 23 Jul 2012 09:00:53 +0100 [thread overview]
Message-ID: <1343030466-3053-4-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1343030466-3053-1-git-send-email-swhiteho@redhat.com>
From: Steven Whitehouse <steve@chygwyn.com>
This patch adds support for the "top dir" flag. Currently this is unused
but a subsequent patch is planned which will add support for the
Orlov allocation policy when allocating subdirectories in a parent
with this flag set.
In order to ensure backward compatible behaviour, mkfs.gfs2 does
not currently tag the root directory with this flag, it must always be
set manually.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 26e2905..6fbf3cb 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -142,6 +142,7 @@ static const u32 fsflags_to_gfs2[32] = {
[7] = GFS2_DIF_NOATIME,
[12] = GFS2_DIF_EXHASH,
[14] = GFS2_DIF_INHERIT_JDATA,
+ [17] = GFS2_DIF_TOPDIR,
};
static const u32 gfs2_to_fsflags[32] = {
@@ -150,6 +151,7 @@ static const u32 gfs2_to_fsflags[32] = {
[gfs2fl_AppendOnly] = FS_APPEND_FL,
[gfs2fl_NoAtime] = FS_NOATIME_FL,
[gfs2fl_ExHash] = FS_INDEX_FL,
+ [gfs2fl_TopLevel] = FS_TOPDIR_FL,
[gfs2fl_InheritJdata] = FS_JOURNAL_DATA_FL,
};
@@ -203,6 +205,7 @@ void gfs2_set_inode_flags(struct inode *inode)
GFS2_DIF_NOATIME| \
GFS2_DIF_SYNC| \
GFS2_DIF_SYSTEM| \
+ GFS2_DIF_TOPDIR| \
GFS2_DIF_INHERIT_JDATA)
/**
@@ -298,6 +301,7 @@ static int gfs2_set_flags(struct file *filp, u32 __user *ptr)
gfsflags = fsflags_cvt(fsflags_to_gfs2, fsflags);
if (!S_ISDIR(inode->i_mode)) {
+ gfsflags &= ~GFS2_DIF_TOPDIR;
if (gfsflags & GFS2_DIF_INHERIT_JDATA)
gfsflags ^= (GFS2_DIF_JDATA | GFS2_DIF_INHERIT_JDATA);
return do_gfs2_set_flags(filp, gfsflags, ~0);
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index fa98bdb..e8ccf6f 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -214,6 +214,7 @@ enum {
gfs2fl_NoAtime = 7,
gfs2fl_Sync = 8,
gfs2fl_System = 9,
+ gfs2fl_TopLevel = 10,
gfs2fl_TruncInProg = 29,
gfs2fl_InheritDirectio = 30,
gfs2fl_InheritJdata = 31,
@@ -230,8 +231,9 @@ enum {
#define GFS2_DIF_NOATIME 0x00000080
#define GFS2_DIF_SYNC 0x00000100
#define GFS2_DIF_SYSTEM 0x00000200 /* New in gfs2 */
+#define GFS2_DIF_TOPDIR 0x00000400 /* New in gfs2 */
#define GFS2_DIF_TRUNC_IN_PROG 0x20000000 /* New in gfs2 */
-#define GFS2_DIF_INHERIT_DIRECTIO 0x40000000
+#define GFS2_DIF_INHERIT_DIRECTIO 0x40000000 /* only in gfs1 */
#define GFS2_DIF_INHERIT_JDATA 0x80000000
struct gfs2_dinode {
--
1.7.4
next prev parent reply other threads:[~2012-07-23 8:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-23 8:00 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse
2012-07-23 8:00 ` [Cluster-devel] [PATCH 01/16] GFS2: Extend the life of the reservations Steven Whitehouse
2012-07-23 8:00 ` [Cluster-devel] [PATCH 02/16] GFS2: Fold quota data into the reservations struct Steven Whitehouse
2012-07-23 8:00 ` Steven Whitehouse [this message]
2012-07-23 8:00 ` [Cluster-devel] [PATCH 04/16] GFS2: Fix error handling when reading an invalid block from the journal Steven Whitehouse
2012-07-23 8:00 ` [Cluster-devel] [PATCH 05/16] GFS2: Increase buffer size for glocks and glstats debugfs files Steven Whitehouse
2012-07-23 8:00 ` [Cluster-devel] [PATCH 06/16] GFS2: Cache last hash bucket for glock seq_files Steven Whitehouse
2012-07-23 8:00 ` [Cluster-devel] [PATCH 07/16] GFS2: Use lvbs for storing rgrp information with mount option Steven Whitehouse
2012-07-23 8:00 ` [Cluster-devel] [PATCH 08/16] seq_file: Add seq_vprintf function and export it Steven Whitehouse
2012-07-23 8:00 ` [Cluster-devel] [PATCH 09/16] GFS2: Use seq_vprintf for glocks debugfs file Steven Whitehouse
2012-07-23 8:01 ` [Cluster-devel] [PATCH 10/16] GFS2: Size seq_file buffer more carefully Steven Whitehouse
2012-07-23 8:01 ` [Cluster-devel] [PATCH 11/16] GFS2: Add kobject release method Steven Whitehouse
2012-07-23 8:01 ` [Cluster-devel] [PATCH 12/16] GFS2: Combine functions get_local_rgrp and gfs2_inplace_reserve Steven Whitehouse
2012-07-23 8:01 ` [Cluster-devel] [PATCH 13/16] GFS2: Fixing double brelse'ing bh allocated in gfs2_meta_read when EIO occurs Steven Whitehouse
2012-07-23 8:01 ` [Cluster-devel] [PATCH 14/16] GFS2: kernel panic with small gfs2 filesystems - 1 RG Steven Whitehouse
2012-07-23 8:01 ` [Cluster-devel] [PATCH 15/16] GFS2: Reduce file fragmentation Steven Whitehouse
2012-07-23 8:01 ` [Cluster-devel] [PATCH 16/16] GFS2: Eliminate 64-bit divides Steven Whitehouse
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=1343030466-3053-4-git-send-email-swhiteho@redhat.com \
--to=swhiteho@redhat.com \
/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).