[GFS2] Remove debugging printks

A few of my printks slipped through last time. Also fix a couple of
minor bugs.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index 013bf5f..a01874c 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -129,7 +129,6 @@
 
 static void inode_go_drop_th(struct gfs2_glock *gl)
 {
-	printk(KERN_INFO "drop th %p\n", gl->gl_object);
 	gfs2_pte_inval(gl);
 	gfs2_glock_drop_th(gl);
 }
@@ -148,7 +147,6 @@
 
 	if (test_bit(GLF_DIRTY, &gl->gl_flags)) {
 		if (meta && data) {
-			printk(KERN_INFO "sync all\n");
 			gfs2_page_sync(gl, flags | DIO_START);
 			gfs2_log_flush(gl->gl_sbd, gl);
 			gfs2_meta_sync(gl, flags | DIO_START | DIO_WAIT);
@@ -226,7 +224,6 @@
 		return 0;
 
 	if (ip->i_vn != gl->gl_vn) {
-		printk(KERN_INFO "refresh inode %p\n", &ip->i_inode);
 		error = gfs2_inode_refresh(ip);
 		if (error)
 			return error;
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index a76f1a7..93563e7 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -650,7 +650,7 @@
 		} else
 			gfs2_log_unlock(sdp);
 
-		kfree(bd1);
+		kmem_cache_free(gfs2_bufdata_cachep, bd1);
 	}
 
 	/* We've removed all the ordered write bufs here, so only jdata left */
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index f678f6b..2fe37ae 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -56,7 +56,6 @@
 	struct gfs2_sbd *sdp = GFS2_SB(dir);
 	struct gfs2_holder ghs[2];
 	struct inode *inode;
-	int new = 1;
 
 	gfs2_holder_init(dip->i_gl, 0, 0, ghs);
 
@@ -69,6 +68,7 @@
 			gfs2_quota_unlock(dip);
 			gfs2_alloc_put(dip);
 			gfs2_glock_dq_uninit_m(2, ghs);
+			mark_inode_dirty(inode);
 			break;
 		} else if (PTR_ERR(inode) != -EEXIST ||
 			   (nd->intent.open.flags & O_EXCL)) {
@@ -79,7 +79,6 @@
 		inode = gfs2_lookupi(dir, &dentry->d_name, 0, nd);
 		if (inode) {
 			if (!IS_ERR(inode)) {
-				new = 0;
 				gfs2_holder_uninit(ghs);
 				break;
 			} else {
@@ -90,8 +89,6 @@
 	}
 
 	d_instantiate(dentry, inode);
-	if (new)
-		mark_inode_dirty(inode);
 
 	return 0;
 }
diff --git a/fs/gfs2/ops_super.c b/fs/gfs2/ops_super.c
index 317d497..5f5fc3c 100644
--- a/fs/gfs2/ops_super.c
+++ b/fs/gfs2/ops_super.c
@@ -59,7 +59,7 @@
 		if (current->flags & PF_MEMALLOC)
 			return 0;
 		if (sync)
-			gfs2_log_flush(ip->i_gl->gl_sbd, ip->i_gl);
+			gfs2_log_flush(GFS2_SB(inode), ip->i_gl);
 	}
 
 	return 0;
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 75df79e..6513419 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -447,8 +447,6 @@
 	uint64_t junk = ip->i_di.di_size;
 	int error;
 
-	printk(KERN_INFO "gfs2_ri_update inode=%p\n", inode);
-
 	if (do_div(junk, sizeof(struct gfs2_rindex))) {
 		gfs2_consist_inode(ip);
 		return -EIO;
@@ -456,12 +454,9 @@
 
 	clear_rgrpdi(sdp);
 
-	printk(KERN_INFO "rgrps cleared\n");
-
 	file_ra_state_init(&ra_state, inode->i_mapping);
 	for (sdp->sd_rgrps = 0;; sdp->sd_rgrps++) {
 		loff_t pos = sdp->sd_rgrps * sizeof(struct gfs2_rindex);
-		printk(KERN_INFO "reading rgrp %d\n", sdp->sd_rgrps);
 		error = gfs2_internal_read(ip, &ra_state, buf, &pos,
 					    sizeof(struct gfs2_rindex));
 		if (!error)
@@ -485,15 +480,12 @@
 		list_add_tail(&rgd->rd_list_mru, &sdp->sd_rindex_mru_list);
 
 		gfs2_rindex_in(&rgd->rd_ri, buf);
-		printk(KERN_INFO "compute bitstructs\n");
 		error = compute_bitstructs(rgd);
 		if (error)
 			goto fail;
 
-		printk(KERN_INFO "gfs2_glock_get\n");
 		error = gfs2_glock_get(sdp, rgd->rd_ri.ri_addr,
 				       &gfs2_rgrp_glops, CREATE, &rgd->rd_gl);
-		printk(KERN_INFO "gfs2_glock_got one\n");
 		if (error)
 			goto fail;
 
@@ -501,14 +493,11 @@
 		rgd->rd_rg_vn = rgd->rd_gl->gl_vn - 1;
 	}
 
-	printk(KERN_INFO "ok, finished\n");
 	sdp->sd_rindex_vn = ip->i_gl->gl_vn;
 	return 0;
 
 fail:
-	printk(KERN_INFO "fail\n");
 	clear_rgrpdi(sdp);
-	printk(KERN_INFO "cleared rgrps\n");
 	return error;
 }