localalloc.c (b657c95c11088d77fc1bfc9c84d940f778bf9d12) | localalloc.c (13723d00e374c2a6d6ccb5af6de965e89c3e1b01) |
---|---|
1/* -*- mode: c; c-basic-offset: 8; -*- 2 * vim: noexpandtab sw=8 ts=8 sts=0: 3 * 4 * localalloc.c 5 * 6 * Node local data allocation 7 * 8 * Copyright (C) 2002, 2004 Oracle. All rights reserved. --- 22 unchanged lines hidden (view full) --- 31#include <linux/debugfs.h> 32 33#define MLOG_MASK_PREFIX ML_DISK_ALLOC 34#include <cluster/masklog.h> 35 36#include "ocfs2.h" 37 38#include "alloc.h" | 1/* -*- mode: c; c-basic-offset: 8; -*- 2 * vim: noexpandtab sw=8 ts=8 sts=0: 3 * 4 * localalloc.c 5 * 6 * Node local data allocation 7 * 8 * Copyright (C) 2002, 2004 Oracle. All rights reserved. --- 22 unchanged lines hidden (view full) --- 31#include <linux/debugfs.h> 32 33#define MLOG_MASK_PREFIX ML_DISK_ALLOC 34#include <cluster/masklog.h> 35 36#include "ocfs2.h" 37 38#include "alloc.h" |
39#include "blockcheck.h" |
|
39#include "dlmglue.h" 40#include "inode.h" 41#include "journal.h" 42#include "localalloc.h" 43#include "suballoc.h" 44#include "super.h" 45#include "sysfile.h" 46 --- 330 unchanged lines hidden (view full) --- 377 378 alloc_copy = kmalloc(bh->b_size, GFP_NOFS); 379 if (!alloc_copy) { 380 status = -ENOMEM; 381 goto out_commit; 382 } 383 memcpy(alloc_copy, alloc, bh->b_size); 384 | 40#include "dlmglue.h" 41#include "inode.h" 42#include "journal.h" 43#include "localalloc.h" 44#include "suballoc.h" 45#include "super.h" 46#include "sysfile.h" 47 --- 330 unchanged lines hidden (view full) --- 378 379 alloc_copy = kmalloc(bh->b_size, GFP_NOFS); 380 if (!alloc_copy) { 381 status = -ENOMEM; 382 goto out_commit; 383 } 384 memcpy(alloc_copy, alloc, bh->b_size); 385 |
385 status = ocfs2_journal_access(handle, local_alloc_inode, bh, 386 OCFS2_JOURNAL_ACCESS_WRITE); | 386 status = ocfs2_journal_access_di(handle, local_alloc_inode, bh, 387 OCFS2_JOURNAL_ACCESS_WRITE); |
387 if (status < 0) { 388 mlog_errno(status); 389 goto out_commit; 390 } 391 392 ocfs2_clear_local_alloc(alloc); 393 394 status = ocfs2_journal_dirty(handle, bh); --- 76 unchanged lines hidden (view full) --- 471 status = -ENOMEM; 472 goto bail; 473 } 474 memcpy((*alloc_copy), alloc_bh->b_data, alloc_bh->b_size); 475 476 alloc = (struct ocfs2_dinode *) alloc_bh->b_data; 477 ocfs2_clear_local_alloc(alloc); 478 | 388 if (status < 0) { 389 mlog_errno(status); 390 goto out_commit; 391 } 392 393 ocfs2_clear_local_alloc(alloc); 394 395 status = ocfs2_journal_dirty(handle, bh); --- 76 unchanged lines hidden (view full) --- 472 status = -ENOMEM; 473 goto bail; 474 } 475 memcpy((*alloc_copy), alloc_bh->b_data, alloc_bh->b_size); 476 477 alloc = (struct ocfs2_dinode *) alloc_bh->b_data; 478 ocfs2_clear_local_alloc(alloc); 479 |
480 ocfs2_compute_meta_ecc(osb->sb, alloc_bh->b_data, &alloc->i_check); |
|
479 status = ocfs2_write_block(osb, alloc_bh, inode); 480 if (status < 0) 481 mlog_errno(status); 482 483bail: 484 if ((status < 0) && (*alloc_copy)) { 485 kfree(*alloc_copy); 486 *alloc_copy = NULL; --- 270 unchanged lines hidden (view full) --- 757 } 758 759 bitmap = la->la_bitmap; 760 *bit_off = le32_to_cpu(la->la_bm_off) + start; 761 /* local alloc is always contiguous by nature -- we never 762 * delete bits from it! */ 763 *num_bits = bits_wanted; 764 | 481 status = ocfs2_write_block(osb, alloc_bh, inode); 482 if (status < 0) 483 mlog_errno(status); 484 485bail: 486 if ((status < 0) && (*alloc_copy)) { 487 kfree(*alloc_copy); 488 *alloc_copy = NULL; --- 270 unchanged lines hidden (view full) --- 759 } 760 761 bitmap = la->la_bitmap; 762 *bit_off = le32_to_cpu(la->la_bm_off) + start; 763 /* local alloc is always contiguous by nature -- we never 764 * delete bits from it! */ 765 *num_bits = bits_wanted; 766 |
765 status = ocfs2_journal_access(handle, local_alloc_inode, 766 osb->local_alloc_bh, 767 OCFS2_JOURNAL_ACCESS_WRITE); | 767 status = ocfs2_journal_access_di(handle, local_alloc_inode, 768 osb->local_alloc_bh, 769 OCFS2_JOURNAL_ACCESS_WRITE); |
768 if (status < 0) { 769 mlog_errno(status); 770 goto bail; 771 } 772 773 while(bits_wanted--) 774 ocfs2_set_bit(start++, bitmap); 775 --- 459 unchanged lines hidden (view full) --- 1235 alloc_copy = kmalloc(osb->local_alloc_bh->b_size, GFP_NOFS); 1236 if (!alloc_copy) { 1237 status = -ENOMEM; 1238 mlog_errno(status); 1239 goto bail; 1240 } 1241 memcpy(alloc_copy, alloc, osb->local_alloc_bh->b_size); 1242 | 770 if (status < 0) { 771 mlog_errno(status); 772 goto bail; 773 } 774 775 while(bits_wanted--) 776 ocfs2_set_bit(start++, bitmap); 777 --- 459 unchanged lines hidden (view full) --- 1237 alloc_copy = kmalloc(osb->local_alloc_bh->b_size, GFP_NOFS); 1238 if (!alloc_copy) { 1239 status = -ENOMEM; 1240 mlog_errno(status); 1241 goto bail; 1242 } 1243 memcpy(alloc_copy, alloc, osb->local_alloc_bh->b_size); 1244 |
1243 status = ocfs2_journal_access(handle, local_alloc_inode, 1244 osb->local_alloc_bh, 1245 OCFS2_JOURNAL_ACCESS_WRITE); | 1245 status = ocfs2_journal_access_di(handle, local_alloc_inode, 1246 osb->local_alloc_bh, 1247 OCFS2_JOURNAL_ACCESS_WRITE); |
1246 if (status < 0) { 1247 mlog_errno(status); 1248 goto bail; 1249 } 1250 1251 ocfs2_clear_local_alloc(alloc); 1252 1253 status = ocfs2_journal_dirty(handle, osb->local_alloc_bh); --- 41 unchanged lines hidden --- | 1248 if (status < 0) { 1249 mlog_errno(status); 1250 goto bail; 1251 } 1252 1253 ocfs2_clear_local_alloc(alloc); 1254 1255 status = ocfs2_journal_dirty(handle, osb->local_alloc_bh); --- 41 unchanged lines hidden --- |