aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2016-06-14 13:24:50 -0400
committerBob Peterson <rpeterso@redhat.com>2016-06-27 10:47:08 -0400
commitcda9dd4207aeb29d0aa2298085cc2d1ebcb87e04 (patch)
tree734cc4bf36228f8ddfc2f85ebb87328cef383746 /fs/gfs2/inode.c
parentec5ec66ba48bd3163110599359797858ac38e79b (diff)
gfs2: Large-filesystem fix for 32-bit systems
Commit ff34245d switched from iget5_locked to iget_locked among other things, but iget_locked doesn't work for filesystems larger than 2^32 blocks on 32-bit systems. Switch back to iget5_locked. Filesystems larger than 2^32 blocks are unrealistic to work well on 32-bit systems, so this is mostly a code cleanliness fix. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index ebff26ee6865..481b6496727d 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -37,19 +37,34 @@
37#include "super.h" 37#include "super.h"
38#include "glops.h" 38#include "glops.h"
39 39
40static int iget_test(struct inode *inode, void *opaque)
41{
42 u64 no_addr = *(u64 *)opaque;
43
44 return GFS2_I(inode)->i_no_addr == no_addr;
45}
46
47static int iget_set(struct inode *inode, void *opaque)
48{
49 u64 no_addr = *(u64 *)opaque;
50
51 GFS2_I(inode)->i_no_addr = no_addr;
52 inode->i_ino = no_addr;
53 return 0;
54}
55
40static struct inode *gfs2_iget(struct super_block *sb, u64 no_addr) 56static struct inode *gfs2_iget(struct super_block *sb, u64 no_addr)
41{ 57{
42 struct inode *inode; 58 struct inode *inode;
43 59
44repeat: 60repeat:
45 inode = iget_locked(sb, no_addr); 61 inode = iget5_locked(sb, no_addr, iget_test, iget_set, &no_addr);
46 if (!inode) 62 if (!inode)
47 return inode; 63 return inode;
48 if (is_bad_inode(inode)) { 64 if (is_bad_inode(inode)) {
49 iput(inode); 65 iput(inode);
50 goto repeat; 66 goto repeat;
51 } 67 }
52 GFS2_I(inode)->i_no_addr = no_addr;
53 return inode; 68 return inode;
54} 69}
55 70