diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-11-04 04:47:33 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2009-01-05 02:38:58 -0500 |
commit | c9e98886776386f1f7828d9685e78cd341849867 (patch) | |
tree | 5bf4ac819d1e9394f960f21a48881a9d2f9f69fe /fs/gfs2 | |
parent | 3767ac21f471fe669a7d9f6abef682ddac8fc3d8 (diff) |
GFS2: Move i_size from gfs2_dinode_host and rename it to i_disksize
This patch moved the i_size field from the gfs2_dinode_host and
following the ext3 convention renames it i_disksize.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/bmap.c | 26 | ||||
-rw-r--r-- | fs/gfs2/dir.c | 26 | ||||
-rw-r--r-- | fs/gfs2/incore.h | 2 | ||||
-rw-r--r-- | fs/gfs2/inode.c | 13 | ||||
-rw-r--r-- | fs/gfs2/ops_address.c | 10 | ||||
-rw-r--r-- | fs/gfs2/ops_file.c | 2 | ||||
-rw-r--r-- | fs/gfs2/ops_fstype.c | 2 | ||||
-rw-r--r-- | fs/gfs2/ops_inode.c | 10 | ||||
-rw-r--r-- | fs/gfs2/quota.c | 6 | ||||
-rw-r--r-- | fs/gfs2/rgrp.c | 6 | ||||
-rw-r--r-- | fs/gfs2/super.c | 8 |
11 files changed, 56 insertions, 55 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index bec76b1c2bb0..b43aee75d3c2 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c | |||
@@ -75,9 +75,9 @@ static int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh, | |||
75 | void *kaddr = kmap(page); | 75 | void *kaddr = kmap(page); |
76 | 76 | ||
77 | memcpy(kaddr, dibh->b_data + sizeof(struct gfs2_dinode), | 77 | memcpy(kaddr, dibh->b_data + sizeof(struct gfs2_dinode), |
78 | ip->i_di.di_size); | 78 | ip->i_disksize); |
79 | memset(kaddr + ip->i_di.di_size, 0, | 79 | memset(kaddr + ip->i_disksize, 0, |
80 | PAGE_CACHE_SIZE - ip->i_di.di_size); | 80 | PAGE_CACHE_SIZE - ip->i_disksize); |
81 | kunmap(page); | 81 | kunmap(page); |
82 | 82 | ||
83 | SetPageUptodate(page); | 83 | SetPageUptodate(page); |
@@ -132,7 +132,7 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page) | |||
132 | if (error) | 132 | if (error) |
133 | goto out; | 133 | goto out; |
134 | 134 | ||
135 | if (ip->i_di.di_size) { | 135 | if (ip->i_disksize) { |
136 | /* Get a free block, fill it with the stuffed data, | 136 | /* Get a free block, fill it with the stuffed data, |
137 | and write it out to disk */ | 137 | and write it out to disk */ |
138 | 138 | ||
@@ -159,7 +159,7 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page) | |||
159 | di = (struct gfs2_dinode *)dibh->b_data; | 159 | di = (struct gfs2_dinode *)dibh->b_data; |
160 | gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); | 160 | gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); |
161 | 161 | ||
162 | if (ip->i_di.di_size) { | 162 | if (ip->i_disksize) { |
163 | *(__be64 *)(di + 1) = cpu_to_be64(block); | 163 | *(__be64 *)(di + 1) = cpu_to_be64(block); |
164 | gfs2_add_inode_blocks(&ip->i_inode, 1); | 164 | gfs2_add_inode_blocks(&ip->i_inode, 1); |
165 | di->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode)); | 165 | di->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode)); |
@@ -926,7 +926,7 @@ static int do_grow(struct gfs2_inode *ip, u64 size) | |||
926 | } | 926 | } |
927 | } | 927 | } |
928 | 928 | ||
929 | ip->i_di.di_size = size; | 929 | ip->i_disksize = size; |
930 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; | 930 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; |
931 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); | 931 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); |
932 | gfs2_dinode_out(ip, dibh->b_data); | 932 | gfs2_dinode_out(ip, dibh->b_data); |
@@ -1033,7 +1033,7 @@ static int trunc_start(struct gfs2_inode *ip, u64 size) | |||
1033 | goto out; | 1033 | goto out; |
1034 | 1034 | ||
1035 | if (gfs2_is_stuffed(ip)) { | 1035 | if (gfs2_is_stuffed(ip)) { |
1036 | ip->i_di.di_size = size; | 1036 | ip->i_disksize = size; |
1037 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; | 1037 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; |
1038 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); | 1038 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); |
1039 | gfs2_dinode_out(ip, dibh->b_data); | 1039 | gfs2_dinode_out(ip, dibh->b_data); |
@@ -1045,7 +1045,7 @@ static int trunc_start(struct gfs2_inode *ip, u64 size) | |||
1045 | error = gfs2_block_truncate_page(ip->i_inode.i_mapping); | 1045 | error = gfs2_block_truncate_page(ip->i_inode.i_mapping); |
1046 | 1046 | ||
1047 | if (!error) { | 1047 | if (!error) { |
1048 | ip->i_di.di_size = 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_di.di_flags |= 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); |
@@ -1114,7 +1114,7 @@ static int trunc_end(struct gfs2_inode *ip) | |||
1114 | if (error) | 1114 | if (error) |
1115 | goto out; | 1115 | goto out; |
1116 | 1116 | ||
1117 | if (!ip->i_di.di_size) { | 1117 | if (!ip->i_disksize) { |
1118 | ip->i_height = 0; | 1118 | ip->i_height = 0; |
1119 | ip->i_goal = ip->i_no_addr; | 1119 | ip->i_goal = ip->i_no_addr; |
1120 | gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); | 1120 | gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); |
@@ -1205,9 +1205,9 @@ int gfs2_truncatei(struct gfs2_inode *ip, u64 size) | |||
1205 | if (gfs2_assert_warn(GFS2_SB(&ip->i_inode), S_ISREG(ip->i_inode.i_mode))) | 1205 | if (gfs2_assert_warn(GFS2_SB(&ip->i_inode), S_ISREG(ip->i_inode.i_mode))) |
1206 | return -EINVAL; | 1206 | return -EINVAL; |
1207 | 1207 | ||
1208 | if (size > ip->i_di.di_size) | 1208 | if (size > ip->i_disksize) |
1209 | error = do_grow(ip, size); | 1209 | error = do_grow(ip, size); |
1210 | else if (size < ip->i_di.di_size) | 1210 | else if (size < ip->i_disksize) |
1211 | error = do_shrink(ip, size); | 1211 | error = do_shrink(ip, size); |
1212 | else | 1212 | else |
1213 | /* update time stamps */ | 1213 | /* update time stamps */ |
@@ -1219,7 +1219,7 @@ int gfs2_truncatei(struct gfs2_inode *ip, u64 size) | |||
1219 | int gfs2_truncatei_resume(struct gfs2_inode *ip) | 1219 | int gfs2_truncatei_resume(struct gfs2_inode *ip) |
1220 | { | 1220 | { |
1221 | int error; | 1221 | int error; |
1222 | error = trunc_dealloc(ip, ip->i_di.di_size); | 1222 | error = trunc_dealloc(ip, ip->i_disksize); |
1223 | if (!error) | 1223 | if (!error) |
1224 | error = trunc_end(ip); | 1224 | error = trunc_end(ip); |
1225 | return error; | 1225 | return error; |
@@ -1298,7 +1298,7 @@ int gfs2_write_alloc_required(struct gfs2_inode *ip, u64 offset, | |||
1298 | lblock_stop = offset + len + bsize - 1; | 1298 | lblock_stop = offset + len + bsize - 1; |
1299 | do_div(lblock_stop, bsize); | 1299 | do_div(lblock_stop, bsize); |
1300 | } else { | 1300 | } else { |
1301 | u64 end_of_file = (ip->i_di.di_size + sdp->sd_sb.sb_bsize - 1) >> shift; | 1301 | u64 end_of_file = (ip->i_disksize + sdp->sd_sb.sb_bsize - 1) >> shift; |
1302 | lblock = offset >> shift; | 1302 | lblock = offset >> shift; |
1303 | lblock_stop = (offset + len + sdp->sd_sb.sb_bsize - 1) >> shift; | 1303 | lblock_stop = (offset + len + sdp->sd_sb.sb_bsize - 1) >> shift; |
1304 | if (lblock_stop > end_of_file) | 1304 | if (lblock_stop > end_of_file) |
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 830cf48184e3..d8d823240542 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -128,8 +128,8 @@ static int gfs2_dir_write_stuffed(struct gfs2_inode *ip, const char *buf, | |||
128 | 128 | ||
129 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); | 129 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); |
130 | memcpy(dibh->b_data + offset + sizeof(struct gfs2_dinode), buf, size); | 130 | memcpy(dibh->b_data + offset + sizeof(struct gfs2_dinode), buf, size); |
131 | if (ip->i_di.di_size < offset + size) | 131 | if (ip->i_disksize < offset + size) |
132 | ip->i_di.di_size = offset + size; | 132 | ip->i_disksize = offset + size; |
133 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; | 133 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; |
134 | gfs2_dinode_out(ip, dibh->b_data); | 134 | gfs2_dinode_out(ip, dibh->b_data); |
135 | 135 | ||
@@ -226,8 +226,8 @@ out: | |||
226 | if (error) | 226 | if (error) |
227 | return error; | 227 | return error; |
228 | 228 | ||
229 | if (ip->i_di.di_size < offset + copied) | 229 | if (ip->i_disksize < offset + copied) |
230 | ip->i_di.di_size = offset + copied; | 230 | ip->i_disksize = offset + copied; |
231 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; | 231 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; |
232 | 232 | ||
233 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); | 233 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); |
@@ -277,11 +277,11 @@ static int gfs2_dir_read_data(struct gfs2_inode *ip, char *buf, u64 offset, | |||
277 | int copied = 0; | 277 | int copied = 0; |
278 | int error = 0; | 278 | int error = 0; |
279 | 279 | ||
280 | if (offset >= ip->i_di.di_size) | 280 | if (offset >= ip->i_disksize) |
281 | return 0; | 281 | return 0; |
282 | 282 | ||
283 | if (offset + size > ip->i_di.di_size) | 283 | if (offset + size > ip->i_disksize) |
284 | size = ip->i_di.di_size - offset; | 284 | size = ip->i_disksize - offset; |
285 | 285 | ||
286 | if (!size) | 286 | if (!size) |
287 | return 0; | 287 | return 0; |
@@ -760,7 +760,7 @@ static struct gfs2_dirent *gfs2_dirent_search(struct inode *inode, | |||
760 | unsigned hsize = 1 << ip->i_depth; | 760 | unsigned hsize = 1 << ip->i_depth; |
761 | unsigned index; | 761 | unsigned index; |
762 | u64 ln; | 762 | u64 ln; |
763 | if (hsize * sizeof(u64) != ip->i_di.di_size) { | 763 | if (hsize * sizeof(u64) != ip->i_disksize) { |
764 | gfs2_consist_inode(ip); | 764 | gfs2_consist_inode(ip); |
765 | return ERR_PTR(-EIO); | 765 | return ERR_PTR(-EIO); |
766 | } | 766 | } |
@@ -905,7 +905,7 @@ static int dir_make_exhash(struct inode *inode) | |||
905 | for (x = sdp->sd_hash_ptrs; x--; lp++) | 905 | for (x = sdp->sd_hash_ptrs; x--; lp++) |
906 | *lp = cpu_to_be64(bn); | 906 | *lp = cpu_to_be64(bn); |
907 | 907 | ||
908 | dip->i_di.di_size = 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_di.di_flags |= GFS2_DIF_EXHASH; |
911 | 911 | ||
@@ -1082,7 +1082,7 @@ static int dir_double_exhash(struct gfs2_inode *dip) | |||
1082 | int error = 0; | 1082 | int error = 0; |
1083 | 1083 | ||
1084 | hsize = 1 << dip->i_depth; | 1084 | hsize = 1 << dip->i_depth; |
1085 | if (hsize * sizeof(u64) != dip->i_di.di_size) { | 1085 | if (hsize * sizeof(u64) != dip->i_disksize) { |
1086 | gfs2_consist_inode(dip); | 1086 | gfs2_consist_inode(dip); |
1087 | return -EIO; | 1087 | return -EIO; |
1088 | } | 1088 | } |
@@ -1091,7 +1091,7 @@ static int dir_double_exhash(struct gfs2_inode *dip) | |||
1091 | 1091 | ||
1092 | buf = kcalloc(3, sdp->sd_hash_bsize, GFP_NOFS | __GFP_NOFAIL); | 1092 | buf = kcalloc(3, sdp->sd_hash_bsize, GFP_NOFS | __GFP_NOFAIL); |
1093 | 1093 | ||
1094 | for (block = dip->i_di.di_size >> sdp->sd_hash_bsize_shift; block--;) { | 1094 | for (block = dip->i_disksize >> sdp->sd_hash_bsize_shift; block--;) { |
1095 | error = gfs2_dir_read_data(dip, (char *)buf, | 1095 | error = gfs2_dir_read_data(dip, (char *)buf, |
1096 | block * sdp->sd_hash_bsize, | 1096 | block * sdp->sd_hash_bsize, |
1097 | sdp->sd_hash_bsize, 1); | 1097 | sdp->sd_hash_bsize, 1); |
@@ -1370,7 +1370,7 @@ static int dir_e_read(struct inode *inode, u64 *offset, void *opaque, | |||
1370 | unsigned depth = 0; | 1370 | unsigned depth = 0; |
1371 | 1371 | ||
1372 | hsize = 1 << dip->i_depth; | 1372 | hsize = 1 << dip->i_depth; |
1373 | if (hsize * sizeof(u64) != dip->i_di.di_size) { | 1373 | if (hsize * sizeof(u64) != dip->i_disksize) { |
1374 | gfs2_consist_inode(dip); | 1374 | gfs2_consist_inode(dip); |
1375 | return -EIO; | 1375 | return -EIO; |
1376 | } | 1376 | } |
@@ -1784,7 +1784,7 @@ static int foreach_leaf(struct gfs2_inode *dip, leaf_call_t lc, void *data) | |||
1784 | int error = 0; | 1784 | int error = 0; |
1785 | 1785 | ||
1786 | hsize = 1 << dip->i_depth; | 1786 | hsize = 1 << dip->i_depth; |
1787 | if (hsize * sizeof(u64) != dip->i_di.di_size) { | 1787 | if (hsize * sizeof(u64) != dip->i_disksize) { |
1788 | gfs2_consist_inode(dip); | 1788 | gfs2_consist_inode(dip); |
1789 | return -EIO; | 1789 | return -EIO; |
1790 | } | 1790 | } |
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index fb2fd4adaae4..4596cd254be6 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -234,7 +234,6 @@ enum { | |||
234 | }; | 234 | }; |
235 | 235 | ||
236 | struct gfs2_dinode_host { | 236 | struct gfs2_dinode_host { |
237 | u64 di_size; /* number of bytes in file */ | ||
238 | u32 di_flags; /* GFS2_DIF_... */ | 237 | u32 di_flags; /* GFS2_DIF_... */ |
239 | }; | 238 | }; |
240 | 239 | ||
@@ -244,6 +243,7 @@ struct gfs2_inode { | |||
244 | u64 i_no_formal_ino; | 243 | u64 i_no_formal_ino; |
245 | u64 i_generation; | 244 | u64 i_generation; |
246 | u64 i_eattr; | 245 | u64 i_eattr; |
246 | loff_t i_disksize; | ||
247 | unsigned long i_flags; /* GIF_... */ | 247 | unsigned long i_flags; /* GIF_... */ |
248 | 248 | ||
249 | struct gfs2_dinode_host i_di; /* To be replaced by ref to block */ | 249 | struct gfs2_dinode_host i_di; /* To be replaced by ref to block */ |
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 91735b8cecd8..baf8b24b2de7 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -273,8 +273,8 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) | |||
273 | * to do that. | 273 | * to do that. |
274 | */ | 274 | */ |
275 | ip->i_inode.i_nlink = be32_to_cpu(str->di_nlink); | 275 | ip->i_inode.i_nlink = be32_to_cpu(str->di_nlink); |
276 | di->di_size = be64_to_cpu(str->di_size); | 276 | ip->i_disksize = be64_to_cpu(str->di_size); |
277 | i_size_write(&ip->i_inode, di->di_size); | 277 | i_size_write(&ip->i_inode, ip->i_disksize); |
278 | gfs2_set_inode_blocks(&ip->i_inode, be64_to_cpu(str->di_blocks)); | 278 | gfs2_set_inode_blocks(&ip->i_inode, be64_to_cpu(str->di_blocks)); |
279 | atime.tv_sec = be64_to_cpu(str->di_atime); | 279 | atime.tv_sec = be64_to_cpu(str->di_atime); |
280 | atime.tv_nsec = be32_to_cpu(str->di_atime_nsec); | 280 | atime.tv_nsec = be32_to_cpu(str->di_atime_nsec); |
@@ -1167,7 +1167,7 @@ int gfs2_readlinki(struct gfs2_inode *ip, char **buf, unsigned int *len) | |||
1167 | return error; | 1167 | return error; |
1168 | } | 1168 | } |
1169 | 1169 | ||
1170 | if (!ip->i_di.di_size) { | 1170 | if (!ip->i_disksize) { |
1171 | gfs2_consist_inode(ip); | 1171 | gfs2_consist_inode(ip); |
1172 | error = -EIO; | 1172 | error = -EIO; |
1173 | goto out; | 1173 | goto out; |
@@ -1177,7 +1177,7 @@ int gfs2_readlinki(struct gfs2_inode *ip, char **buf, unsigned int *len) | |||
1177 | if (error) | 1177 | if (error) |
1178 | goto out; | 1178 | goto out; |
1179 | 1179 | ||
1180 | x = ip->i_di.di_size + 1; | 1180 | x = ip->i_disksize + 1; |
1181 | if (x > *len) { | 1181 | if (x > *len) { |
1182 | *buf = kmalloc(x, GFP_NOFS); | 1182 | *buf = kmalloc(x, GFP_NOFS); |
1183 | if (!*buf) { | 1183 | if (!*buf) { |
@@ -1255,7 +1255,7 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf) | |||
1255 | str->di_uid = cpu_to_be32(ip->i_inode.i_uid); | 1255 | str->di_uid = cpu_to_be32(ip->i_inode.i_uid); |
1256 | str->di_gid = cpu_to_be32(ip->i_inode.i_gid); | 1256 | str->di_gid = cpu_to_be32(ip->i_inode.i_gid); |
1257 | str->di_nlink = cpu_to_be32(ip->i_inode.i_nlink); | 1257 | str->di_nlink = cpu_to_be32(ip->i_inode.i_nlink); |
1258 | str->di_size = cpu_to_be64(di->di_size); | 1258 | str->di_size = cpu_to_be64(ip->i_disksize); |
1259 | str->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode)); | 1259 | str->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode)); |
1260 | str->di_atime = cpu_to_be64(ip->i_inode.i_atime.tv_sec); | 1260 | str->di_atime = cpu_to_be64(ip->i_inode.i_atime.tv_sec); |
1261 | str->di_mtime = cpu_to_be64(ip->i_inode.i_mtime.tv_sec); | 1261 | str->di_mtime = cpu_to_be64(ip->i_inode.i_mtime.tv_sec); |
@@ -1287,7 +1287,8 @@ void gfs2_dinode_print(const struct gfs2_inode *ip) | |||
1287 | (unsigned long long)ip->i_no_formal_ino); | 1287 | (unsigned long long)ip->i_no_formal_ino); |
1288 | printk(KERN_INFO " no_addr = %llu\n", | 1288 | printk(KERN_INFO " no_addr = %llu\n", |
1289 | (unsigned long long)ip->i_no_addr); | 1289 | (unsigned long long)ip->i_no_addr); |
1290 | printk(KERN_INFO " di_size = %llu\n", (unsigned long long)di->di_size); | 1290 | printk(KERN_INFO " i_disksize = %llu\n", |
1291 | (unsigned long long)ip->i_disksize); | ||
1291 | printk(KERN_INFO " blocks = %llu\n", | 1292 | printk(KERN_INFO " blocks = %llu\n", |
1292 | (unsigned long long)gfs2_get_inode_blocks(&ip->i_inode)); | 1293 | (unsigned long long)gfs2_get_inode_blocks(&ip->i_inode)); |
1293 | printk(KERN_INFO " i_goal = %llu\n", | 1294 | printk(KERN_INFO " i_goal = %llu\n", |
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c index 574b222feefc..0df560f4269a 100644 --- a/fs/gfs2/ops_address.c +++ b/fs/gfs2/ops_address.c | |||
@@ -451,8 +451,8 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page) | |||
451 | 451 | ||
452 | kaddr = kmap_atomic(page, KM_USER0); | 452 | kaddr = kmap_atomic(page, KM_USER0); |
453 | memcpy(kaddr, dibh->b_data + sizeof(struct gfs2_dinode), | 453 | memcpy(kaddr, dibh->b_data + sizeof(struct gfs2_dinode), |
454 | ip->i_di.di_size); | 454 | ip->i_disksize); |
455 | memset(kaddr + ip->i_di.di_size, 0, PAGE_CACHE_SIZE - ip->i_di.di_size); | 455 | memset(kaddr + ip->i_disksize, 0, PAGE_CACHE_SIZE - ip->i_disksize); |
456 | kunmap_atomic(kaddr, KM_USER0); | 456 | kunmap_atomic(kaddr, KM_USER0); |
457 | flush_dcache_page(page); | 457 | flush_dcache_page(page); |
458 | brelse(dibh); | 458 | brelse(dibh); |
@@ -780,7 +780,7 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh, | |||
780 | 780 | ||
781 | if (inode->i_size < to) { | 781 | if (inode->i_size < to) { |
782 | i_size_write(inode, to); | 782 | i_size_write(inode, to); |
783 | ip->i_di.di_size = inode->i_size; | 783 | ip->i_disksize = inode->i_size; |
784 | di->di_size = cpu_to_be64(inode->i_size); | 784 | di->di_size = cpu_to_be64(inode->i_size); |
785 | mark_inode_dirty(inode); | 785 | mark_inode_dirty(inode); |
786 | } | 786 | } |
@@ -845,9 +845,9 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping, | |||
845 | 845 | ||
846 | ret = generic_write_end(file, mapping, pos, len, copied, page, fsdata); | 846 | ret = generic_write_end(file, mapping, pos, len, copied, page, fsdata); |
847 | 847 | ||
848 | if (likely(ret >= 0) && (inode->i_size > ip->i_di.di_size)) { | 848 | if (likely(ret >= 0) && (inode->i_size > ip->i_disksize)) { |
849 | di = (struct gfs2_dinode *)dibh->b_data; | 849 | di = (struct gfs2_dinode *)dibh->b_data; |
850 | ip->i_di.di_size = inode->i_size; | 850 | ip->i_disksize = inode->i_size; |
851 | di->di_size = cpu_to_be64(inode->i_size); | 851 | di->di_size = cpu_to_be64(inode->i_size); |
852 | mark_inode_dirty(inode); | 852 | mark_inode_dirty(inode); |
853 | } | 853 | } |
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c index fcfaaefc92fb..d7e649ed62f2 100644 --- a/fs/gfs2/ops_file.c +++ b/fs/gfs2/ops_file.c | |||
@@ -478,7 +478,7 @@ static int gfs2_open(struct inode *inode, struct file *file) | |||
478 | goto fail; | 478 | goto fail; |
479 | 479 | ||
480 | if (!(file->f_flags & O_LARGEFILE) && | 480 | if (!(file->f_flags & O_LARGEFILE) && |
481 | ip->i_di.di_size > MAX_NON_LFS) { | 481 | ip->i_disksize > MAX_NON_LFS) { |
482 | error = -EOVERFLOW; | 482 | error = -EOVERFLOW; |
483 | goto fail_gunlock; | 483 | goto fail_gunlock; |
484 | } | 484 | } |
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index ca463a450eb9..dd83e8322350 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
@@ -617,7 +617,7 @@ static int map_journal_extents(struct gfs2_sbd *sdp) | |||
617 | 617 | ||
618 | prev_db = 0; | 618 | prev_db = 0; |
619 | 619 | ||
620 | for (lb = 0; lb < ip->i_di.di_size >> sdp->sd_sb.sb_bsize_shift; lb++) { | 620 | for (lb = 0; lb < ip->i_disksize >> sdp->sd_sb.sb_bsize_shift; lb++) { |
621 | bh.b_state = 0; | 621 | bh.b_state = 0; |
622 | bh.b_blocknr = 0; | 622 | bh.b_blocknr = 0; |
623 | bh.b_size = 1 << ip->i_inode.i_blkbits; | 623 | bh.b_size = 1 << ip->i_inode.i_blkbits; |
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index 48468f48d7bf..b932d72b5f5b 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c | |||
@@ -371,7 +371,7 @@ static int gfs2_symlink(struct inode *dir, struct dentry *dentry, | |||
371 | 371 | ||
372 | ip = ghs[1].gh_gl->gl_object; | 372 | ip = ghs[1].gh_gl->gl_object; |
373 | 373 | ||
374 | ip->i_di.di_size = size; | 374 | ip->i_disksize = size; |
375 | 375 | ||
376 | error = gfs2_meta_inode_buffer(ip, &dibh); | 376 | error = gfs2_meta_inode_buffer(ip, &dibh); |
377 | 377 | ||
@@ -425,7 +425,7 @@ static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
425 | ip = ghs[1].gh_gl->gl_object; | 425 | ip = ghs[1].gh_gl->gl_object; |
426 | 426 | ||
427 | ip->i_inode.i_nlink = 2; | 427 | ip->i_inode.i_nlink = 2; |
428 | ip->i_di.di_size = 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_di.di_flags |= GFS2_DIF_JDATA; |
430 | ip->i_entries = 2; | 430 | ip->i_entries = 2; |
431 | 431 | ||
@@ -990,7 +990,7 @@ static int setattr_size(struct inode *inode, struct iattr *attr) | |||
990 | struct gfs2_sbd *sdp = GFS2_SB(inode); | 990 | struct gfs2_sbd *sdp = GFS2_SB(inode); |
991 | int error; | 991 | int error; |
992 | 992 | ||
993 | if (attr->ia_size != ip->i_di.di_size) { | 993 | if (attr->ia_size != ip->i_disksize) { |
994 | error = gfs2_trans_begin(sdp, 0, sdp->sd_jdesc->jd_blocks); | 994 | error = gfs2_trans_begin(sdp, 0, sdp->sd_jdesc->jd_blocks); |
995 | if (error) | 995 | if (error) |
996 | return error; | 996 | return error; |
@@ -1001,8 +1001,8 @@ static int setattr_size(struct inode *inode, struct iattr *attr) | |||
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | error = gfs2_truncatei(ip, attr->ia_size); | 1003 | error = gfs2_truncatei(ip, attr->ia_size); |
1004 | if (error && (inode->i_size != ip->i_di.di_size)) | 1004 | if (error && (inode->i_size != ip->i_disksize)) |
1005 | i_size_write(inode, ip->i_di.di_size); | 1005 | i_size_write(inode, ip->i_disksize); |
1006 | 1006 | ||
1007 | return error; | 1007 | return error; |
1008 | } | 1008 | } |
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 3e073f5144fa..188d0a277fa3 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -1100,15 +1100,15 @@ static void gfs2_quota_change_in(struct gfs2_quota_change_host *qc, const void * | |||
1100 | int gfs2_quota_init(struct gfs2_sbd *sdp) | 1100 | int gfs2_quota_init(struct gfs2_sbd *sdp) |
1101 | { | 1101 | { |
1102 | struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode); | 1102 | struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode); |
1103 | unsigned int blocks = ip->i_di.di_size >> sdp->sd_sb.sb_bsize_shift; | 1103 | unsigned int blocks = ip->i_disksize >> sdp->sd_sb.sb_bsize_shift; |
1104 | unsigned int x, slot = 0; | 1104 | unsigned int x, slot = 0; |
1105 | unsigned int found = 0; | 1105 | unsigned int found = 0; |
1106 | u64 dblock; | 1106 | u64 dblock; |
1107 | u32 extlen = 0; | 1107 | u32 extlen = 0; |
1108 | int error; | 1108 | int error; |
1109 | 1109 | ||
1110 | if (!ip->i_di.di_size || ip->i_di.di_size > (64 << 20) || | 1110 | if (!ip->i_disksize || ip->i_disksize > (64 << 20) || |
1111 | ip->i_di.di_size & (sdp->sd_sb.sb_bsize - 1)) { | 1111 | ip->i_disksize & (sdp->sd_sb.sb_bsize - 1)) { |
1112 | gfs2_consist_inode(ip); | 1112 | gfs2_consist_inode(ip); |
1113 | return -EIO; | 1113 | return -EIO; |
1114 | } | 1114 | } |
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 2d90fb253505..bdad0dffc6b4 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -501,7 +501,7 @@ u64 gfs2_ri_total(struct gfs2_sbd *sdp) | |||
501 | for (rgrps = 0;; rgrps++) { | 501 | for (rgrps = 0;; rgrps++) { |
502 | loff_t pos = rgrps * sizeof(struct gfs2_rindex); | 502 | loff_t pos = rgrps * sizeof(struct gfs2_rindex); |
503 | 503 | ||
504 | if (pos + sizeof(struct gfs2_rindex) >= ip->i_di.di_size) | 504 | if (pos + sizeof(struct gfs2_rindex) >= ip->i_disksize) |
505 | break; | 505 | break; |
506 | error = gfs2_internal_read(ip, &ra_state, buf, &pos, | 506 | error = gfs2_internal_read(ip, &ra_state, buf, &pos, |
507 | sizeof(struct gfs2_rindex)); | 507 | sizeof(struct gfs2_rindex)); |
@@ -590,7 +590,7 @@ static int gfs2_ri_update(struct gfs2_inode *ip) | |||
590 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 590 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
591 | struct inode *inode = &ip->i_inode; | 591 | struct inode *inode = &ip->i_inode; |
592 | struct file_ra_state ra_state; | 592 | struct file_ra_state ra_state; |
593 | u64 rgrp_count = ip->i_di.di_size; | 593 | u64 rgrp_count = ip->i_disksize; |
594 | int error; | 594 | int error; |
595 | 595 | ||
596 | if (do_div(rgrp_count, sizeof(struct gfs2_rindex))) { | 596 | if (do_div(rgrp_count, sizeof(struct gfs2_rindex))) { |
@@ -634,7 +634,7 @@ static int gfs2_ri_update_special(struct gfs2_inode *ip) | |||
634 | for (sdp->sd_rgrps = 0;; sdp->sd_rgrps++) { | 634 | for (sdp->sd_rgrps = 0;; sdp->sd_rgrps++) { |
635 | /* Ignore partials */ | 635 | /* Ignore partials */ |
636 | if ((sdp->sd_rgrps + 1) * sizeof(struct gfs2_rindex) > | 636 | if ((sdp->sd_rgrps + 1) * sizeof(struct gfs2_rindex) > |
637 | ip->i_di.di_size) | 637 | ip->i_disksize) |
638 | break; | 638 | break; |
639 | error = read_rindex_entry(ip, &ra_state); | 639 | error = read_rindex_entry(ip, &ra_state); |
640 | if (error) { | 640 | if (error) { |
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index c3ba3d9d0aac..f5cef2ad7ae1 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c | |||
@@ -206,14 +206,14 @@ int gfs2_jdesc_check(struct gfs2_jdesc *jd) | |||
206 | int ar; | 206 | int ar; |
207 | int error; | 207 | int error; |
208 | 208 | ||
209 | if (ip->i_di.di_size < (8 << 20) || ip->i_di.di_size > (1 << 30) || | 209 | if (ip->i_disksize < (8 << 20) || ip->i_disksize > (1 << 30) || |
210 | (ip->i_di.di_size & (sdp->sd_sb.sb_bsize - 1))) { | 210 | (ip->i_disksize & (sdp->sd_sb.sb_bsize - 1))) { |
211 | gfs2_consist_inode(ip); | 211 | gfs2_consist_inode(ip); |
212 | return -EIO; | 212 | return -EIO; |
213 | } | 213 | } |
214 | jd->jd_blocks = ip->i_di.di_size >> sdp->sd_sb.sb_bsize_shift; | 214 | jd->jd_blocks = ip->i_disksize >> sdp->sd_sb.sb_bsize_shift; |
215 | 215 | ||
216 | error = gfs2_write_alloc_required(ip, 0, ip->i_di.di_size, &ar); | 216 | error = gfs2_write_alloc_required(ip, 0, ip->i_disksize, &ar); |
217 | if (!error && ar) { | 217 | if (!error && ar) { |
218 | gfs2_consist_inode(ip); | 218 | gfs2_consist_inode(ip); |
219 | error = -EIO; | 219 | error = -EIO; |