slot_map.c (cb5629b10d64a8006622ce3a52bc887d91057d69) slot_map.c (8cb471e8f82506937fe5e2e9fb0bf90f6b1f1170)
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * slot_map.c
5 *
6 *
7 *
8 * Copyright (C) 2002, 2004 Oracle. All rights reserved.

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

145 mlog(0, "Refreshing slot map, reading %u block(s)\n",
146 si->si_blocks);
147
148 /*
149 * We pass -1 as blocknr because we expect all of si->si_bh to
150 * be !NULL. Thus, ocfs2_read_blocks() will ignore blocknr. If
151 * this is not true, the read of -1 (UINT64_MAX) will fail.
152 */
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * slot_map.c
5 *
6 *
7 *
8 * Copyright (C) 2002, 2004 Oracle. All rights reserved.

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

145 mlog(0, "Refreshing slot map, reading %u block(s)\n",
146 si->si_blocks);
147
148 /*
149 * We pass -1 as blocknr because we expect all of si->si_bh to
150 * be !NULL. Thus, ocfs2_read_blocks() will ignore blocknr. If
151 * this is not true, the read of -1 (UINT64_MAX) will fail.
152 */
153 ret = ocfs2_read_blocks(si->si_inode, -1, si->si_blocks, si->si_bh,
154 OCFS2_BH_IGNORE_CACHE, NULL);
153 ret = ocfs2_read_blocks(INODE_CACHE(si->si_inode), -1, si->si_blocks,
154 si->si_bh, OCFS2_BH_IGNORE_CACHE, NULL);
155 if (ret == 0) {
156 spin_lock(&osb->osb_lock);
157 ocfs2_update_slot_info(si);
158 spin_unlock(&osb->osb_lock);
159 }
160
161 return ret;
162}

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

208
209 spin_lock(&osb->osb_lock);
210 if (si->si_extended)
211 ocfs2_update_disk_slot_extended(si, slot_num, &bh);
212 else
213 ocfs2_update_disk_slot_old(si, slot_num, &bh);
214 spin_unlock(&osb->osb_lock);
215
155 if (ret == 0) {
156 spin_lock(&osb->osb_lock);
157 ocfs2_update_slot_info(si);
158 spin_unlock(&osb->osb_lock);
159 }
160
161 return ret;
162}

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

208
209 spin_lock(&osb->osb_lock);
210 if (si->si_extended)
211 ocfs2_update_disk_slot_extended(si, slot_num, &bh);
212 else
213 ocfs2_update_disk_slot_old(si, slot_num, &bh);
214 spin_unlock(&osb->osb_lock);
215
216 status = ocfs2_write_block(osb, bh, si->si_inode);
216 status = ocfs2_write_block(osb, bh, INODE_CACHE(si->si_inode));
217 if (status < 0)
218 mlog_errno(status);
219
220 return status;
221}
222
223/*
224 * Calculate how many bytes are needed by the slot map. Returns

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

399 mlog_errno(status);
400 goto bail;
401 }
402
403 mlog(0, "Reading slot map block %u at %llu\n", i,
404 (unsigned long long)blkno);
405
406 bh = NULL; /* Acquire a fresh bh */
217 if (status < 0)
218 mlog_errno(status);
219
220 return status;
221}
222
223/*
224 * Calculate how many bytes are needed by the slot map. Returns

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

399 mlog_errno(status);
400 goto bail;
401 }
402
403 mlog(0, "Reading slot map block %u at %llu\n", i,
404 (unsigned long long)blkno);
405
406 bh = NULL; /* Acquire a fresh bh */
407 status = ocfs2_read_blocks(si->si_inode, blkno, 1, &bh,
408 OCFS2_BH_IGNORE_CACHE, NULL);
407 status = ocfs2_read_blocks(INODE_CACHE(si->si_inode), blkno,
408 1, &bh, OCFS2_BH_IGNORE_CACHE, NULL);
409 if (status < 0) {
410 mlog_errno(status);
411 goto bail;
412 }
413
414 si->si_bh[i] = bh;
415 }
416

--- 128 unchanged lines hidden ---
409 if (status < 0) {
410 mlog_errno(status);
411 goto bail;
412 }
413
414 si->si_bh[i] = bh;
415 }
416

--- 128 unchanged lines hidden ---