diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-04-25 13:20:27 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-04-25 13:20:27 -0400 |
commit | 4bcf7091f9da595016f9d1175aa1bea8e736566f (patch) | |
tree | e1ebe2ac39eff1d73b4f974174e3a61682107a10 /fs/gfs2/ops_file.c | |
parent | b5ea3e1ef307548bdd40fff6aba5fc96b002f284 (diff) |
[GFS2] Remove inherited flags from exported flags.
We don't need the inherited flags since this action can be
implied by setting the flags on directories where they
wouldn't otherwise make sense. It reduces the number of extra
flags by two. Also updated the list of flags to take account of
one extra ext2/3 flag.
Cc: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_file.c')
-rw-r--r-- | fs/gfs2/ops_file.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c index 3fb1a29f88a6..c2dbc300a50c 100644 --- a/fs/gfs2/ops_file.c +++ b/fs/gfs2/ops_file.c | |||
@@ -545,8 +545,6 @@ static const u32 iflags_to_gfs2[32] = { | |||
545 | [iflag_Index] = GFS2_DIF_EXHASH, | 545 | [iflag_Index] = GFS2_DIF_EXHASH, |
546 | [iflag_JournalData] = GFS2_DIF_JDATA, | 546 | [iflag_JournalData] = GFS2_DIF_JDATA, |
547 | [iflag_DirectIO] = GFS2_DIF_DIRECTIO, | 547 | [iflag_DirectIO] = GFS2_DIF_DIRECTIO, |
548 | [iflag_InheritDirectIO] = GFS2_DIF_INHERIT_DIRECTIO, | ||
549 | [iflag_InheritJdata] = GFS2_DIF_INHERIT_JDATA, | ||
550 | }; | 548 | }; |
551 | 549 | ||
552 | static const u32 gfs2_to_iflags[32] = { | 550 | static const u32 gfs2_to_iflags[32] = { |
@@ -557,8 +555,8 @@ static const u32 gfs2_to_iflags[32] = { | |||
557 | [gfs2fl_ExHash] = IFLAG_INDEX, | 555 | [gfs2fl_ExHash] = IFLAG_INDEX, |
558 | [gfs2fl_Jdata] = IFLAG_JOURNAL_DATA, | 556 | [gfs2fl_Jdata] = IFLAG_JOURNAL_DATA, |
559 | [gfs2fl_Directio] = IFLAG_DIRECTIO, | 557 | [gfs2fl_Directio] = IFLAG_DIRECTIO, |
560 | [gfs2fl_InheritDirectio] = IFLAG_INHERITDIRECTIO, | 558 | [gfs2fl_InheritDirectio] = IFLAG_DIRECTIO, |
561 | [gfs2fl_InheritJdata] = IFLAG_INHERITJDATA, | 559 | [gfs2fl_InheritJdata] = IFLAG_JOURNAL_DATA, |
562 | }; | 560 | }; |
563 | 561 | ||
564 | static int gfs2_get_flags(struct file *filp, u32 __user *ptr) | 562 | static int gfs2_get_flags(struct file *filp, u32 __user *ptr) |
@@ -621,20 +619,17 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask) | |||
621 | if ((new_flags ^ flags) == 0) | 619 | if ((new_flags ^ flags) == 0) |
622 | goto out; | 620 | goto out; |
623 | 621 | ||
622 | if (S_ISDIR(inode->i_mode)) { | ||
623 | if ((new_flags ^ flags) & GFS2_DIF_JDATA) | ||
624 | new_flags ^= (GFS2_DIF_JDATA|GFS2_DIF_INHERIT_JDATA); | ||
625 | if ((new_flags ^ flags) & GFS2_DIF_DIRECTIO) | ||
626 | new_flags ^= (GFS2_DIF_DIRECTIO|GFS2_DIF_INHERIT_DIRECTIO); | ||
627 | } | ||
628 | |||
624 | error = -EINVAL; | 629 | error = -EINVAL; |
625 | if ((new_flags ^ flags) & ~GFS2_FLAGS_USER_SET) | 630 | if ((new_flags ^ flags) & ~GFS2_FLAGS_USER_SET) |
626 | goto out; | 631 | goto out; |
627 | 632 | ||
628 | if (S_ISDIR(inode->i_mode)) { | ||
629 | if ((new_flags ^ flags) & (GFS2_DIF_JDATA | GFS2_DIF_DIRECTIO)) | ||
630 | goto out; | ||
631 | } else if (S_ISREG(inode->i_mode)) { | ||
632 | if ((new_flags ^ flags) & (GFS2_DIF_INHERIT_DIRECTIO| | ||
633 | GFS2_DIF_INHERIT_JDATA)) | ||
634 | goto out; | ||
635 | } else | ||
636 | goto out; | ||
637 | |||
638 | error = -EPERM; | 633 | error = -EPERM; |
639 | if (IS_IMMUTABLE(inode) && (new_flags & GFS2_DIF_IMMUTABLE)) | 634 | if (IS_IMMUTABLE(inode) && (new_flags & GFS2_DIF_IMMUTABLE)) |
640 | goto out; | 635 | goto out; |