diff options
Diffstat (limited to 'fs/gfs2/meta_io.c')
-rw-r--r-- | fs/gfs2/meta_io.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 85aea27b4a86..09853620c951 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | 2 | * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
3 | * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. | 3 | * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. |
4 | * | 4 | * |
5 | * This copyrighted material is made available to anyone wishing to use, | 5 | * This copyrighted material is made available to anyone wishing to use, |
6 | * modify, copy, or redistribute it subject to the terms and conditions | 6 | * modify, copy, or redistribute it subject to the terms and conditions |
@@ -69,13 +69,15 @@ static const struct address_space_operations aspace_aops = { | |||
69 | struct inode *gfs2_aspace_get(struct gfs2_sbd *sdp) | 69 | struct inode *gfs2_aspace_get(struct gfs2_sbd *sdp) |
70 | { | 70 | { |
71 | struct inode *aspace; | 71 | struct inode *aspace; |
72 | struct gfs2_inode *ip; | ||
72 | 73 | ||
73 | aspace = new_inode(sdp->sd_vfs); | 74 | aspace = new_inode(sdp->sd_vfs); |
74 | if (aspace) { | 75 | if (aspace) { |
75 | mapping_set_gfp_mask(aspace->i_mapping, GFP_NOFS); | 76 | mapping_set_gfp_mask(aspace->i_mapping, GFP_NOFS); |
76 | aspace->i_mapping->a_ops = &aspace_aops; | 77 | aspace->i_mapping->a_ops = &aspace_aops; |
77 | aspace->i_size = ~0ULL; | 78 | aspace->i_size = ~0ULL; |
78 | aspace->i_private = NULL; | 79 | ip = GFS2_I(aspace); |
80 | clear_bit(GIF_USER, &ip->i_flags); | ||
79 | insert_inode_hash(aspace); | 81 | insert_inode_hash(aspace); |
80 | } | 82 | } |
81 | return aspace; | 83 | return aspace; |
@@ -127,7 +129,7 @@ void gfs2_meta_sync(struct gfs2_glock *gl) | |||
127 | } | 129 | } |
128 | 130 | ||
129 | /** | 131 | /** |
130 | * getbuf - Get a buffer with a given address space | 132 | * gfs2_getbuf - Get a buffer with a given address space |
131 | * @gl: the glock | 133 | * @gl: the glock |
132 | * @blkno: the block number (filesystem scope) | 134 | * @blkno: the block number (filesystem scope) |
133 | * @create: 1 if the buffer should be created | 135 | * @create: 1 if the buffer should be created |
@@ -135,7 +137,7 @@ void gfs2_meta_sync(struct gfs2_glock *gl) | |||
135 | * Returns: the buffer | 137 | * Returns: the buffer |
136 | */ | 138 | */ |
137 | 139 | ||
138 | static struct buffer_head *getbuf(struct gfs2_glock *gl, u64 blkno, int create) | 140 | struct buffer_head *gfs2_getbuf(struct gfs2_glock *gl, u64 blkno, int create) |
139 | { | 141 | { |
140 | struct address_space *mapping = gl->gl_aspace->i_mapping; | 142 | struct address_space *mapping = gl->gl_aspace->i_mapping; |
141 | struct gfs2_sbd *sdp = gl->gl_sbd; | 143 | struct gfs2_sbd *sdp = gl->gl_sbd; |
@@ -203,7 +205,7 @@ static void meta_prep_new(struct buffer_head *bh) | |||
203 | struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno) | 205 | struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno) |
204 | { | 206 | { |
205 | struct buffer_head *bh; | 207 | struct buffer_head *bh; |
206 | bh = getbuf(gl, blkno, CREATE); | 208 | bh = gfs2_getbuf(gl, blkno, CREATE); |
207 | meta_prep_new(bh); | 209 | meta_prep_new(bh); |
208 | return bh; | 210 | return bh; |
209 | } | 211 | } |
@@ -221,7 +223,7 @@ struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno) | |||
221 | int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags, | 223 | int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags, |
222 | struct buffer_head **bhp) | 224 | struct buffer_head **bhp) |
223 | { | 225 | { |
224 | *bhp = getbuf(gl, blkno, CREATE); | 226 | *bhp = gfs2_getbuf(gl, blkno, CREATE); |
225 | if (!buffer_uptodate(*bhp)) { | 227 | if (!buffer_uptodate(*bhp)) { |
226 | ll_rw_block(READ_META, 1, bhp); | 228 | ll_rw_block(READ_META, 1, bhp); |
227 | if (flags & DIO_WAIT) { | 229 | if (flags & DIO_WAIT) { |
@@ -344,7 +346,7 @@ void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen) | |||
344 | struct buffer_head *bh; | 346 | struct buffer_head *bh; |
345 | 347 | ||
346 | while (blen) { | 348 | while (blen) { |
347 | bh = getbuf(ip->i_gl, bstart, NO_CREATE); | 349 | bh = gfs2_getbuf(ip->i_gl, bstart, NO_CREATE); |
348 | if (bh) { | 350 | if (bh) { |
349 | lock_buffer(bh); | 351 | lock_buffer(bh); |
350 | gfs2_log_lock(sdp); | 352 | gfs2_log_lock(sdp); |
@@ -419,7 +421,7 @@ struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen) | |||
419 | if (extlen > max_ra) | 421 | if (extlen > max_ra) |
420 | extlen = max_ra; | 422 | extlen = max_ra; |
421 | 423 | ||
422 | first_bh = getbuf(gl, dblock, CREATE); | 424 | first_bh = gfs2_getbuf(gl, dblock, CREATE); |
423 | 425 | ||
424 | if (buffer_uptodate(first_bh)) | 426 | if (buffer_uptodate(first_bh)) |
425 | goto out; | 427 | goto out; |
@@ -430,7 +432,7 @@ struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen) | |||
430 | extlen--; | 432 | extlen--; |
431 | 433 | ||
432 | while (extlen) { | 434 | while (extlen) { |
433 | bh = getbuf(gl, dblock, CREATE); | 435 | bh = gfs2_getbuf(gl, dblock, CREATE); |
434 | 436 | ||
435 | if (!buffer_uptodate(bh) && !buffer_locked(bh)) | 437 | if (!buffer_uptodate(bh) && !buffer_locked(bh)) |
436 | ll_rw_block(READA, 1, &bh); | 438 | ll_rw_block(READA, 1, &bh); |