]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/gfs2/super.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg...
[linux-2.6-omap-h63xx.git] / fs / gfs2 / super.c
index 26edb7f9f4b82e59a9406d9e4527750fc0a4a6ad..63a8a902d9db16029898c8d1caf74e5a198aac48 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
- * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
+ * Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
  *
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
@@ -54,7 +54,6 @@ void gfs2_tune_init(struct gfs2_tune *gt)
        gt->gt_demote_secs = 300;
        gt->gt_incore_log_blocks = 1024;
        gt->gt_log_flush_secs = 60;
-       gt->gt_jindex_refresh_secs = 60;
        gt->gt_recoverd_secs = 60;
        gt->gt_logd_secs = 1;
        gt->gt_quotad_secs = 5;
@@ -66,11 +65,9 @@ void gfs2_tune_init(struct gfs2_tune *gt)
        gt->gt_quota_quantum = 60;
        gt->gt_atime_quantum = 3600;
        gt->gt_new_files_jdata = 0;
-       gt->gt_new_files_directio = 0;
        gt->gt_max_readahead = 1 << 18;
        gt->gt_stall_secs = 600;
        gt->gt_complain_secs = 10;
-       gt->gt_reclaim_limit = 5000;
        gt->gt_statfs_quantum = 30;
        gt->gt_statfs_slow = 0;
 }
@@ -212,7 +209,7 @@ int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector)
        struct page *page;
        struct bio *bio;
 
-       page = alloc_page(GFP_KERNEL);
+       page = alloc_page(GFP_NOFS);
        if (unlikely(!page))
                return -ENOBUFS;
 
@@ -220,7 +217,7 @@ int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector)
        ClearPageDirty(page);
        lock_page(page);
 
-       bio = bio_alloc(GFP_KERNEL, 1);
+       bio = bio_alloc(GFP_NOFS, 1);
        if (unlikely(!bio)) {
                __free_page(page);
                return -ENOBUFS;
@@ -318,6 +315,7 @@ int gfs2_read_sb(struct gfs2_sbd *sdp, struct gfs2_glock *gl, int silent)
                sdp->sd_heightsize[x] = space;
        }
        sdp->sd_max_height = x;
+       sdp->sd_heightsize[x] = ~0;
        gfs2_assert(sdp, sdp->sd_max_height <= GFS2_MAX_META_HEIGHT);
 
        sdp->sd_jheightsize[0] = sdp->sd_sb.sb_bsize -
@@ -336,6 +334,7 @@ int gfs2_read_sb(struct gfs2_sbd *sdp, struct gfs2_glock *gl, int silent)
                sdp->sd_jheightsize[x] = space;
        }
        sdp->sd_max_jheight = x;
+       sdp->sd_jheightsize[x] = ~0;
        gfs2_assert(sdp, sdp->sd_max_jheight <= GFS2_MAX_META_HEIGHT);
 
        return 0;
@@ -389,6 +388,7 @@ int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh)
                if (!jd)
                        break;
 
+               INIT_LIST_HEAD(&jd->extent_list);
                jd->jd_inode = gfs2_lookupi(sdp->sd_jindex, &name, 1, NULL);
                if (!jd->jd_inode || IS_ERR(jd->jd_inode)) {
                        if (!jd->jd_inode)
@@ -418,8 +418,9 @@ int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh)
 
 void gfs2_jindex_free(struct gfs2_sbd *sdp)
 {
-       struct list_head list;
+       struct list_head list, *head;
        struct gfs2_jdesc *jd;
+       struct gfs2_journal_extent *jext;
 
        spin_lock(&sdp->sd_jindex_spin);
        list_add(&list, &sdp->sd_jindex_list);
@@ -429,6 +430,14 @@ void gfs2_jindex_free(struct gfs2_sbd *sdp)
 
        while (!list_empty(&list)) {
                jd = list_entry(list.next, struct gfs2_jdesc, jd_list);
+               head = &jd->extent_list;
+               while (!list_empty(head)) {
+                       jext = list_entry(head->next,
+                                         struct gfs2_journal_extent,
+                                         extent_list);
+                       list_del(&jext->extent_list);
+                       kfree(jext);
+               }
                list_del(&jd->jd_list);
                iput(jd->jd_inode);
                kfree(jd);
@@ -681,9 +690,7 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
        if (error)
                return;
 
-       mutex_lock(&sdp->sd_statfs_mutex);
        gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1);
-       mutex_unlock(&sdp->sd_statfs_mutex);
 
        spin_lock(&sdp->sd_statfs_spin);
        l_sc->sc_total += total;
@@ -731,9 +738,7 @@ int gfs2_statfs_sync(struct gfs2_sbd *sdp)
        if (error)
                goto out_bh2;
 
-       mutex_lock(&sdp->sd_statfs_mutex);
        gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1);
-       mutex_unlock(&sdp->sd_statfs_mutex);
 
        spin_lock(&sdp->sd_statfs_spin);
        m_sc->sc_total += l_sc->sc_total;
@@ -935,8 +940,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp,
        }
 
        error = gfs2_glock_nq_init(sdp->sd_trans_gl, LM_ST_DEFERRED,
-                              LM_FLAG_PRIORITY | GL_NOCACHE,
-                              t_gh);
+                                  GL_NOCACHE, t_gh);
 
        list_for_each_entry(jd, &sdp->sd_jindex_list, jd_list) {
                error = gfs2_jdesc_check(jd);