The following patch streamlines the open syscall so that in the case of
O_LARGEFILE opens, its a no-op. We still have to check for the filesize
being greater than MAX_NON_LFS for non-O_LARGEFILE opens. This is
possible due to the removal of the directio flag. This flag is obsolete,
has never been used so it is safe to remove it.
Also, since many files are opened without ever using flock, the
allocation of a struct gfs2_file is deferred until the actual flock call
is made. Once allocated, it is not removed until the file is closed, but
this will save both memory and time when opening files which do not call
flock at all.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index c85f4fd..c0801c3 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -430,7 +430,6 @@ struct gfs2_tune {
unsigned int gt_quota_quantum; /* Secs between syncs to quota file */
unsigned int gt_atime_quantum; /* Min secs between atime updates */
unsigned int gt_new_files_jdata;
- unsigned int gt_new_files_directio;
unsigned int gt_max_readahead; /* Max bytes to read-ahead from disk */
unsigned int gt_stall_secs; /* Detects trouble! */
unsigned int gt_complain_secs;
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 53bca99..37af7d9 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -779,13 +779,8 @@ static void init_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl,
if ((dip->i_di.di_flags & GFS2_DIF_INHERIT_JDATA) ||
gfs2_tune_get(sdp, gt_new_files_jdata))
di->di_flags |= cpu_to_be32(GFS2_DIF_JDATA);
- if ((dip->i_di.di_flags & GFS2_DIF_INHERIT_DIRECTIO) ||
- gfs2_tune_get(sdp, gt_new_files_directio))
- di->di_flags |= cpu_to_be32(GFS2_DIF_DIRECTIO);
} else if (S_ISDIR(mode)) {
di->di_flags |= cpu_to_be32(dip->i_di.di_flags &
- GFS2_DIF_INHERIT_DIRECTIO);
- di->di_flags |= cpu_to_be32(dip->i_di.di_flags &
GFS2_DIF_INHERIT_JDATA);
}
@@ -163,8 +161,6 @@ static int gfs2_get_flags(struct file *filp, u32 __user *ptr)
if (!S_ISDIR(inode->i_mode)) {
if (ip->i_di.di_flags & GFS2_DIF_JDATA)
fsflags |= FS_JOURNAL_DATA_FL;
- if (ip->i_di.di_flags & GFS2_DIF_DIRECTIO)
- fsflags |= FS_DIRECTIO_FL;
}
if (put_user(fsflags, ptr))
error = -EFAULT;
@@ -194,13 +190,11 @@ void gfs2_set_inode_flags(struct inode *inode)
/* Flags that can be set by user space */
#define GFS2_FLAGS_USER_SET (GFS2_DIF_JDATA|
- GFS2_DIF_DIRECTIO|
GFS2_DIF_IMMUTABLE|
GFS2_DIF_APPENDONLY|
GFS2_DIF_NOATIME|
GFS2_DIF_SYNC|
GFS2_DIF_SYSTEM|
- GFS2_DIF_INHERIT_DIRECTIO|
GFS2_DIF_INHERIT_JDATA)