aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glops.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/glops.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/glops.c')
-rw-r--r--fs/gfs2/glops.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index e262f22f744e..013bf5f1552f 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -129,6 +129,7 @@ static void inode_go_xmote_bh(struct gfs2_glock *gl)
129 129
130static void inode_go_drop_th(struct gfs2_glock *gl) 130static void inode_go_drop_th(struct gfs2_glock *gl)
131{ 131{
132 printk(KERN_INFO "drop th %p\n", gl->gl_object);
132 gfs2_pte_inval(gl); 133 gfs2_pte_inval(gl);
133 gfs2_glock_drop_th(gl); 134 gfs2_glock_drop_th(gl);
134} 135}
@@ -147,6 +148,7 @@ static void inode_go_sync(struct gfs2_glock *gl, int flags)
147 148
148 if (test_bit(GLF_DIRTY, &gl->gl_flags)) { 149 if (test_bit(GLF_DIRTY, &gl->gl_flags)) {
149 if (meta && data) { 150 if (meta && data) {
151 printk(KERN_INFO "sync all\n");
150 gfs2_page_sync(gl, flags | DIO_START); 152 gfs2_page_sync(gl, flags | DIO_START);
151 gfs2_log_flush(gl->gl_sbd, gl); 153 gfs2_log_flush(gl->gl_sbd, gl);
152 gfs2_meta_sync(gl, flags | DIO_START | DIO_WAIT); 154 gfs2_meta_sync(gl, flags | DIO_START | DIO_WAIT);
@@ -224,6 +226,7 @@ static int inode_go_lock(struct gfs2_holder *gh)
224 return 0; 226 return 0;
225 227
226 if (ip->i_vn != gl->gl_vn) { 228 if (ip->i_vn != gl->gl_vn) {
229 printk(KERN_INFO "refresh inode %p\n", &ip->i_inode);
227 error = gfs2_inode_refresh(ip); 230 error = gfs2_inode_refresh(ip);
228 if (error) 231 if (error)
229 return error; 232 return error;
@@ -288,7 +291,7 @@ static void inode_greedy(struct gfs2_glock *gl)
288 291
289 spin_unlock(&ip->i_spin); 292 spin_unlock(&ip->i_spin);
290 293
291 gfs2_inode_put(ip); 294 iput(&ip->i_inode);
292} 295}
293 296
294/** 297/**
@@ -361,14 +364,14 @@ static void trans_go_xmote_th(struct gfs2_glock *gl, unsigned int state,
361static void trans_go_xmote_bh(struct gfs2_glock *gl) 364static void trans_go_xmote_bh(struct gfs2_glock *gl)
362{ 365{
363 struct gfs2_sbd *sdp = gl->gl_sbd; 366 struct gfs2_sbd *sdp = gl->gl_sbd;
364 struct gfs2_inode *ip = sdp->sd_jdesc->jd_inode->u.generic_ip; 367 struct gfs2_inode *ip = GFS2_I(sdp->sd_jdesc->jd_inode);
365 struct gfs2_glock *j_gl = ip->i_gl; 368 struct gfs2_glock *j_gl = ip->i_gl;
366 struct gfs2_log_header head; 369 struct gfs2_log_header head;
367 int error; 370 int error;
368 371
369 if (gl->gl_state != LM_ST_UNLOCKED && 372 if (gl->gl_state != LM_ST_UNLOCKED &&
370 test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) { 373 test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) {
371 gfs2_meta_cache_flush(sdp->sd_jdesc->jd_inode->u.generic_ip); 374 gfs2_meta_cache_flush(GFS2_I(sdp->sd_jdesc->jd_inode));
372 j_gl->gl_ops->go_inval(j_gl, DIO_METADATA | DIO_DATA); 375 j_gl->gl_ops->go_inval(j_gl, DIO_METADATA | DIO_DATA);
373 376
374 error = gfs2_find_jhead(sdp->sd_jdesc, &head); 377 error = gfs2_find_jhead(sdp->sd_jdesc, &head);