Streamline open and remove directio flag
Hi,
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 <[email protected]>
fs/gfs2/incore.h +0 -1
@@ -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;
fs/gfs2/inode.c +0 -5
@@ -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 ); }
fs/gfs2/ops_file.c +18 -49
144 lines not on this page · raw message
fs/gfs2/super.c +0 -1
@@ -63,7 +63,6 @@ void gfs2_tune_init(struct gfs2_tune *gt) gt->gt_quota_quantum =60 ; gt->gt_atime_quantum =3600 ; gt->gt_new_files_jdata =0 ; - gt->gt_new_files_directio =0 ; gt->gt_max_readahead =1 <<18 ; gt->gt_stall_secs =600 ; gt->gt_complain_secs =10 ;
fs/gfs2/sys.c +0 -2
@@ -433,7 +433,6 @@ TUNE_ATTR(max_readahead, 0);TUNE_ATTR (complain_secs,0 );TUNE_ATTR (statfs_slow,0 );TUNE_ATTR (new_files_jdata,0 ); -TUNE_ATTR (new_files_directio,0 );TUNE_ATTR (quota_simul_sync,1 );TUNE_ATTR (quota_cache_secs,1 );TUNE_ATTR (stall_secs,1 );
@@ -460,7 +459,6 @@ static struct attribute *tune_attrs[] = { &tune_attr_quotad_secs.attr, &tune_attr_quota_scale.attr, &tune_attr_new_files_jdata.attr, - &tune_attr_new_files_directio.attr, NULL, };