lops.c (2d8ad8719591fa803b0d589ed057fa46f49b7155) lops.c (721a9602e6607417c6bc15b18e97a2f35266c690)
1/*
2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
4 *
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions
7 * of the GNU General Public License version 2.
8 */

--- 186 unchanged lines hidden (view full) ---

195 list_for_each_entry_continue(bd1, &sdp->sd_log_le_buf,
196 bd_le.le_list) {
197 *ptr++ = cpu_to_be64(bd1->bd_bh->b_blocknr);
198 if (++n >= num)
199 break;
200 }
201
202 gfs2_log_unlock(sdp);
1/*
2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
4 *
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions
7 * of the GNU General Public License version 2.
8 */

--- 186 unchanged lines hidden (view full) ---

195 list_for_each_entry_continue(bd1, &sdp->sd_log_le_buf,
196 bd_le.le_list) {
197 *ptr++ = cpu_to_be64(bd1->bd_bh->b_blocknr);
198 if (++n >= num)
199 break;
200 }
201
202 gfs2_log_unlock(sdp);
203 submit_bh(WRITE_SYNC_PLUG, bh);
203 submit_bh(WRITE_SYNC, bh);
204 gfs2_log_lock(sdp);
205
206 n = 0;
207 list_for_each_entry_continue(bd2, &sdp->sd_log_le_buf,
208 bd_le.le_list) {
209 get_bh(bd2->bd_bh);
210 gfs2_log_unlock(sdp);
211 lock_buffer(bd2->bd_bh);
212 bh = gfs2_log_fake_buf(sdp, bd2->bd_bh);
204 gfs2_log_lock(sdp);
205
206 n = 0;
207 list_for_each_entry_continue(bd2, &sdp->sd_log_le_buf,
208 bd_le.le_list) {
209 get_bh(bd2->bd_bh);
210 gfs2_log_unlock(sdp);
211 lock_buffer(bd2->bd_bh);
212 bh = gfs2_log_fake_buf(sdp, bd2->bd_bh);
213 submit_bh(WRITE_SYNC_PLUG, bh);
213 submit_bh(WRITE_SYNC, bh);
214 gfs2_log_lock(sdp);
215 if (++n >= num)
216 break;
217 }
218
219 BUG_ON(total < num);
220 total -= num;
221 }

--- 125 unchanged lines hidden (view full) ---

347 offset = sizeof(struct gfs2_log_descriptor);
348
349 while (!list_empty(head)) {
350 bd = list_entry(head->next, struct gfs2_bufdata, bd_le.le_list);
351 list_del_init(&bd->bd_le.le_list);
352 sdp->sd_log_num_revoke--;
353
354 if (offset + sizeof(u64) > sdp->sd_sb.sb_bsize) {
214 gfs2_log_lock(sdp);
215 if (++n >= num)
216 break;
217 }
218
219 BUG_ON(total < num);
220 total -= num;
221 }

--- 125 unchanged lines hidden (view full) ---

