alpha: support new syscalls
[pandora-kernel.git] / fs / gfs2 / super.c
index 0ef8317..4fdda97 100644 (file)
@@ -71,17 +71,11 @@ void gfs2_tune_init(struct gfs2_tune *gt)
        gt->gt_atime_quantum = 3600;
        gt->gt_new_files_jdata = 0;
        gt->gt_new_files_directio = 0;
-       gt->gt_max_atomic_write = 4 << 20;
        gt->gt_max_readahead = 1 << 18;
        gt->gt_lockdump_size = 131072;
        gt->gt_stall_secs = 600;
        gt->gt_complain_secs = 10;
        gt->gt_reclaim_limit = 5000;
-       gt->gt_entries_per_readdir = 32;
-       gt->gt_prefetch_secs = 10;
-       gt->gt_greedy_default = HZ / 10;
-       gt->gt_greedy_quantum = HZ / 40;
-       gt->gt_greedy_max = HZ / 4;
        gt->gt_statfs_quantum = 30;
        gt->gt_statfs_slow = 0;
 }
@@ -180,6 +174,24 @@ static int end_bio_io_page(struct bio *bio, unsigned int bytes_done, int error)
        return 0;
 }
 
+/**
+ * gfs2_read_super - Read the gfs2 super block from disk
+ * @sb: The VFS super block
+ * @sector: The location of the super block
+ *
+ * This uses the bio functions to read the super block from disk
+ * because we want to be 100% sure that we never read cached data.
+ * A super block is read twice only during each GFS2 mount and is
+ * never written to by the filesystem. The first time its read no
+ * locks are held, and the only details which are looked at are those
+ * relating to the locking protocol. Once locking is up and working,
+ * the sb is read again under the lock to establish the location of
+ * the master directory (contains pointers to journals etc) and the
+ * root directory.
+ *
+ * Returns: A page containing the sb or NULL
+ */
+
 struct page *gfs2_read_super(struct super_block *sb, sector_t sector)
 {
        struct page *page;
@@ -199,7 +211,7 @@ struct page *gfs2_read_super(struct super_block *sb, sector_t sector)
                return NULL;
        }
 
-       bio->bi_sector = sector;
+       bio->bi_sector = sector * (sb->s_blocksize >> 9);
        bio->bi_bdev = sb->s_bdev;
        bio_add_page(bio, page, PAGE_SIZE, 0);
 
@@ -341,8 +353,7 @@ int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh)
        mutex_lock(&sdp->sd_jindex_mutex);
 
        for (;;) {
-               error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED,
-                                          GL_LOCAL_EXCL, ji_gh);
+               error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, ji_gh);
                if (error)
                        break;
 
@@ -511,13 +522,12 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp)
        struct gfs2_log_header_host head;
        int error;
 
-       error = gfs2_glock_nq_init(sdp->sd_trans_gl, LM_ST_SHARED,
-                                  GL_LOCAL_EXCL, &t_gh);
+       error = gfs2_glock_nq_init(sdp->sd_trans_gl, LM_ST_SHARED, 0, &t_gh);
        if (error)
                return error;
 
        gfs2_meta_cache_flush(ip);
-       j_gl->gl_ops->go_inval(j_gl, DIO_METADATA | DIO_DATA);
+       j_gl->gl_ops->go_inval(j_gl, DIO_METADATA);
 
        error = gfs2_find_jhead(sdp->sd_jdesc, &head);
        if (error)
@@ -565,9 +575,8 @@ int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
        gfs2_quota_sync(sdp);
        gfs2_statfs_sync(sdp);
 
-       error = gfs2_glock_nq_init(sdp->sd_trans_gl, LM_ST_SHARED,
-                               GL_LOCAL_EXCL | GL_NOCACHE,
-                               &t_gh);
+       error = gfs2_glock_nq_init(sdp->sd_trans_gl, LM_ST_SHARED, GL_NOCACHE,
+                                  &t_gh);
        if (error && !test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
                return error;