aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2008-11-04 05:05:22 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2009-01-05 02:38:59 -0500
commit383f01fbf4a701b73f5e35ea805ed1700b4b4db9 (patch)
treeb2b7a1a188088f319a29e8cc4cc924490837352b
parentc9e98886776386f1f7828d9685e78cd341849867 (diff)
GFS2: Banish struct gfs2_dinode_host
The final field in gfs2_dinode_host was the i_flags field. Thats renamed to i_diskflags in order to avoid confusion with the existing inode flags, and moved into the inode proper at a suitable location to avoid creating a "hole". At that point struct gfs2_dinode_host is no longer needed and as promised (quite some time ago!) it can now be removed completely. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
-rw-r--r--fs/gfs2/bmap.c4
-rw-r--r--fs/gfs2/dir.c16
-rw-r--r--fs/gfs2/eattr.c14
-rw-r--r--fs/gfs2/glops.c2
-rw-r--r--fs/gfs2/incore.h7
-rw-r--r--fs/gfs2/inode.c16
-rw-r--r--fs/gfs2/inode.h2
-rw-r--r--fs/gfs2/ops_export.c2
-rw-r--r--fs/gfs2/ops_file.c17
-rw-r--r--fs/gfs2/ops_inode.c2
-rw-r--r--fs/gfs2/ops_super.c2
-rw-r--r--fs/gfs2/quota.c2
12 files changed, 38 insertions, 48 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index b43aee75d3c2..789f28cfdc20 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -1047,7 +1047,7 @@ static int trunc_start(struct gfs2_inode *ip, u64 size)
1047 if (!error) { 1047 if (!error) {
1048 ip->i_disksize = size; 1048 ip->i_disksize = size;
1049 ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; 1049 ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME;
1050 ip->i_di.di_flags |= GFS2_DIF_TRUNC_IN_PROG; 1050 ip->i_diskflags |= GFS2_DIF_TRUNC_IN_PROG;
1051 gfs2_trans_add_bh(ip->i_gl, dibh, 1); 1051 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
1052 gfs2_dinode_out(ip, dibh->b_data); 1052 gfs2_dinode_out(ip, dibh->b_data);
1053 } 1053 }
@@ -1120,7 +1120,7 @@ static int trunc_end(struct gfs2_inode *ip)
1120 gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); 1120 gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode));
1121 } 1121 }
1122 ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; 1122 ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME;
1123 ip->i_di.di_flags &= ~GFS2_DIF_TRUNC_IN_PROG; 1123 ip->i_diskflags &= ~GFS2_DIF_TRUNC_IN_PROG;
1124 1124
1125 gfs2_trans_add_bh(ip->i_gl, dibh, 1); 1125 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
1126 gfs2_dinode_out(ip, dibh->b_data); 1126 gfs2_dinode_out(ip, dibh->b_data);
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index d8d823240542..b7c8e5c70791 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -36,7 +36,7 @@
36 * the block. In leaves, they begin at offset sizeof(struct gfs2_leaf) from the 36 * the block. In leaves, they begin at offset sizeof(struct gfs2_leaf) from the
37 * beginning of the leaf block. The dirents reside in leaves when 37 * beginning of the leaf block. The dirents reside in leaves when
38 * 38 *
39 * dip->i_di.di_flags & GFS2_DIF_EXHASH is true 39 * dip->i_diskflags & GFS2_DIF_EXHASH is true
40 * 40 *
41 * Otherwise, the dirents are "linear", within a single stuffed dinode block. 41 * Otherwise, the dirents are "linear", within a single stuffed dinode block.
42 * 42 *
@@ -755,7 +755,7 @@ static struct gfs2_dirent *gfs2_dirent_search(struct inode *inode,
755 struct gfs2_inode *ip = GFS2_I(inode); 755 struct gfs2_inode *ip = GFS2_I(inode);
756 int error; 756 int error;
757 757
758 if (ip->i_di.di_flags & GFS2_DIF_EXHASH) { 758 if (ip->i_diskflags & GFS2_DIF_EXHASH) {
759 struct gfs2_leaf *leaf; 759 struct gfs2_leaf *leaf;
760 unsigned hsize = 1 << ip->i_depth; 760 unsigned hsize = 1 << ip->i_depth;
761 unsigned index; 761 unsigned index;
@@ -907,7 +907,7 @@ static int dir_make_exhash(struct inode *inode)
907 907
908 dip->i_disksize = sdp->sd_sb.sb_bsize / 2; 908 dip->i_disksize = sdp->sd_sb.sb_bsize / 2;
909 gfs2_add_inode_blocks(&dip->i_inode, 1); 909 gfs2_add_inode_blocks(&dip->i_inode, 1);
910 dip->i_di.di_flags |= GFS2_DIF_EXHASH; 910 dip->i_diskflags |= GFS2_DIF_EXHASH;
911 911
912 for (x = sdp->sd_hash_ptrs, y = -1; x; x >>= 1, y++) ; 912 for (x = sdp->sd_hash_ptrs, y = -1; x; x >>= 1, y++) ;
913 dip->i_depth = y; 913 dip->i_depth = y;
@@ -1429,7 +1429,7 @@ int gfs2_dir_read(struct inode *inode, u64 *offset, void *opaque,
1429 if (!dip->i_entries) 1429 if (!dip->i_entries)
1430 return 0; 1430 return 0;
1431 1431
1432 if (dip->i_di.di_flags & GFS2_DIF_EXHASH) 1432 if (dip->i_diskflags & GFS2_DIF_EXHASH)
1433 return dir_e_read(inode, offset, opaque, filldir); 1433 return dir_e_read(inode, offset, opaque, filldir);
1434 1434
1435 if (!gfs2_is_stuffed(dip)) { 1435 if (!gfs2_is_stuffed(dip)) {
@@ -1612,7 +1612,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name,
1612 dent = gfs2_init_dirent(inode, dent, name, bh); 1612 dent = gfs2_init_dirent(inode, dent, name, bh);
1613 gfs2_inum_out(nip, dent); 1613 gfs2_inum_out(nip, dent);
1614 dent->de_type = cpu_to_be16(type); 1614 dent->de_type = cpu_to_be16(type);
1615 if (ip->i_di.di_flags & GFS2_DIF_EXHASH) { 1615 if (ip->i_diskflags & GFS2_DIF_EXHASH) {
1616 leaf = (struct gfs2_leaf *)bh->b_data; 1616 leaf = (struct gfs2_leaf *)bh->b_data;
1617 be16_add_cpu(&leaf->lf_entries, 1); 1617 be16_add_cpu(&leaf->lf_entries, 1);
1618 } 1618 }
@@ -1628,7 +1628,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name,
1628 error = 0; 1628 error = 0;
1629 break; 1629 break;
1630 } 1630 }
1631 if (!(ip->i_di.di_flags & GFS2_DIF_EXHASH)) { 1631 if (!(ip->i_diskflags & GFS2_DIF_EXHASH)) {
1632 error = dir_make_exhash(inode); 1632 error = dir_make_exhash(inode);
1633 if (error) 1633 if (error)
1634 break; 1634 break;
@@ -1691,7 +1691,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct qstr *name)
1691 } 1691 }
1692 1692
1693 dirent_del(dip, bh, prev, dent); 1693 dirent_del(dip, bh, prev, dent);
1694 if (dip->i_di.di_flags & GFS2_DIF_EXHASH) { 1694 if (dip->i_diskflags & GFS2_DIF_EXHASH) {
1695 struct gfs2_leaf *leaf = (struct gfs2_leaf *)bh->b_data; 1695 struct gfs2_leaf *leaf = (struct gfs2_leaf *)bh->b_data;
1696 u16 entries = be16_to_cpu(leaf->lf_entries); 1696 u16 entries = be16_to_cpu(leaf->lf_entries);
1697 if (!entries) 1697 if (!entries)
@@ -1748,7 +1748,7 @@ int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename,
1748 gfs2_inum_out(nip, dent); 1748 gfs2_inum_out(nip, dent);
1749 dent->de_type = cpu_to_be16(new_type); 1749 dent->de_type = cpu_to_be16(new_type);
1750 1750
1751 if (dip->i_di.di_flags & GFS2_DIF_EXHASH) { 1751 if (dip->i_diskflags & GFS2_DIF_EXHASH) {
1752 brelse(bh); 1752 brelse(bh);
1753 error = gfs2_meta_inode_buffer(dip, &bh); 1753 error = gfs2_meta_inode_buffer(dip, &bh);
1754 if (error) 1754 if (error)
diff --git a/fs/gfs2/eattr.c b/fs/gfs2/eattr.c
index 1c1e06136aaa..0d1c76d906ae 100644
--- a/fs/gfs2/eattr.c
+++ b/fs/gfs2/eattr.c
@@ -118,7 +118,7 @@ static int ea_foreach(struct gfs2_inode *ip, ea_call_t ea_call, void *data)
118 if (error) 118 if (error)
119 return error; 119 return error;
120 120
121 if (!(ip->i_di.di_flags & GFS2_DIF_EA_INDIRECT)) { 121 if (!(ip->i_diskflags & GFS2_DIF_EA_INDIRECT)) {
122 error = ea_foreach_i(ip, bh, ea_call, data); 122 error = ea_foreach_i(ip, bh, ea_call, data);
123 goto out; 123 goto out;
124 } 124 }
@@ -935,7 +935,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
935 int error; 935 int error;
936 int mh_size = sizeof(struct gfs2_meta_header); 936 int mh_size = sizeof(struct gfs2_meta_header);
937 937
938 if (ip->i_di.di_flags & GFS2_DIF_EA_INDIRECT) { 938 if (ip->i_diskflags & GFS2_DIF_EA_INDIRECT) {
939 __be64 *end; 939 __be64 *end;
940 940
941 error = gfs2_meta_read(ip->i_gl, ip->i_eattr, DIO_WAIT, 941 error = gfs2_meta_read(ip->i_gl, ip->i_eattr, DIO_WAIT,
@@ -974,7 +974,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
974 eablk = (__be64 *)(indbh->b_data + mh_size); 974 eablk = (__be64 *)(indbh->b_data + mh_size);
975 *eablk = cpu_to_be64(ip->i_eattr); 975 *eablk = cpu_to_be64(ip->i_eattr);
976 ip->i_eattr = blk; 976 ip->i_eattr = blk;
977 ip->i_di.di_flags |= GFS2_DIF_EA_INDIRECT; 977 ip->i_diskflags |= GFS2_DIF_EA_INDIRECT;
978 gfs2_add_inode_blocks(&ip->i_inode, 1); 978 gfs2_add_inode_blocks(&ip->i_inode, 1);
979 979
980 eablk++; 980 eablk++;
@@ -1015,7 +1015,7 @@ static int ea_set_i(struct gfs2_inode *ip, struct gfs2_ea_request *er,
1015 if (error) 1015 if (error)
1016 return error; 1016 return error;
1017 1017
1018 if (!(ip->i_di.di_flags & GFS2_DIF_EA_INDIRECT)) 1018 if (!(ip->i_diskflags & GFS2_DIF_EA_INDIRECT))
1019 blks++; 1019 blks++;
1020 if (GFS2_EAREQ_SIZE_STUFFED(er) > GFS2_SB(&ip->i_inode)->sd_jbsize) 1020 if (GFS2_EAREQ_SIZE_STUFFED(er) > GFS2_SB(&ip->i_inode)->sd_jbsize)
1021 blks += DIV_ROUND_UP(er->er_data_len, GFS2_SB(&ip->i_inode)->sd_jbsize); 1021 blks += DIV_ROUND_UP(er->er_data_len, GFS2_SB(&ip->i_inode)->sd_jbsize);
@@ -1051,7 +1051,7 @@ int gfs2_ea_set_i(struct gfs2_inode *ip, struct gfs2_ea_request *er)
1051 return error; 1051 return error;
1052 1052
1053 if (el.el_ea) { 1053 if (el.el_ea) {
1054 if (ip->i_di.di_flags & GFS2_DIF_APPENDONLY) { 1054 if (ip->i_diskflags & GFS2_DIF_APPENDONLY) {
1055 brelse(el.el_bh); 1055 brelse(el.el_bh);
1056 return -EPERM; 1056 return -EPERM;
1057 } 1057 }
@@ -1388,7 +1388,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
1388 if (bstart) 1388 if (bstart)
1389 gfs2_free_meta(ip, bstart, blen); 1389 gfs2_free_meta(ip, bstart, blen);
1390 1390
1391 ip->i_di.di_flags &= ~GFS2_DIF_EA_INDIRECT; 1391 ip->i_diskflags &= ~GFS2_DIF_EA_INDIRECT;
1392 1392
1393 error = gfs2_meta_inode_buffer(ip, &dibh); 1393 error = gfs2_meta_inode_buffer(ip, &dibh);
1394 if (!error) { 1394 if (!error) {
@@ -1479,7 +1479,7 @@ int gfs2_ea_dealloc(struct gfs2_inode *ip)
1479 if (error) 1479 if (error)
1480 goto out_rindex; 1480 goto out_rindex;
1481 1481
1482 if (ip->i_di.di_flags & GFS2_DIF_EA_INDIRECT) { 1482 if (ip->i_diskflags & GFS2_DIF_EA_INDIRECT) {
1483 error = ea_dealloc_indirect(ip); 1483 error = ea_dealloc_indirect(ip);
1484 if (error) 1484 if (error)
1485 goto out_rindex; 1485 goto out_rindex;
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index c6c318c2a0f6..848d64c8b62d 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -239,7 +239,7 @@ static int inode_go_lock(struct gfs2_holder *gh)
239 return error; 239 return error;
240 } 240 }
241 241
242 if ((ip->i_di.di_flags & GFS2_DIF_TRUNC_IN_PROG) && 242 if ((ip->i_diskflags & GFS2_DIF_TRUNC_IN_PROG) &&
243 (gl->gl_state == LM_ST_EXCLUSIVE) && 243 (gl->gl_state == LM_ST_EXCLUSIVE) &&
244 (gh->gh_state == LM_ST_EXCLUSIVE)) 244 (gh->gh_state == LM_ST_EXCLUSIVE))
245 error = gfs2_truncatei_resume(ip); 245 error = gfs2_truncatei_resume(ip);
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 4596cd254be6..6f67e753f883 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -233,9 +233,6 @@ enum {
233 GIF_USER = 4, /* user inode, not metadata addr space */ 233 GIF_USER = 4, /* user inode, not metadata addr space */
234}; 234};
235 235
236struct gfs2_dinode_host {
237 u32 di_flags; /* GFS2_DIF_... */
238};
239 236
240struct gfs2_inode { 237struct gfs2_inode {
241 struct inode i_inode; 238 struct inode i_inode;
@@ -245,9 +242,6 @@ struct gfs2_inode {
245 u64 i_eattr; 242 u64 i_eattr;
246 loff_t i_disksize; 243 loff_t i_disksize;
247 unsigned long i_flags; /* GIF_... */ 244 unsigned long i_flags; /* GIF_... */
248
249 struct gfs2_dinode_host i_di; /* To be replaced by ref to block */
250
251 struct gfs2_glock *i_gl; /* Move into i_gh? */ 245 struct gfs2_glock *i_gl; /* Move into i_gh? */
252 struct gfs2_holder i_iopen_gh; 246 struct gfs2_holder i_iopen_gh;
253 struct gfs2_holder i_gh; /* for prepare/commit_write only */ 247 struct gfs2_holder i_gh; /* for prepare/commit_write only */
@@ -255,6 +249,7 @@ struct gfs2_inode {
255 u64 i_goal; /* goal block for allocations */ 249 u64 i_goal; /* goal block for allocations */
256 struct rw_semaphore i_rw_mutex; 250 struct rw_semaphore i_rw_mutex;
257 u32 i_entries; 251 u32 i_entries;
252 u32 i_diskflags;
258 u8 i_height; 253 u8 i_height;
259 u8 i_depth; 254 u8 i_depth;
260}; 255};
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index baf8b24b2de7..97d3ce65e26f 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -247,7 +247,6 @@ fail:
247 247
248static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) 248static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)
249{ 249{
250 struct gfs2_dinode_host *di = &ip->i_di;
251 const struct gfs2_dinode *str = buf; 250 const struct gfs2_dinode *str = buf;
252 struct timespec atime; 251 struct timespec atime;
253 u16 height, depth; 252 u16 height, depth;
@@ -288,7 +287,7 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)
288 ip->i_goal = be64_to_cpu(str->di_goal_meta); 287 ip->i_goal = be64_to_cpu(str->di_goal_meta);
289 ip->i_generation = be64_to_cpu(str->di_generation); 288 ip->i_generation = be64_to_cpu(str->di_generation);
290 289
291 di->di_flags = be32_to_cpu(str->di_flags); 290 ip->i_diskflags = be32_to_cpu(str->di_flags);
292 gfs2_set_inode_flags(&ip->i_inode); 291 gfs2_set_inode_flags(&ip->i_inode);
293 height = be16_to_cpu(str->di_height); 292 height = be16_to_cpu(str->di_height);
294 if (unlikely(height > GFS2_MAX_META_HEIGHT)) 293 if (unlikely(height > GFS2_MAX_META_HEIGHT))
@@ -789,11 +788,11 @@ static void init_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl,
789 di->di_flags = 0; 788 di->di_flags = 0;
790 789
791 if (S_ISREG(mode)) { 790 if (S_ISREG(mode)) {
792 if ((dip->i_di.di_flags & GFS2_DIF_INHERIT_JDATA) || 791 if ((dip->i_diskflags & GFS2_DIF_INHERIT_JDATA) ||
793 gfs2_tune_get(sdp, gt_new_files_jdata)) 792 gfs2_tune_get(sdp, gt_new_files_jdata))
794 di->di_flags |= cpu_to_be32(GFS2_DIF_JDATA); 793 di->di_flags |= cpu_to_be32(GFS2_DIF_JDATA);
795 } else if (S_ISDIR(mode)) { 794 } else if (S_ISDIR(mode)) {
796 di->di_flags |= cpu_to_be32(dip->i_di.di_flags & 795 di->di_flags |= cpu_to_be32(dip->i_diskflags &
797 GFS2_DIF_INHERIT_JDATA); 796 GFS2_DIF_INHERIT_JDATA);
798 } 797 }
799 798
@@ -1241,7 +1240,6 @@ int gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr)
1241 1240
1242void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf) 1241void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf)
1243{ 1242{
1244 const struct gfs2_dinode_host *di = &ip->i_di;
1245 struct gfs2_dinode *str = buf; 1243 struct gfs2_dinode *str = buf;
1246 1244
1247 str->di_header.mh_magic = cpu_to_be32(GFS2_MAGIC); 1245 str->di_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
@@ -1265,10 +1263,10 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf)
1265 str->di_goal_data = cpu_to_be64(ip->i_goal); 1263 str->di_goal_data = cpu_to_be64(ip->i_goal);
1266 str->di_generation = cpu_to_be64(ip->i_generation); 1264 str->di_generation = cpu_to_be64(ip->i_generation);
1267 1265
1268 str->di_flags = cpu_to_be32(di->di_flags); 1266 str->di_flags = cpu_to_be32(ip->i_diskflags);
1269 str->di_height = cpu_to_be16(ip->i_height); 1267 str->di_height = cpu_to_be16(ip->i_height);
1270 str->di_payload_format = cpu_to_be32(S_ISDIR(ip->i_inode.i_mode) && 1268 str->di_payload_format = cpu_to_be32(S_ISDIR(ip->i_inode.i_mode) &&
1271 !(ip->i_di.di_flags & GFS2_DIF_EXHASH) ? 1269 !(ip->i_diskflags & GFS2_DIF_EXHASH) ?
1272 GFS2_FORMAT_DE : 0); 1270 GFS2_FORMAT_DE : 0);
1273 str->di_depth = cpu_to_be16(ip->i_depth); 1271 str->di_depth = cpu_to_be16(ip->i_depth);
1274 str->di_entries = cpu_to_be32(ip->i_entries); 1272 str->di_entries = cpu_to_be32(ip->i_entries);
@@ -1281,8 +1279,6 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf)
1281 1279
1282void gfs2_dinode_print(const struct gfs2_inode *ip) 1280void gfs2_dinode_print(const struct gfs2_inode *ip)
1283{ 1281{
1284 const struct gfs2_dinode_host *di = &ip->i_di;
1285
1286 printk(KERN_INFO " no_formal_ino = %llu\n", 1282 printk(KERN_INFO " no_formal_ino = %llu\n",
1287 (unsigned long long)ip->i_no_formal_ino); 1283 (unsigned long long)ip->i_no_formal_ino);
1288 printk(KERN_INFO " no_addr = %llu\n", 1284 printk(KERN_INFO " no_addr = %llu\n",
@@ -1293,7 +1289,7 @@ void gfs2_dinode_print(const struct gfs2_inode *ip)
1293 (unsigned long long)gfs2_get_inode_blocks(&ip->i_inode)); 1289 (unsigned long long)gfs2_get_inode_blocks(&ip->i_inode));
1294 printk(KERN_INFO " i_goal = %llu\n", 1290 printk(KERN_INFO " i_goal = %llu\n",
1295 (unsigned long long)ip->i_goal); 1291 (unsigned long long)ip->i_goal);
1296 printk(KERN_INFO " di_flags = 0x%.8X\n", di->di_flags); 1292 printk(KERN_INFO " i_diskflags = 0x%.8X\n", ip->i_diskflags);
1297 printk(KERN_INFO " i_height = %u\n", ip->i_height); 1293 printk(KERN_INFO " i_height = %u\n", ip->i_height);
1298 printk(KERN_INFO " i_depth = %u\n", ip->i_depth); 1294 printk(KERN_INFO " i_depth = %u\n", ip->i_depth);
1299 printk(KERN_INFO " i_entries = %u\n", ip->i_entries); 1295 printk(KERN_INFO " i_entries = %u\n", ip->i_entries);
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h
index c3577906f0ad..d5329364cdff 100644
--- a/fs/gfs2/inode.h
+++ b/fs/gfs2/inode.h
@@ -20,7 +20,7 @@ static inline int gfs2_is_stuffed(const struct gfs2_inode *ip)
20 20
21static inline int gfs2_is_jdata(const struct gfs2_inode *ip) 21static inline int gfs2_is_jdata(const struct gfs2_inode *ip)
22{ 22{
23 return ip->i_di.di_flags & GFS2_DIF_JDATA; 23 return ip->i_diskflags & GFS2_DIF_JDATA;
24} 24}
25 25
26static inline int gfs2_is_writeback(const struct gfs2_inode *ip) 26static inline int gfs2_is_writeback(const struct gfs2_inode *ip)
diff --git a/fs/gfs2/ops_export.c b/fs/gfs2/ops_export.c
index 3a9b9b438344..7fdeb14ddd1a 100644
--- a/fs/gfs2/ops_export.c
+++ b/fs/gfs2/ops_export.c
@@ -213,7 +213,7 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb,
213 } 213 }
214 214
215 error = -EIO; 215 error = -EIO;
216 if (GFS2_I(inode)->i_di.di_flags & GFS2_DIF_SYSTEM) { 216 if (GFS2_I(inode)->i_diskflags & GFS2_DIF_SYSTEM) {
217 iput(inode); 217 iput(inode);
218 goto fail; 218 goto fail;
219 } 219 }
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index d7e649ed62f2..a6b7a733fd4d 100644
--- a/fs/gfs2/ops_file.c
+++ b/fs/gfs2/ops_file.c
@@ -157,8 +157,8 @@ static int gfs2_get_flags(struct file *filp, u32 __user *ptr)
157 if (error) 157 if (error)
158 return error; 158 return error;
159 159
160 fsflags = fsflags_cvt(gfs2_to_fsflags, ip->i_di.di_flags); 160 fsflags = fsflags_cvt(gfs2_to_fsflags, ip->i_diskflags);
161 if (!S_ISDIR(inode->i_mode) && ip->i_di.di_flags & GFS2_DIF_JDATA) 161 if (!S_ISDIR(inode->i_mode) && ip->i_diskflags & GFS2_DIF_JDATA)
162 fsflags |= FS_JOURNAL_DATA_FL; 162 fsflags |= FS_JOURNAL_DATA_FL;
163 if (put_user(fsflags, ptr)) 163 if (put_user(fsflags, ptr))
164 error = -EFAULT; 164 error = -EFAULT;
@@ -171,17 +171,16 @@ static int gfs2_get_flags(struct file *filp, u32 __user *ptr)
171void gfs2_set_inode_flags(struct inode *inode) 171void gfs2_set_inode_flags(struct inode *inode)
172{ 172{
173 struct gfs2_inode *ip = GFS2_I(inode); 173 struct gfs2_inode *ip = GFS2_I(inode);
174 struct gfs2_dinode_host *di = &ip->i_di;
175 unsigned int flags = inode->i_flags; 174 unsigned int flags = inode->i_flags;
176 175
177 flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC); 176 flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC);
178 if (di->di_flags & GFS2_DIF_IMMUTABLE) 177 if (ip->i_diskflags & GFS2_DIF_IMMUTABLE)
179 flags |= S_IMMUTABLE; 178 flags |= S_IMMUTABLE;
180 if (di->di_flags & GFS2_DIF_APPENDONLY) 179 if (ip->i_diskflags & GFS2_DIF_APPENDONLY)
181 flags |= S_APPEND; 180 flags |= S_APPEND;
182 if (di->di_flags & GFS2_DIF_NOATIME) 181 if (ip->i_diskflags & GFS2_DIF_NOATIME)
183 flags |= S_NOATIME; 182 flags |= S_NOATIME;
184 if (di->di_flags & GFS2_DIF_SYNC) 183 if (ip->i_diskflags & GFS2_DIF_SYNC)
185 flags |= S_SYNC; 184 flags |= S_SYNC;
186 inode->i_flags = flags; 185 inode->i_flags = flags;
187} 186}
@@ -220,7 +219,7 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask)
220 if (error) 219 if (error)
221 goto out_drop_write; 220 goto out_drop_write;
222 221
223 flags = ip->i_di.di_flags; 222 flags = ip->i_diskflags;
224 new_flags = (flags & ~mask) | (reqflags & mask); 223 new_flags = (flags & ~mask) | (reqflags & mask);
225 if ((new_flags ^ flags) == 0) 224 if ((new_flags ^ flags) == 0)
226 goto out; 225 goto out;
@@ -259,7 +258,7 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask)
259 if (error) 258 if (error)
260 goto out_trans_end; 259 goto out_trans_end;
261 gfs2_trans_add_bh(ip->i_gl, bh, 1); 260 gfs2_trans_add_bh(ip->i_gl, bh, 1);
262 ip->i_di.di_flags = new_flags; 261 ip->i_diskflags = new_flags;
263 gfs2_dinode_out(ip, bh->b_data); 262 gfs2_dinode_out(ip, bh->b_data);
264 brelse(bh); 263 brelse(bh);
265 gfs2_set_inode_flags(inode); 264 gfs2_set_inode_flags(inode);
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index b932d72b5f5b..49877546beb9 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -426,7 +426,7 @@ static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, int mode)
426 426
427 ip->i_inode.i_nlink = 2; 427 ip->i_inode.i_nlink = 2;
428 ip->i_disksize = sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode); 428 ip->i_disksize = sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode);
429 ip->i_di.di_flags |= GFS2_DIF_JDATA; 429 ip->i_diskflags |= GFS2_DIF_JDATA;
430 ip->i_entries = 2; 430 ip->i_entries = 2;
431 431
432 error = gfs2_meta_inode_buffer(ip, &dibh); 432 error = gfs2_meta_inode_buffer(ip, &dibh);
diff --git a/fs/gfs2/ops_super.c b/fs/gfs2/ops_super.c
index aee6cbaf58df..ad36af254fee 100644
--- a/fs/gfs2/ops_super.c
+++ b/fs/gfs2/ops_super.c
@@ -496,7 +496,7 @@ static void gfs2_delete_inode(struct inode *inode)
496 goto out_truncate; 496 goto out_truncate;
497 497
498 if (S_ISDIR(inode->i_mode) && 498 if (S_ISDIR(inode->i_mode) &&
499 (ip->i_di.di_flags & GFS2_DIF_EXHASH)) { 499 (ip->i_diskflags & GFS2_DIF_EXHASH)) {
500 error = gfs2_dir_exhash_dealloc(ip); 500 error = gfs2_dir_exhash_dealloc(ip);
501 if (error) 501 if (error)
502 goto out_unlock; 502 goto out_unlock;
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 188d0a277fa3..228a46596188 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -1013,7 +1013,7 @@ void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
1013 1013
1014 if (gfs2_assert_warn(GFS2_SB(&ip->i_inode), change)) 1014 if (gfs2_assert_warn(GFS2_SB(&ip->i_inode), change))
1015 return; 1015 return;
1016 if (ip->i_di.di_flags & GFS2_DIF_SYSTEM) 1016 if (ip->i_diskflags & GFS2_DIF_SYSTEM)
1017 return; 1017 return;
1018 1018
1019 for (x = 0; x < al->al_qd_num; x++) { 1019 for (x = 0; x < al->al_qd_num; x++) {