Change argument of gfs2_dinode_out [17/70]
From 539e5d6b7ae8612c0393fe940d2da5b591318d3d Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <[email protected]>
Date: Tue, 31 Oct 2006 15:07:05 -0500
Subject: [PATCH] [GFS2] Change argument of gfs2_dinode_out
Everywhere this was called, a struct gfs2_inode was available, but despite that, it was always called with a struct gfs2_dinode as an argument. By making this change it paves the way to start eliminating fields duplicated between the kernel's struct inode and the struct gfs2_dinode.
--- fs/gfs2/acl.c | 2 +- fs/gfs2/bmap.c | 12 ++++++------ fs/gfs2/dir.c | 20 ++++++++++---------- fs/gfs2/eattr.c | 14 +++++++------- fs/gfs2/inode.c | 6 +++--- fs/gfs2/ondisk.c | 5 ++++- fs/gfs2/ops_file.c | 2 +- fs/gfs2/ops_inode.c | 10 +++++----- include/linux/gfs2_ondisk.h | 3 ++- 9 files changed, 39 insertions(+), 35 deletions(-)
fs/gfs2/acl.c +1 -1
@@ -201,7 +201,7 @@ static int munge_mode(struct gfs2_inode (ip->i_di.di_mode & S_IFMT) == (mode & S_IFMT)); ip->i_di.di_mode = mode;gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }
fs/gfs2/bmap.c +6 -6
@@ -498,7 +498,7 @@ static int gfs2_block_pointers(struct in error =gfs2_meta_inode_buffer (ip, &dibh);if (!error) {gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }set_buffer_new (bh_map);
@@ -780,7 +780,7 @@ static int do_strip(struct gfs2_inode *i ip->i_di.di_mtime = ip->i_di.di_ctime =get_seconds (); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);up_write (&ip->i_rw_mutex);
@@ -860,7 +860,7 @@ static int do_grow(struct gfs2_inode *ip goto out_end_trans;gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); out_end_trans:
@@ -970,7 +970,7 @@ static int trunc_start(struct gfs2_inode ip->i_di.di_size = size; ip->i_di.di_mtime = ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);gfs2_buffer_clear_tail (dibh,sizeof (struct gfs2_dinode ) + size); error =1 ;
@@ -983,7 +983,7 @@ static int trunc_start(struct gfs2_inode ip->i_di.di_mtime = ip->i_di.di_ctime =get_seconds (); ip->i_di.di_flags |=GFS2_DIF_TRUNC_IN_PROG ;gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data); } }
@@ -1057,7 +1057,7 @@ static int trunc_end(struct gfs2_inode * ip->i_di.di_flags &= ~GFS2_DIF_TRUNC_IN_PROG ;gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); out:
fs/gfs2/dir.c +10 -10
@@ -132,7 +132,7 @@ static int gfs2_dir_write_stuffed(structif (ip->i_di.di_size < offset + size) ip->i_di.di_size = offset + size; ip->i_di.di_mtime = ip->i_di.di_ctime =get_seconds (); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);
@@ -232,7 +232,7 @@ out: ip->i_di.di_mtime = ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);return copied;
@@ -907,7 +907,7 @@ static int dir_make_exhash(struct inodefor (x = sdp->sd_hash_ptrs, y =-1 ; x; x >>=1 , y++) ; dip->i_di.di_depth = y; -gfs2_dinode_out (&dip->i_di, dibh->b_data); +gfs2_dinode_out (dip, dibh->b_data);brelse (dibh);
@@ -1039,7 +1039,7 @@ static int dir_split_leaf(struct inode * error =gfs2_meta_inode_buffer (dip, &dibh);if (!gfs2_assert_withdraw (GFS2_SB (&dip->i_inode), !error)) { dip->i_di.di_blocks++; -gfs2_dinode_out (&dip->i_di, dibh->b_data); +gfs2_dinode_out (dip, dibh->b_data);brelse (dibh); }
@@ -1119,7 +1119,7 @@ static int dir_double_exhash(struct gfs2 error =gfs2_meta_inode_buffer (dip, &dibh);if (!gfs2_assert_withdraw (sdp, !error)) { dip->i_di.di_depth++; -gfs2_dinode_out (&dip->i_di, dibh->b_data); +gfs2_dinode_out (dip, dibh->b_data);brelse (dibh); }
@@ -1517,7 +1517,7 @@ static int dir_new_leaf(struct inode *inreturn error;gfs2_trans_add_bh (ip->i_gl, bh,1 ); ip->i_di.di_blocks++; -gfs2_dinode_out (&ip->i_di, bh->b_data); +gfs2_dinode_out (ip, bh->b_data);brelse (bh);return 0 ; }
@@ -1561,7 +1561,7 @@ int gfs2_dir_add(struct inode *inode, cogfs2_trans_add_bh (ip->i_gl, bh,1 ); ip->i_di.di_entries++; ip->i_di.di_mtime = ip->i_di.di_ctime =get_seconds (); -gfs2_dinode_out (&ip->i_di, bh->b_data); +gfs2_dinode_out (ip, bh->b_data);brelse (bh); error =0 ;break ;
@@ -1647,7 +1647,7 @@ int gfs2_dir_del(struct gfs2_inode *dip,gfs2_trans_add_bh (dip->i_gl, bh,1 ); dip->i_di.di_entries--; dip->i_di.di_mtime = dip->i_di.di_ctime =get_seconds (); -gfs2_dinode_out (&dip->i_di, bh->b_data); +gfs2_dinode_out (dip, bh->b_data);brelse (bh);mark_inode_dirty (&dip->i_inode);
@@ -1695,7 +1695,7 @@ int gfs2_dir_mvino(struct gfs2_inode *di } dip->i_di.di_mtime = dip->i_di.di_ctime =get_seconds (); -gfs2_dinode_out (&dip->i_di, bh->b_data); +gfs2_dinode_out (dip, bh->b_data);brelse (bh);return 0 ; }
@@ -1875,7 +1875,7 @@ static int leaf_dealloc(struct gfs2_inod goto out_end_trans;gfs2_trans_add_bh (dip->i_gl, dibh,1 ); -gfs2_dinode_out (&dip->i_di, dibh->b_data); +gfs2_dinode_out (dip, dibh->b_data);brelse (dibh); out_end_trans:
fs/gfs2/eattr.c +7 -7
@@ -302,7 +302,7 @@ static int ea_dealloc_unstuffed(struct gif (!error) { ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }
@@ -717,7 +717,7 @@ static int ea_alloc_skeleton(struct gfs2 } ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }
@@ -852,7 +852,7 @@ static int ea_set_simple_noalloc(struct } ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); out:gfs2_trans_end (GFS2_SB (&ip->i_inode));
@@ -1132,7 +1132,7 @@ static int ea_remove_stuffed(struct gfs2if (!error) { ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }
@@ -1287,7 +1287,7 @@ int gfs2_ea_acl_chmod(struct gfs2_inodegfs2_assert_warn (GFS2_SB (&ip->i_inode), !error);gfs2_inode_attr_out (ip);gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }
@@ -1397,7 +1397,7 @@ static int ea_dealloc_indirect(struct gf error =gfs2_meta_inode_buffer (ip, &dibh);if (!error) {gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }
@@ -1446,7 +1446,7 @@ static int ea_dealloc_block(struct gfs2_ error =gfs2_meta_inode_buffer (ip, &dibh);if (!error) {gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }
fs/gfs2/inode.c +3 -3
@@ -338,7 +338,7 @@ int gfs2_change_nlink(struct gfs2_inode ip->i_inode.i_nlink = nlink;gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);mark_inode_dirty (&ip->i_inode);
@@ -792,7 +792,7 @@ static int link_dinode(struct gfs2_inode goto fail_end_trans; ip->i_di.di_nlink =1 ;gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);return 0 ;
@@ -1349,7 +1349,7 @@ __gfs2_setattr_simple(struct gfs2_inodegfs2_inode_attr_out (ip);gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }return error;
fs/gfs2/ondisk.c +4 -1
@@ -15,6 +15,8 @@ #include <linux/buffer_head.h>#include "gfs2.h" #include <linux/gfs2_ondisk.h> +#include <linux/lm_interface.h> +#include "incore.h" #define pv (struct, member, fmt) printk(KERN_INFO " "#member" = "fmt"\n", \ struct->member);
@@ -187,8 +189,9 @@ void gfs2_dinode_in(struct gfs2_dinode_h } -void gfs2_dinode_out (const struct gfs2_dinode_host *di,void *buf) +void gfs2_dinode_out (const struct gfs2_inode *ip,void *buf) { +const struct gfs2_dinode_host *di = &ip->i_di;struct gfs2_dinode *str = buf;gfs2_meta_header_out (&di->di_header, buf);
fs/gfs2/ops_file.c +1 -1
@@ -336,7 +336,7 @@ static int do_gfs2_set_flags(struct file goto out_trans_end;gfs2_trans_add_bh (ip->i_gl, bh,1 ); ip->i_di.di_flags = new_flags; -gfs2_dinode_out (&ip->i_di, bh->b_data); +gfs2_dinode_out (ip, bh->b_data);brelse (bh); out_trans_end:gfs2_trans_end (sdp);
fs/gfs2/ops_inode.c +5 -5
@@ -339,7 +339,7 @@ static int gfs2_symlink(struct inode *di error =gfs2_meta_inode_buffer (ip, &dibh);if (!gfs2_assert_withdraw (sdp, !error)) { -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);memcpy (dibh->b_data +sizeof (struct gfs2_dinode ), symname, size);brelse (dibh);
@@ -414,7 +414,7 @@ static int gfs2_mkdir(struct inode *dir,gfs2_inum_out (&dip->i_num, &dent->de_inum); dent->de_type =cpu_to_be16 (DT_DIR ); -gfs2_dinode_out (&ip->i_di, di); +gfs2_dinode_out (ip, di);brelse (dibh); }
@@ -541,7 +541,7 @@ static int gfs2_mknod(struct inode *dir, error =gfs2_meta_inode_buffer (ip, &dibh);if (!gfs2_assert_withdraw (sdp, !error)) { -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }
@@ -762,7 +762,7 @@ static int gfs2_rename(struct inode *odi goto out_end_trans; ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }
@@ -949,7 +949,7 @@ static int setattr_chown(struct inode *igfs2_inode_attr_out (ip);gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);if (ouid !=NO_QUOTA_CHANGE || ogid !=NO_QUOTA_CHANGE ) {
include/linux/gfs2_ondisk.h +2 -1
@@ -535,7 +535,8 @@ extern void gfs2_rgrp_in(struct gfs2_rgrextern void gfs2_rgrp_out (const struct gfs2_rgrp_host *rg,void *buf);extern void gfs2_quota_in (struct gfs2_quota_host *qu,const void *buf);extern void gfs2_dinode_in (struct gfs2_dinode_host *di,const void *buf); -extern void gfs2_dinode_out (const struct gfs2_dinode_host *di,void *buf); +struct gfs2_inode ; +extern void gfs2_dinode_out (const struct gfs2_inode *ip,void *buf);extern void gfs2_ea_header_in (struct gfs2_ea_header *ea,const void *buf);extern void gfs2_ea_header_out (const struct gfs2_ea_header *ea,void *buf);extern void gfs2_log_header_in (struct gfs2_log_header_host *lh,const void *buf);
Signature · 1 line
1.4.1
Quoted 10 lines · Steven Whitehouse
Quoted 1 line
From
539e5d6b7ae8612c0393fe940d2da5b591318d3dMon Sep 17 00:00:00 2001From: Steven Whitehouse <[email protected]>
Date: Tue, 31 Oct 2006 15:07:05 -0500
Subject: [PATCH] [GFS2] Change argument ofgfs2_dinode_outEverywhere this was called, a struct
gfs2_inodewas available, but despite that, it was always called with a structgfs2_dinodeas an argument. By making this change it paves the way to start eliminating fields duplicated between the kernel's struct inode and the structgfs2_dinode.
More pointless code churn.
This only makes sense once the file system is working and we have time to do this type of cleanup on against a stable and TESTED code base.
Quoted 377 lines
Signed-off-by Steven Whitehouse <[email protected]>--- fs/gfs2/acl.c | 2 +- fs/gfs2/bmap.c | 12 ++++++------ fs/gfs2/dir.c | 20 ++++++++++---------- fs/gfs2/eattr.c | 14 +++++++------- fs/gfs2/inode.c | 6 +++--- fs/gfs2/ondisk.c | 5 ++++- fs/gfs2/ops_file.c | 2 +- fs/gfs2/ops_inode.c | 10 +++++----- include/linux/gfs2_ondisk.h | 3 ++- 9 files changed, 39 insertions(+), 35 deletions(-)fs/gfs2/acl.c +1
-1@@ -201,7 +201,7 @@ static int munge_mode(struct gfs2_inode (ip->i_di.di_mode & S_IFMT) == (mode & S_IFMT)); ip->i_di.di_mode = mode;gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }fs/gfs2/bmap.c +6
-6@@ -498,7 +498,7 @@ static int gfs2_block_pointers(struct in error =gfs2_meta_inode_buffer (ip, &dibh);if (!error) {gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }set_buffer_new (bh_map);@@ -780,7 +780,7 @@ static int do_strip(struct gfs2_inode *i ip->i_di.di_mtime = ip->i_di.di_ctime =get_seconds (); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);up_write (&ip->i_rw_mutex);@@ -860,7 +860,7 @@ static int do_grow(struct gfs2_inode *ip goto out_end_trans;gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); out_end_trans:@@ -970,7 +970,7 @@ static int trunc_start(struct gfs2_inode ip->i_di.di_size = size; ip->i_di.di_mtime = ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);gfs2_buffer_clear_tail (dibh,sizeof (struct gfs2_dinode ) + size); error =1 ;@@ -983,7 +983,7 @@ static int trunc_start(struct gfs2_inode ip->i_di.di_mtime = ip->i_di.di_ctime =get_seconds (); ip->i_di.di_flags |=GFS2_DIF_TRUNC_IN_PROG ;gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data); } }@@ -1057,7 +1057,7 @@ static int trunc_end(struct gfs2_inode * ip->i_di.di_flags &= ~GFS2_DIF_TRUNC_IN_PROG ;gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); out:fs/gfs2/dir.c +10
-10@@ -132,7 +132,7 @@ static int gfs2_dir_write_stuffed(structif (ip->i_di.di_size < offset + size) ip->i_di.di_size = offset + size; ip->i_di.di_mtime = ip->i_di.di_ctime =get_seconds (); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);@@ -232,7 +232,7 @@ out: ip->i_di.di_mtime = ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);return copied;@@ -907,7 +907,7 @@ static int dir_make_exhash(struct inodefor (x = sdp->sd_hash_ptrs, y =-1 ; x; x >>=1 , y++) ; dip->i_di.di_depth = y; -gfs2_dinode_out (&dip->i_di, dibh->b_data); +gfs2_dinode_out (dip, dibh->b_data);brelse (dibh);@@ -1039,7 +1039,7 @@ static int dir_split_leaf(struct inode * error =gfs2_meta_inode_buffer (dip, &dibh);if (!gfs2_assert_withdraw (GFS2_SB (&dip->i_inode), !error)) { dip->i_di.di_blocks++; -gfs2_dinode_out (&dip->i_di, dibh->b_data); +gfs2_dinode_out (dip, dibh->b_data);brelse (dibh); }@@ -1119,7 +1119,7 @@ static int dir_double_exhash(struct gfs2 error =gfs2_meta_inode_buffer (dip, &dibh);if (!gfs2_assert_withdraw (sdp, !error)) { dip->i_di.di_depth++; -gfs2_dinode_out (&dip->i_di, dibh->b_data); +gfs2_dinode_out (dip, dibh->b_data);brelse (dibh); }@@ -1517,7 +1517,7 @@ static int dir_new_leaf(struct inode *inreturn error;gfs2_trans_add_bh (ip->i_gl, bh,1 ); ip->i_di.di_blocks++; -gfs2_dinode_out (&ip->i_di, bh->b_data); +gfs2_dinode_out (ip, bh->b_data);brelse (bh);return 0 ; }@@ -1561,7 +1561,7 @@ int gfs2_dir_add(struct inode *inode, cogfs2_trans_add_bh (ip->i_gl, bh,1 ); ip->i_di.di_entries++; ip->i_di.di_mtime = ip->i_di.di_ctime =get_seconds (); -gfs2_dinode_out (&ip->i_di, bh->b_data); +gfs2_dinode_out (ip, bh->b_data);brelse (bh); error =0 ;break ;@@ -1647,7 +1647,7 @@ int gfs2_dir_del(struct gfs2_inode *dip,gfs2_trans_add_bh (dip->i_gl, bh,1 ); dip->i_di.di_entries--; dip->i_di.di_mtime = dip->i_di.di_ctime =get_seconds (); -gfs2_dinode_out (&dip->i_di, bh->b_data); +gfs2_dinode_out (dip, bh->b_data);brelse (bh);mark_inode_dirty (&dip->i_inode);@@ -1695,7 +1695,7 @@ int gfs2_dir_mvino(struct gfs2_inode *di } dip->i_di.di_mtime = dip->i_di.di_ctime =get_seconds (); -gfs2_dinode_out (&dip->i_di, bh->b_data); +gfs2_dinode_out (dip, bh->b_data);brelse (bh);return 0 ; }@@ -1875,7 +1875,7 @@ static int leaf_dealloc(struct gfs2_inod goto out_end_trans;gfs2_trans_add_bh (dip->i_gl, dibh,1 ); -gfs2_dinode_out (&dip->i_di, dibh->b_data); +gfs2_dinode_out (dip, dibh->b_data);brelse (dibh); out_end_trans:fs/gfs2/eattr.c +7
-7@@ -302,7 +302,7 @@ static int ea_dealloc_unstuffed(struct gif (!error) { ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }@@ -717,7 +717,7 @@ static int ea_alloc_skeleton(struct gfs2 } ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }@@ -852,7 +852,7 @@ static int ea_set_simple_noalloc(struct } ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); out:gfs2_trans_end (GFS2_SB (&ip->i_inode));@@ -1132,7 +1132,7 @@ static int ea_remove_stuffed(struct gfs2if (!error) { ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }@@ -1287,7 +1287,7 @@ int gfs2_ea_acl_chmod(struct gfs2_inodegfs2_assert_warn (GFS2_SB (&ip->i_inode), !error);gfs2_inode_attr_out (ip);gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }@@ -1397,7 +1397,7 @@ static int ea_dealloc_indirect(struct gf error =gfs2_meta_inode_buffer (ip, &dibh);if (!error) {gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }@@ -1446,7 +1446,7 @@ static int ea_dealloc_block(struct gfs2_ error =gfs2_meta_inode_buffer (ip, &dibh);if (!error) {gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }fs/gfs2/inode.c +3
-3@@ -338,7 +338,7 @@ int gfs2_change_nlink(struct gfs2_inode ip->i_inode.i_nlink = nlink;gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);mark_inode_dirty (&ip->i_inode);@@ -792,7 +792,7 @@ static int link_dinode(struct gfs2_inode goto fail_end_trans; ip->i_di.di_nlink =1 ;gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);return 0 ;@@ -1349,7 +1349,7 @@ __gfs2_setattr_simple(struct gfs2_inodegfs2_inode_attr_out (ip);gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }return error;fs/gfs2/ondisk.c +4
-1@@ -15,6 +15,8 @@ #include <linux/buffer_head.h>#include "gfs2.h" #include <linux/gfs2_ondisk.h> +#include <linux/lm_interface.h> +#include "incore.h" #define pv (struct, member, fmt) printk(KERN_INFO " "#member" = "fmt"\n", \ struct->member);@@ -187,8 +189,9 @@ void gfs2_dinode_in(struct gfs2_dinode_h } -void gfs2_dinode_out (const struct gfs2_dinode_host *di,void *buf) +void gfs2_dinode_out (const struct gfs2_inode *ip,void *buf) { +const struct gfs2_dinode_host *di = &ip->i_di;struct gfs2_dinode *str = buf;gfs2_meta_header_out (&di->di_header, buf);fs/gfs2/ops_file.c +1
-1@@ -336,7 +336,7 @@ static int do_gfs2_set_flags(struct file goto out_trans_end;gfs2_trans_add_bh (ip->i_gl, bh,1 ); ip->i_di.di_flags = new_flags; -gfs2_dinode_out (&ip->i_di, bh->b_data); +gfs2_dinode_out (ip, bh->b_data);brelse (bh); out_trans_end:gfs2_trans_end (sdp);fs/gfs2/ops_inode.c +5
-5@@ -339,7 +339,7 @@ static int gfs2_symlink(struct inode *di error =gfs2_meta_inode_buffer (ip, &dibh);if (!gfs2_assert_withdraw (sdp, !error)) { -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);memcpy (dibh->b_data +sizeof (struct gfs2_dinode ), symname, size);brelse (dibh);@@ -414,7 +414,7 @@ static int gfs2_mkdir(struct inode *dir,gfs2_inum_out (&dip->i_num, &dent->de_inum); dent->de_type =cpu_to_be16 (DT_DIR ); -gfs2_dinode_out (&ip->i_di, di); +gfs2_dinode_out (ip, di);brelse (dibh); }@@ -541,7 +541,7 @@ static int gfs2_mknod(struct inode *dir, error =gfs2_meta_inode_buffer (ip, &dibh);if (!gfs2_assert_withdraw (sdp, !error)) { -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }@@ -762,7 +762,7 @@ static int gfs2_rename(struct inode *odi goto out_end_trans; ip->i_di.di_ctime =get_seconds ();gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh); }@@ -949,7 +949,7 @@ static int setattr_chown(struct inode *igfs2_inode_attr_out (ip);gfs2_trans_add_bh (ip->i_gl, dibh,1 ); -gfs2_dinode_out (&ip->i_di, dibh->b_data); +gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);if (ouid !=NO_QUOTA_CHANGE || ogid !=NO_QUOTA_CHANGE ) {include/linux/gfs2_ondisk.h +2
-1@@ -535,7 +535,8 @@ extern void gfs2_rgrp_in(struct gfs2_rgrextern void gfs2_rgrp_out (const struct gfs2_rgrp_host *rg,void *buf);extern void gfs2_quota_in (struct gfs2_quota_host *qu,const void *buf);extern void gfs2_dinode_in (struct gfs2_dinode_host *di,const void *buf); -extern void gfs2_dinode_out (const struct gfs2_dinode_host *di,void *buf); +struct gfs2_inode ; +extern void gfs2_dinode_out (const struct gfs2_inode *ip,void *buf);extern void gfs2_ea_header_in (struct gfs2_ea_header *ea,const void *buf);extern void gfs2_ea_header_out (const struct gfs2_ea_header *ea,void *buf);extern void gfs2_log_header_in (struct gfs2_log_header_host *lh,const void *buf);
Signature · 8 lines
Russell Cattelan <[email protected]> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20061201/bc09887c/attachment.sig>
Quoted 11 lines · Russell Cattelan
Quoted 10 lines · Steven Whitehouse
Quoted 1 line
From
539e5d6b7ae8612c0393fe940d2da5b591318d3dMon Sep 17 00:00:00 2001From: Steven Whitehouse <[email protected]>
Date: Tue, 31 Oct 2006 15:07:05 -0500
Subject: [PATCH] [GFS2] Change argument ofgfs2_dinode_outEverywhere this was called, a struct
gfs2_inodewas available, but despite that, it was always called with a structgfs2_dinodeas an argument. By making this change it paves the way to start eliminating fields duplicated between the kernel's struct inode and the structgfs2_dinode.
Quoted 5 lines
More pointless code churn.
This only makes sense once the file system is working and we have time to do this type of cleanup on against a stable and TESTED code base.
Bzzert. Cleaner code is easier to _get_ stable. "Keep it ucking fugly until everyone stops looking at it out of sheer disgust" is a bad idea.
Quoted 12 lines · Al Viro
Quoted 11 lines · Russell Cattelan
Quoted 10 lines · Steven Whitehouse
Quoted 1 line
From
539e5d6b7ae8612c0393fe940d2da5b591318d3dMon Sep 17 00:00:00 2001From: Steven Whitehouse <[email protected]>
Date: Tue, 31 Oct 2006 15:07:05 -0500
Subject: [PATCH] [GFS2] Change argument ofgfs2_dinode_outEverywhere this was called, a struct
gfs2_inodewas available, but despite that, it was always called with a structgfs2_dinodeas an argument. By making this change it paves the way to start eliminating fields duplicated between the kernel's struct inode and the structgfs2_dinode.
Quoted 8 lines
Quoted 5 lines
More pointless code churn.
This only makes sense once the file system is working and we have time to do this type of cleanup on against a stable and TESTED code base.
Bzzert. Cleaner code is easier to _get_ stable. "Keep it ucking fugly until everyone stops looking at it out of sheer disgust" is a bad idea.'
code clean up are not without risk and with no regression test suite to verify
that a "cleanup" has not broken something. Cleanups are very much a hindrance to stabilization. With no know working points in a code history it becomes difficult
to bisect changes and figure out when bugs were introduced Especially when cleanups are mixed in with bug fixes.
Pretty code does not equal correct code.
Signature · 8 lines
Russell Cattelan <[email protected]> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20061201/d6afc3e1/attachment.sig>
Quoted 9 lines · Russell Cattelan
code clean up are not without risk and with no regression test suite to verify
that a "cleanup" has not broken something. Cleanups are very much a hindrance to stabilization. With no know working points in a code history it becomes difficult
to bisect changes and figure out when bugs were introduced Especially when cleanups are mixed in with bug fixes.Pretty code does not equal correct code.
No, but convoluted and unreadable code ends up being crappier due to lack of review. And that's aside of the memory footprint, likeliness of bugs introduced by code modifications (having in-core and on-disk data structures with different contents and the same C type => trouble that won't be caught by compiler), etc.
Quoted 9 lines · Al Viro
Quoted 8 lines · Russell Cattelan
code clean up are not without risk and with no regression test suite to verify
that a "cleanup" has not broken something. Cleanups are very much a hindrance to stabilization. With no know working points in a code history it becomes difficult
to bisect changes and figure out when bugs were introduced Especially when cleanups are mixed in with bug fixes.
Quoted 7 lines
Quoted 1 line
Pretty code does not equal correct code.
No, but convoluted and unreadable code ends up being crappier due to lack of review. And that's aside of the memory footprint, likeliness of bugs introduced by code modifications (having in-core and on-disk data structures with different contents and the same C type => trouble that won't be caught by compiler), etc.
Nothing makes up for the complete lack of GFS2 testing. reviewed code does not equal correct code either.
Honestly tell me what test suite do you run on GFS2?
Sure is it possible to make an educated guess that some cleanups will not destabilize the code. Indeed the stuff you have done is quite useful to ensure that endian bugs are being caught by the compiler/sparse.
But no amount of "it shouldn't break anything" assertions can replace testing.
But there is a large quantity of the 70 or so patches that were sent out were to enable "future" cleanup's. Putting in partial cleanups do nothing core code readability and I many cases is more confusing. Unless you meticulously keep up with the partial cleanups looking at the code is now a jumbled mess of inconsistencies.
gfs2 is supposed to be stabilized and use-able for the up coming rhel5 release, not pretty up for somebody to print out and hang on their wall.
Signature · 8 lines
Russell Cattelan <[email protected]> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20061201/a456dac2/attachment.sig>
Quoted 2 lines · Russell Cattelan
gfs2 is supposed to be stabilized and use-able for the up coming rhel5 release, not pretty up for somebody to print out and hang on their wall.
Your insight, sir, is truly stunning. That is to say, it reminds of a sudden and unpleasant contact with something dense and misplaced. May I direct your attention to the fact that rhel5 is quite unlikely to be based on 2.6.20?
Quoted 9 lines · Al Viro
Quoted 4 lines · Russell Cattelan
gfs2 is supposed to be stabilized and use-able for the up coming rhel5 release, not pretty up for somebody to print out and hang on their wall.
Quoted 6 lines
Your insight, sir, is truly stunning. That is to say, it reminds of a sudden and unpleasant contact with something dense and misplaced. May I direct your attention to the fact that rhel5 is quite unlikely to be based on 2.6.20?
Ok your right rhel5 has no bearing on what goes into 2.6.20. And again I not taking issues with any of the cleanups you sent in they were complete and addressed real potential problems.
Just trying to point out stablizing and bug fixing over partial cleanups would be more helpful for gfs2 in general, for whatever kernel it is running in.
Quoted 7 lines · Russell Cattelan
Ok your right rhel5 has no bearing on what goes into 2.6.20. And again I not taking issues with any of the cleanups you sent in they were complete and addressed real potential problems.
Just trying to point out stablizing and bug fixing over partial cleanups would be more helpful
for gfs2 in general, for whatever kernel it is running in.
The right thing would have been to no put in gfs2 too early. According to you it's unstable, it's not endian annotated which is mormally required and I can't remember a filesystem developer doing a full review of it either.
Unfortunately your employer pushed it very hard and got it in prematurely.
Quoted 2 lines
The right thing would have been to no put in gfs2 too early. According to you it's unstable.
I would note that Russell is expressing his own slightly odd view not a company one, nor afaik the view of any of the mainstream GFS2 team.
Hi!
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
code clean up are not without risk and with no regression test suite to verify
that a "cleanup" has not broken something. Cleanups are very much a hindrance to stabilization. With no know working points in a code history it becomes difficult
to bisect changes and figure out when bugs were introduced Especially when cleanups are mixed in with bug fixes.Pretty code does not equal correct code.
Quoted 8 lines
Quoted 5 lines
No, but convoluted and unreadable code ends up being crappier due to lack of review. And that's aside of the memory footprint, likeliness of bugs introduced by code modifications (having in-core and on-disk data structures with different contents and the same C type => trouble that won't be caught by compiler), etc.
Nothing makes up for the complete lack of GFS2 testing. reviewed code does not equal correct code either.
Tested code does not equal correct code, either.
Quoted 2 lines
gfs2 is supposed to be stabilized and use-able for the up coming rhel5 release, not pretty up for somebody to print out and hang on their wall.
Feel free to keep rhel5 ugly, but we are talking mainline here.
Pavel
Signature · 1 line
Thanks for all the (sleeping) penguins.
Quoted 1 line · Pavel Machek
Feel free to keep rhel5 ugly,
Oh no he won't. We review patches internally, too :)
Signature · 3 lines
Politics is the struggle between those who want to make their country the best in the world, and those who believe it already is. Each group calls the other unpatriotic.
Hi,
Quoted 11 lines · Russell Cattelan
Quoted 10 lines · Steven Whitehouse
Quoted 1 line
From
539e5d6b7ae8612c0393fe940d2da5b591318d3dMon Sep 17 00:00:00 2001From: Steven Whitehouse <[email protected]>
Date: Tue, 31 Oct 2006 15:07:05 -0500
Subject: [PATCH] [GFS2] Change argument ofgfs2_dinode_outEverywhere this was called, a struct
gfs2_inodewas available, but despite that, it was always called with a structgfs2_dinodeas an argument. By making this change it paves the way to start eliminating fields duplicated between the kernel's struct inode and the structgfs2_dinode.
Quoted 6 lines
More pointless code churn.
This only makes sense once the file system is working and we have time to do this type of cleanup on against a stable and TESTED code base.
I disagree and refer you to the comments from Al Viro and Pavel Machek on this subject,
Steve.