347 offset = sizeof(struct gfs2_log_descriptor);
348
349 while (!list_empty(head)) {
350 bd = list_entry(head->next, struct gfs2_bufdata, bd_le.le_list);
351 list_del_init(&bd->bd_le.le_list);
352 sdp->sd_log_num_revoke--;
353
354 if (offset + sizeof(u64) > sdp->sd_sb.sb_bsize) {
355 submit_bh(WRITE_SYNC_PLUG, bh);
355 submit_bh(WRITE_SYNC, bh);
356
357 bh = gfs2_log_get_buf(sdp);
358 mh = (struct gfs2_meta_header *)bh->b_data;
359 mh->mh_magic = cpu_to_be32(GFS2_MAGIC);
360 mh->mh_type = cpu_to_be32(GFS2_METATYPE_LB);
361 mh->mh_format = cpu_to_be32(GFS2_FORMAT_LB);
362 offset = sizeof(struct gfs2_meta_header);
363 }
364
365 *(__be64 *)(bh->b_data + offset) = cpu_to_be64(bd->bd_blkno);
366 kmem_cache_free(gfs2_bufdata_cachep, bd);
367
368 offset += sizeof(u64);
369 }
370 gfs2_assert_withdraw(sdp, !sdp->sd_log_num_revoke);
371
356
357 bh = gfs2_log_get_buf(sdp);
358 mh = (struct gfs2_meta_header *)bh->b_data;
359 mh->mh_magic = cpu_to_be32(GFS2_MAGIC);
360 mh->mh_type = cpu_to_be32(GFS2_METATYPE_LB);
361 mh->mh_format = cpu_to_be32(GFS2_FORMAT_LB);
362 offset = sizeof(struct gfs2_meta_header);
363 }
364
365 *(__be64 *)(bh->b_data + offset) = cpu_to_be64(bd->bd_blkno);
366 kmem_cache_free(gfs2_bufdata_cachep, bd);
367
368 offset += sizeof(u64);
369 }
370 gfs2_assert_withdraw(sdp, !sdp->sd_log_num_revoke);
371
372 submit_bh(WRITE_SYNC_PLUG, bh);
372 submit_bh(WRITE_SYNC, bh);
373}
374
375static void revoke_lo_before_scan(struct gfs2_jdesc *jd,
376 struct gfs2_log_header_host *head, int pass)
377{
378 struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
379
380 if (pass != 0)

--- 185 unchanged lines hidden (view full) ---

566
567 ld = bh_log_desc(bh);
568 ld->ld_length = cpu_to_be32(n + 1);
569 ld->ld_data1 = cpu_to_be32(n);
570
571 ptr = bh_log_ptr(bh);
572
573 get_bh(bh);
373}
374
375static void revoke_lo_before_scan(struct gfs2_jdesc *jd,
376 struct gfs2_log_header_host *head, int pass)
377{
378 struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
379
380 if (pass != 0)

--- 185 unchanged lines hidden (view full) ---

566
567 ld = bh_log_desc(bh);
568 ld->ld_length = cpu_to_be32(n + 1);
569 ld->ld_data1 = cpu_to_be32(n);
570
571 ptr = bh_log_ptr(bh);
572
573 get_bh(bh);
574 submit_bh(WRITE_SYNC_PLUG, bh);
574 submit_bh(WRITE_SYNC, bh);
575 gfs2_log_lock(sdp);
576 while(!list_empty(list)) {
577 bd = list_entry(list->next, struct gfs2_bufdata, bd_le.le_list);
578 list_move_tail(&bd->bd_le.le_list, done);
579 get_bh(bd->bd_bh);
580 while (be64_to_cpu(*ptr) != bd->bd_bh->b_blocknr) {
581 gfs2_log_incr_head(sdp);
582 ptr += 2;

--- 9 unchanged lines hidden (view full) ---

592 kunmap_atomic(kaddr, KM_USER0);
593 *(__be32 *)bh1->b_data = 0;
594 clear_buffer_escaped(bd->bd_bh);
595 unlock_buffer(bd->bd_bh);
596 brelse(bd->bd_bh);
597 } else {
598 bh1 = gfs2_log_fake_buf(sdp, bd->bd_bh);
599 }
575 gfs2_log_lock(sdp);
576 while(!list_empty(list)) {
577 bd = list_entry(list->next, struct gfs2_bufdata, bd_le.le_list);
578 list_move_tail(&bd->bd_le.le_list, done);
579 get_bh(bd->bd_bh);
580 while (be64_to_cpu(*ptr) != bd->bd_bh->b_blocknr) {
581 gfs2_log_incr_head(sdp);
582 ptr += 2;

--- 9 unchanged lines hidden (view full) ---

592 kunmap_atomic(kaddr, KM_USER0);
593 *(__be32 *)bh1->b_data = 0;
594 clear_buffer_escaped(bd->bd_bh);
595 unlock_buffer(bd->bd_bh);
596 brelse(bd->bd_bh);
597 } else {
598 bh1 = gfs2_log_fake_buf(sdp, bd->bd_bh);
599 }
600 submit_bh(WRITE_SYNC_PLUG, bh1);
600 submit_bh(WRITE_SYNC, bh1);
601 gfs2_log_lock(sdp);
602 ptr += 2;
603 }
604 gfs2_log_unlock(sdp);
605 brelse(bh);
606}
607
608/**

--- 168 unchanged lines hidden ---
601 gfs2_log_lock(sdp);
602 ptr += 2;
603 }
604 gfs2_log_unlock(sdp);
605 brelse(bh);
606}
607
608/**

--- 168 unchanged lines hidden ---