aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/meta_io.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-06-14 15:32:57 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-06-14 15:32:57 -0400
commitfeaa7bba026c181ce071d5a4884f7f9dd26207a1 (patch)
treec858deb225917265cb07820730e9764674d133e8 /fs/gfs2/meta_io.c
parent22da645fd6675b7abc55cf937ddf6132f343e5b9 (diff)
[GFS2] Fix unlinked file handling
This patch fixes the way we have been dealing with unlinked, but still open files. It removes all limits (other than memory for inodes, as per every other filesystem) on numbers of these which we can support on GFS2. It also means that (like other fs) its the responsibility of the last process to close the file to deallocate the storage, rather than the person who did the unlinking. Note that with GFS2, those two events might take place on different nodes. Also there are a number of other changes: o We use the Linux inode subsystem as it was intended to be used, wrt allocating GFS2 inodes o The Linux inode cache is now the point which we use for local enforcement of only holding one copy of the inode in core at once (previous to this we used the glock layer). o We no longer use the unlinked "special" file. We just ignore it completely. This makes unlinking more efficient. o We now use the 4th block allocation state. The previously unused state is used to track unlinked but still open inodes. o gfs2_inoded is no longer needed o Several fields are now no longer needed (and removed) from the in core struct gfs2_inode o Several fields are no longer needed (and removed) from the in core superblock There are a number of future possible optimisations and clean ups which have been made possible by this patch. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/meta_io.c')
-rw-r--r--fs/gfs2/meta_io.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index c78517225f61..2523d42a02de 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -91,9 +91,6 @@ static void stuck_releasepage(struct buffer_head *bh)
91 fs_warn(sdp, "ip = %llu %llu\n", 91 fs_warn(sdp, "ip = %llu %llu\n",
92 (unsigned long long)ip->i_num.no_formal_ino, 92 (unsigned long long)ip->i_num.no_formal_ino,
93 (unsigned long long)ip->i_num.no_addr); 93 (unsigned long long)ip->i_num.no_addr);
94 fs_warn(sdp, "ip->i_count = %d, ip->i_vnode = %s\n",
95 atomic_read(&ip->i_count),
96 (ip->i_vnode) ? "!NULL" : "NULL");
97 94
98 for (x = 0; x < GFS2_MAX_META_HEIGHT; x++) 95 for (x = 0; x < GFS2_MAX_META_HEIGHT; x++)
99 fs_warn(sdp, "ip->i_cache[%u] = %s\n", 96 fs_warn(sdp, "ip->i_cache[%u] = %s\n",
@@ -567,7 +564,6 @@ void gfs2_attach_bufdata(struct gfs2_glock *gl, struct buffer_head *bh,
567 564
568 bd = kmem_cache_alloc(gfs2_bufdata_cachep, GFP_NOFS | __GFP_NOFAIL), 565 bd = kmem_cache_alloc(gfs2_bufdata_cachep, GFP_NOFS | __GFP_NOFAIL),
569 memset(bd, 0, sizeof(struct gfs2_bufdata)); 566 memset(bd, 0, sizeof(struct gfs2_bufdata));
570
571 bd->bd_bh = bh; 567 bd->bd_bh = bh;
572 bd->bd_gl = gl; 568 bd->bd_gl = gl;
573 569
@@ -664,7 +660,7 @@ void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh,
664 660
665void gfs2_meta_wipe(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen) 661void gfs2_meta_wipe(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen)
666{ 662{
667 struct gfs2_sbd *sdp = ip->i_sbd; 663 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
668 struct inode *aspace = ip->i_gl->gl_aspace; 664 struct inode *aspace = ip->i_gl->gl_aspace;
669 struct buffer_head *bh; 665 struct buffer_head *bh;
670 666
@@ -770,7 +766,7 @@ int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, uint64_t num,
770 if (new) 766 if (new)
771 meta_prep_new(bh); 767 meta_prep_new(bh);
772 else { 768 else {
773 error = gfs2_meta_reread(ip->i_sbd, bh, 769 error = gfs2_meta_reread(GFS2_SB(&ip->i_inode), bh,
774 DIO_START | DIO_WAIT); 770 DIO_START | DIO_WAIT);
775 if (error) { 771 if (error) {
776 brelse(bh); 772 brelse(bh);
@@ -797,7 +793,7 @@ int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, uint64_t num,
797 } 793 }
798 794
799 if (new) { 795 if (new) {
800 if (gfs2_assert_warn(ip->i_sbd, height)) { 796 if (gfs2_assert_warn(GFS2_SB(&ip->i_inode), height)) {
801 brelse(bh); 797 brelse(bh);
802 return -EIO; 798 return -EIO;
803 } 799 }
@@ -805,7 +801,7 @@ int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, uint64_t num,
805 gfs2_metatype_set(bh, GFS2_METATYPE_IN, GFS2_FORMAT_IN); 801 gfs2_metatype_set(bh, GFS2_METATYPE_IN, GFS2_FORMAT_IN);
806 gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header)); 802 gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header));
807 803
808 } else if (gfs2_metatype_check(ip->i_sbd, bh, 804 } else if (gfs2_metatype_check(GFS2_SB(&ip->i_inode), bh,
809 (height) ? GFS2_METATYPE_IN : GFS2_METATYPE_DI)) { 805 (height) ? GFS2_METATYPE_IN : GFS2_METATYPE_DI)) {
810 brelse(bh); 806 brelse(bh);
811 return -EIO; 807 return -EIO;