Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352927
b: refs/heads/master
c: 4f3b578
h: refs/heads/master
i:
  352925: 0110443
  352923: 711f48d
  352919: 3e9b0e8
  352911: df16bb3
  352895: e61a585
v: v3
  • Loading branch information
Jeff Liu authored and Ben Myers committed Feb 1, 2013
1 parent 03c382a commit 9502594
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2729423cf2ef3ac51d040f24a5ddd84c1b2acc70
refs/heads/master: 4f3b57832ba39223c6f8823d07b9fb206e282ced
31 changes: 31 additions & 0 deletions trunk/fs/xfs/xfs_trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,45 @@
#include "xfs_extent_busy.h"
#include "xfs_bmap.h"
#include "xfs_quota.h"
#include "xfs_qm.h"
#include "xfs_trans_priv.h"
#include "xfs_trans_space.h"
#include "xfs_inode_item.h"
#include "xfs_log_priv.h"
#include "xfs_buf_item.h"
#include "xfs_trace.h"

kmem_zone_t *xfs_trans_zone;
kmem_zone_t *xfs_log_item_desc_zone;

/*
* A buffer has a format structure overhead in the log in addition
* to the data, so we need to take this into account when reserving
* space in a transaction for a buffer. Round the space required up
* to a multiple of 128 bytes so that we don't change the historical
* reservation that has been used for this overhead.
*/
STATIC uint
xfs_buf_log_overhead(void)
{
return round_up(sizeof(struct xlog_op_header) +
sizeof(struct xfs_buf_log_format), 128);
}

/*
* Calculate out transaction log reservation per item in bytes.
*
* The nbufs argument is used to indicate the number of items that
* will be changed in a transaction. size is used to tell how many
* bytes should be reserved per item.
*/
STATIC uint
xfs_calc_buf_res(
uint nbufs,
uint size)
{
return nbufs * (size + xfs_buf_log_overhead());
}

/*
* Various log reservation values.
Expand Down

0 comments on commit 9502594

Please sign in to comment.