~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to fs/gfs2/ops_fstype.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
 
73
73
        init_waitqueue_head(&sdp->sd_glock_wait);
74
74
        atomic_set(&sdp->sd_glock_disposal, 0);
 
75
        init_completion(&sdp->sd_locking_init);
75
76
        spin_lock_init(&sdp->sd_statfs_spin);
76
77
 
77
78
        spin_lock_init(&sdp->sd_rindex_spin);
126
127
 * changed.
127
128
 */
128
129
 
129
 
static int gfs2_check_sb(struct gfs2_sbd *sdp, struct gfs2_sb_host *sb, int silent)
 
130
static int gfs2_check_sb(struct gfs2_sbd *sdp, int silent)
130
131
{
 
132
        struct gfs2_sb_host *sb = &sdp->sd_sb;
 
133
 
131
134
        if (sb->sb_magic != GFS2_MAGIC ||
132
135
            sb->sb_type != GFS2_METATYPE_SB) {
133
136
                if (!silent)
157
160
        unlock_page(page);
158
161
}
159
162
 
160
 
static void gfs2_sb_in(struct gfs2_sb_host *sb, const void *buf)
 
163
static void gfs2_sb_in(struct gfs2_sbd *sdp, const void *buf)
161
164
{
 
165
        struct gfs2_sb_host *sb = &sdp->sd_sb;
 
166
        struct super_block *s = sdp->sd_vfs;
162
167
        const struct gfs2_sb *str = buf;
163
168
 
164
169
        sb->sb_magic = be32_to_cpu(str->sb_header.mh_magic);
175
180
 
176
181
        memcpy(sb->sb_lockproto, str->sb_lockproto, GFS2_LOCKNAME_LEN);
177
182
        memcpy(sb->sb_locktable, str->sb_locktable, GFS2_LOCKNAME_LEN);
178
 
        memcpy(sb->sb_uuid, str->sb_uuid, 16);
 
183
        memcpy(s->s_uuid, str->sb_uuid, 16);
179
184
}
180
185
 
181
186
/**
197
202
 * Returns: 0 on success or error
198
203
 */
199
204
 
200
 
static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector)
 
205
static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent)
201
206
{
202
207
        struct super_block *sb = sdp->sd_vfs;
203
208
        struct gfs2_sb *p;
227
232
                return -EIO;
228
233
        }
229
234
        p = kmap(page);
230
 
        gfs2_sb_in(&sdp->sd_sb, p);
 
235
        gfs2_sb_in(sdp, p);
231
236
        kunmap(page);
232
237
        __free_page(page);
233
 
        return 0;
 
238
        return gfs2_check_sb(sdp, silent);
234
239
}
235
240
 
236
241
/**
247
252
        unsigned int x;
248
253
        int error;
249
254
 
250
 
        error = gfs2_read_super(sdp, GFS2_SB_ADDR >> sdp->sd_fsb2bb_shift);
 
255
        error = gfs2_read_super(sdp, GFS2_SB_ADDR >> sdp->sd_fsb2bb_shift, silent);
251
256
        if (error) {
252
257
                if (!silent)
253
258
                        fs_err(sdp, "can't read superblock\n");
254
259
                return error;
255
260
        }
256
261
 
257
 
        error = gfs2_check_sb(sdp, &sdp->sd_sb, silent);
258
 
        if (error)
259
 
                return error;
260
 
 
261
262
        sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift -
262
263
                               GFS2_BASIC_BLOCK_SHIFT;
263
264
        sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift;
340
341
        /*  Try to autodetect  */
341
342
 
342
343
        if (!proto[0] || !table[0]) {
343
 
                error = gfs2_read_super(sdp, GFS2_SB_ADDR >> sdp->sd_fsb2bb_shift);
 
344
                error = gfs2_read_super(sdp, GFS2_SB_ADDR >> sdp->sd_fsb2bb_shift, silent);
344
345
                if (error)
345
346
                        return error;
346
347
 
347
 
                error = gfs2_check_sb(sdp, &sdp->sd_sb, silent);
348
 
                if (error)
349
 
                        goto out;
350
 
 
351
348
                if (!proto[0])
352
349
                        proto = sdp->sd_sb.sb_lockproto;
353
350
                if (!table[0])
364
361
        while ((table = strchr(table, '/')))
365
362
                *table = '_';
366
363
 
367
 
out:
368
364
        return error;
369
365
}
370
366
 
1022
1018
                fsname++;
1023
1019
        if (lm->lm_mount == NULL) {
1024
1020
                fs_info(sdp, "Now mounting FS...\n");
 
1021
                complete_all(&sdp->sd_locking_init);
1025
1022
                return 0;
1026
1023
        }
1027
1024
        ret = lm->lm_mount(sdp, fsname);
1028
1025
        if (ret == 0)
1029
1026
                fs_info(sdp, "Joined cluster. Now mounting FS...\n");
 
1027
        complete_all(&sdp->sd_locking_init);
1030
1028
        return ret;
1031
1029
}
1032
1030
 
1119
1117
        if (sdp->sd_args.ar_statfs_quantum) {
1120
1118
                sdp->sd_tune.gt_statfs_slow = 0;
1121
1119
                sdp->sd_tune.gt_statfs_quantum = sdp->sd_args.ar_statfs_quantum;
1122
 
        }
1123
 
        else {
 
1120
        } else {
1124
1121
                sdp->sd_tune.gt_statfs_slow = 1;
1125
1122
                sdp->sd_tune.gt_statfs_quantum = 30;
1126
1123
        }