Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38663
b: refs/heads/master
c: 4bcf709
h: refs/heads/master
i:
  38661: 5a039d4
  38659: 6492c3f
  38655: 7b8362b
v: v3
  • Loading branch information
Steven Whitehouse committed Apr 25, 2006
1 parent 7d67777 commit 2c78094
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b5ea3e1ef307548bdd40fff6aba5fc96b002f284
refs/heads/master: 4bcf7091f9da595016f9d1175aa1bea8e736566f
23 changes: 9 additions & 14 deletions trunk/fs/gfs2/ops_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,6 @@ static const u32 iflags_to_gfs2[32] = {
[iflag_Index] = GFS2_DIF_EXHASH,
[iflag_JournalData] = GFS2_DIF_JDATA,
[iflag_DirectIO] = GFS2_DIF_DIRECTIO,
[iflag_InheritDirectIO] = GFS2_DIF_INHERIT_DIRECTIO,
[iflag_InheritJdata] = GFS2_DIF_INHERIT_JDATA,
};

static const u32 gfs2_to_iflags[32] = {
Expand All @@ -557,8 +555,8 @@ static const u32 gfs2_to_iflags[32] = {
[gfs2fl_ExHash] = IFLAG_INDEX,
[gfs2fl_Jdata] = IFLAG_JOURNAL_DATA,
[gfs2fl_Directio] = IFLAG_DIRECTIO,
[gfs2fl_InheritDirectio] = IFLAG_INHERITDIRECTIO,
[gfs2fl_InheritJdata] = IFLAG_INHERITJDATA,
[gfs2fl_InheritDirectio] = IFLAG_DIRECTIO,
[gfs2fl_InheritJdata] = IFLAG_JOURNAL_DATA,
};

static int gfs2_get_flags(struct file *filp, u32 __user *ptr)
Expand Down Expand Up @@ -621,20 +619,17 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask)
if ((new_flags ^ flags) == 0)
goto out;

if (S_ISDIR(inode->i_mode)) {
if ((new_flags ^ flags) & GFS2_DIF_JDATA)
new_flags ^= (GFS2_DIF_JDATA|GFS2_DIF_INHERIT_JDATA);
if ((new_flags ^ flags) & GFS2_DIF_DIRECTIO)
new_flags ^= (GFS2_DIF_DIRECTIO|GFS2_DIF_INHERIT_DIRECTIO);
}

error = -EINVAL;
if ((new_flags ^ flags) & ~GFS2_FLAGS_USER_SET)
goto out;

if (S_ISDIR(inode->i_mode)) {
if ((new_flags ^ flags) & (GFS2_DIF_JDATA | GFS2_DIF_DIRECTIO))
goto out;
} else if (S_ISREG(inode->i_mode)) {
if ((new_flags ^ flags) & (GFS2_DIF_INHERIT_DIRECTIO|
GFS2_DIF_INHERIT_JDATA))
goto out;
} else
goto out;

error = -EPERM;
if (IS_IMMUTABLE(inode) && (new_flags & GFS2_DIF_IMMUTABLE))
goto out;
Expand Down
10 changes: 4 additions & 6 deletions trunk/include/linux/iflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ enum {
iflag_NoTail = 15, /* file tail should not be merged */
iflag_DirSync = 16, /* dirsync behaviour */
iflag_TopDir = 17, /* Top of directory hierarchies */
iflag_DirectIO = 18, /* Always use direct I/O on this file */
iflag_InheritDirectIO = 19, /* Set DirectIO on new files in dir */
iflag_InheritJdata = 20, /* Set JournalData on create in dir */
iflag_Extent = 19, /* Extents */
iflag_DirectIO = 20, /* Always use direct I/O on this file */
iflag_Reserved = 31 /* reserved for ext2/3 lib */
};

Expand All @@ -72,9 +71,8 @@ enum {
#define IFLAG_NOTAIL __IFL(NoTail) /* 0x00008000 */
#define IFLAG_DIRSYNC __IFL(DirSync) /* 0x00010000 */
#define IFLAG_TOPDIR __IFL(TopDir) /* 0x00020000 */
#define IFLAG_DIRECTIO __IFL(DirectIO) /* 0x00040000 */
#define IFLAG_INHERITDIRECTIO __IFL(InheritDirectIO) /* 0x00080000 */
#define IFLAG_INHERITJDATA __IFL(InheritJdata) /* 0x00100000 */
#define IFLAG_EXTENT __IFL(Extent) /* 0x00080000 */
#define IFLAG_DIRECTIO __IFL(DirectIO) /* 0x00100000 */
#define IFLAG_RESERVED __IFL(Reserved) /* 0x80000000 */

#ifdef __KERNEL__
Expand Down

0 comments on commit 2c78094

Please sign in to comment.