~ubuntu-branches/ubuntu/trusty/linux-linaro-omap/trusty

« back to all changes in this revision

Viewing changes to fs/gfs2/lops.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-57i0gl3v99b3lkfg
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:
40
40
{
41
41
        struct gfs2_bufdata *bd;
42
42
 
43
 
        gfs2_assert_withdraw(sdp, test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags));
 
43
        BUG_ON(!current->journal_info);
44
44
 
45
45
        clear_buffer_dirty(bh);
46
46
        if (test_set_buffer_pinned(bh))
65
65
 * @sdp: the filesystem the buffer belongs to
66
66
 * @bh: The buffer to unpin
67
67
 * @ai:
 
68
 * @flags: The inode dirty flags
68
69
 *
69
70
 */
70
71
 
73
74
{
74
75
        struct gfs2_bufdata *bd = bh->b_private;
75
76
 
76
 
        gfs2_assert_withdraw(sdp, buffer_uptodate(bh));
77
 
 
78
 
        if (!buffer_pinned(bh))
79
 
                gfs2_assert_withdraw(sdp, 0);
 
77
        BUG_ON(!buffer_uptodate(bh));
 
78
        BUG_ON(!buffer_pinned(bh));
80
79
 
81
80
        lock_buffer(bh);
82
81
        mark_buffer_dirty(bh);
95
94
        list_add(&bd->bd_ail_st_list, &ai->ai_ail1_list);
96
95
        spin_unlock(&sdp->sd_ail_lock);
97
96
 
98
 
        if (test_and_clear_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags))
99
 
                gfs2_glock_schedule_for_reclaim(bd->bd_gl);
 
97
        clear_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags);
100
98
        trace_gfs2_pin(bd, 0);
101
99
        unlock_buffer(bh);
102
100
        atomic_dec(&sdp->sd_log_pinned);
322
320
 
323
321
static void revoke_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
324
322
{
 
323
        struct gfs2_bufdata *bd = container_of(le, struct gfs2_bufdata, bd_le);
 
324
        struct gfs2_glock *gl = bd->bd_gl;
325
325
        struct gfs2_trans *tr;
326
326
 
327
327
        tr = current->journal_info;
328
328
        tr->tr_touched = 1;
329
329
        tr->tr_num_revoke++;
330
330
        sdp->sd_log_num_revoke++;
 
331
        atomic_inc(&gl->gl_revokes);
 
332
        set_bit(GLF_LFLUSH, &gl->gl_flags);
331
333
        list_add(&le->le_list, &sdp->sd_log_le_revoke);
332
334
}
333
335
 
350
352
        ld->ld_data1 = cpu_to_be32(sdp->sd_log_num_revoke);
351
353
        offset = sizeof(struct gfs2_log_descriptor);
352
354
 
353
 
        while (!list_empty(head)) {
354
 
                bd = list_entry(head->next, struct gfs2_bufdata, bd_le.le_list);
355
 
                list_del_init(&bd->bd_le.le_list);
 
355
        list_for_each_entry(bd, head, bd_le.le_list) {
356
356
                sdp->sd_log_num_revoke--;
357
357
 
358
358
                if (offset + sizeof(u64) > sdp->sd_sb.sb_bsize) {
367
367
                }
368
368
 
369
369
                *(__be64 *)(bh->b_data + offset) = cpu_to_be64(bd->bd_blkno);
370
 
                kmem_cache_free(gfs2_bufdata_cachep, bd);
371
 
 
372
370
                offset += sizeof(u64);
373
371
        }
374
372
        gfs2_assert_withdraw(sdp, !sdp->sd_log_num_revoke);
376
374
        submit_bh(WRITE_SYNC, bh);
377
375
}
378
376
 
 
377
static void revoke_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
 
378
{
 
379
        struct list_head *head = &sdp->sd_log_le_revoke;
 
380
        struct gfs2_bufdata *bd;
 
381
        struct gfs2_glock *gl;
 
382
 
 
383
        while (!list_empty(head)) {
 
384
                bd = list_entry(head->next, struct gfs2_bufdata, bd_le.le_list);
 
385
                list_del_init(&bd->bd_le.le_list);
 
386
                gl = bd->bd_gl;
 
387
                atomic_dec(&gl->gl_revokes);
 
388
                clear_bit(GLF_LFLUSH, &gl->gl_flags);
 
389
                kmem_cache_free(gfs2_bufdata_cachep, bd);
 
390
        }
 
391
}
 
392
 
379
393
static void revoke_lo_before_scan(struct gfs2_jdesc *jd,
380
394
                                  struct gfs2_log_header_host *head, int pass)
381
395
{
749
763
const struct gfs2_log_operations gfs2_revoke_lops = {
750
764
        .lo_add = revoke_lo_add,
751
765
        .lo_before_commit = revoke_lo_before_commit,
 
766
        .lo_after_commit = revoke_lo_after_commit,
752
767
        .lo_before_scan = revoke_lo_before_scan,
753
768
        .lo_scan_elements = revoke_lo_scan_elements,
754
769
        .lo_after_scan = revoke_lo_after_scan,