Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311206
b: refs/heads/master
c: f7bdf03
h: refs/heads/master
v: v3
  • Loading branch information
Mark Tinguely authored and Ben Myers committed Jun 21, 2012
1 parent 9f72cca commit 013a903
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 89 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8866fc6fa55e31b2bce931b7963ff16641b39dc7
refs/heads/master: f7bdf03a99efc083608cd9c0c3e03abff311c79e
76 changes: 44 additions & 32 deletions trunk/fs/xfs/xfs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@
kmem_zone_t *xfs_log_ticket_zone;

/* Local miscellaneous function prototypes */
STATIC int xlog_commit_record(struct log *log, struct xlog_ticket *ticket,
xlog_in_core_t **, xfs_lsn_t *);
STATIC int
xlog_commit_record(
struct xlog *log,
struct xlog_ticket *ticket,
struct xlog_in_core **iclog,
xfs_lsn_t *commitlsnp);

STATIC xlog_t * xlog_alloc_log(xfs_mount_t *mp,
xfs_buftarg_t *log_target,
xfs_daddr_t blk_offset,
int num_bblks);
STATIC int xlog_space_left(struct log *log, atomic64_t *head);
STATIC int
xlog_space_left(
struct xlog *log,
atomic64_t *head);
STATIC int xlog_sync(xlog_t *log, xlog_in_core_t *iclog);
STATIC void xlog_dealloc_log(xlog_t *log);

Expand All @@ -64,16 +72,20 @@ STATIC void xlog_state_switch_iclogs(xlog_t *log,
int eventual_size);
STATIC void xlog_state_want_sync(xlog_t *log, xlog_in_core_t *iclog);

STATIC void xlog_grant_push_ail(struct log *log,
int need_bytes);
STATIC void
xlog_grant_push_ail(
struct xlog *log,
int need_bytes);
STATIC void xlog_regrant_reserve_log_space(xlog_t *log,
xlog_ticket_t *ticket);
STATIC void xlog_ungrant_log_space(xlog_t *log,
xlog_ticket_t *ticket);

#if defined(DEBUG)
STATIC void xlog_verify_dest_ptr(xlog_t *log, char *ptr);
STATIC void xlog_verify_grant_tail(struct log *log);
STATIC void
xlog_verify_grant_tail(
struct xlog *log);
STATIC void xlog_verify_iclog(xlog_t *log, xlog_in_core_t *iclog,
int count, boolean_t syncing);
STATIC void xlog_verify_tail_lsn(xlog_t *log, xlog_in_core_t *iclog,
Expand All @@ -89,9 +101,9 @@ STATIC int xlog_iclogs_empty(xlog_t *log);

static void
xlog_grant_sub_space(
struct log *log,
atomic64_t *head,
int bytes)
struct xlog *log,
atomic64_t *head,
int bytes)
{
int64_t head_val = atomic64_read(head);
int64_t new, old;
Expand All @@ -115,9 +127,9 @@ xlog_grant_sub_space(

static void
xlog_grant_add_space(
struct log *log,
atomic64_t *head,
int bytes)
struct xlog *log,
atomic64_t *head,
int bytes)
{
int64_t head_val = atomic64_read(head);
int64_t new, old;
Expand Down Expand Up @@ -165,7 +177,7 @@ xlog_grant_head_wake_all(

static inline int
xlog_ticket_reservation(
struct log *log,
struct xlog *log,
struct xlog_grant_head *head,
struct xlog_ticket *tic)
{
Expand All @@ -182,7 +194,7 @@ xlog_ticket_reservation(

STATIC bool
xlog_grant_head_wake(
struct log *log,
struct xlog *log,
struct xlog_grant_head *head,
int *free_bytes)
{
Expand All @@ -204,7 +216,7 @@ xlog_grant_head_wake(

STATIC int
xlog_grant_head_wait(
struct log *log,
struct xlog *log,
struct xlog_grant_head *head,
struct xlog_ticket *tic,
int need_bytes)
Expand Down Expand Up @@ -256,7 +268,7 @@ xlog_grant_head_wait(
*/
STATIC int
xlog_grant_head_check(
struct log *log,
struct xlog *log,
struct xlog_grant_head *head,
struct xlog_ticket *tic,
int *need_bytes)
Expand Down Expand Up @@ -323,7 +335,7 @@ xfs_log_regrant(
struct xfs_mount *mp,
struct xlog_ticket *tic)
{
struct log *log = mp->m_log;
struct xlog *log = mp->m_log;
int need_bytes;
int error = 0;

Expand Down Expand Up @@ -389,7 +401,7 @@ xfs_log_reserve(
bool permanent,
uint t_type)
{
struct log *log = mp->m_log;
struct xlog *log = mp->m_log;
struct xlog_ticket *tic;
int need_bytes;
int error = 0;
Expand Down Expand Up @@ -465,7 +477,7 @@ xfs_log_done(
struct xlog_in_core **iclog,
uint flags)
{
struct log *log = mp->m_log;
struct xlog *log = mp->m_log;
xfs_lsn_t lsn = 0;

if (XLOG_FORCED_SHUTDOWN(log) ||
Expand Down Expand Up @@ -839,7 +851,7 @@ void
xfs_log_space_wake(
struct xfs_mount *mp)
{
struct log *log = mp->m_log;
struct xlog *log = mp->m_log;
int free_bytes;

if (XLOG_FORCED_SHUTDOWN(log))
Expand Down Expand Up @@ -917,7 +929,7 @@ xfs_lsn_t
xlog_assign_tail_lsn_locked(
struct xfs_mount *mp)
{
struct log *log = mp->m_log;
struct xlog *log = mp->m_log;
struct xfs_log_item *lip;
xfs_lsn_t tail_lsn;

Expand Down Expand Up @@ -966,7 +978,7 @@ xlog_assign_tail_lsn(
*/
STATIC int
xlog_space_left(
struct log *log,
struct xlog *log,
atomic64_t *head)
{
int free_bytes;
Expand Down Expand Up @@ -1278,7 +1290,7 @@ xlog_alloc_log(xfs_mount_t *mp,
*/
STATIC int
xlog_commit_record(
struct log *log,
struct xlog *log,
struct xlog_ticket *ticket,
struct xlog_in_core **iclog,
xfs_lsn_t *commitlsnp)
Expand Down Expand Up @@ -1312,7 +1324,7 @@ xlog_commit_record(
*/
STATIC void
xlog_grant_push_ail(
struct log *log,
struct xlog *log,
int need_bytes)
{
xfs_lsn_t threshold_lsn = 0;
Expand Down Expand Up @@ -1791,7 +1803,7 @@ xlog_write_start_rec(

static xlog_op_header_t *
xlog_write_setup_ophdr(
struct log *log,
struct xlog *log,
struct xlog_op_header *ophdr,
struct xlog_ticket *ticket,
uint flags)
Expand Down Expand Up @@ -1874,7 +1886,7 @@ xlog_write_setup_copy(

static int
xlog_write_copy_finish(
struct log *log,
struct xlog *log,
struct xlog_in_core *iclog,
uint flags,
int *record_cnt,
Expand Down Expand Up @@ -1959,7 +1971,7 @@ xlog_write_copy_finish(
*/
int
xlog_write(
struct log *log,
struct xlog *log,
struct xfs_log_vec *log_vector,
struct xlog_ticket *ticket,
xfs_lsn_t *start_lsn,
Expand Down Expand Up @@ -2822,7 +2834,7 @@ _xfs_log_force(
uint flags,
int *log_flushed)
{
struct log *log = mp->m_log;
struct xlog *log = mp->m_log;
struct xlog_in_core *iclog;
xfs_lsn_t lsn;

Expand Down Expand Up @@ -2970,7 +2982,7 @@ _xfs_log_force_lsn(
uint flags,
int *log_flushed)
{
struct log *log = mp->m_log;
struct xlog *log = mp->m_log;
struct xlog_in_core *iclog;
int already_slept = 0;

Expand Down Expand Up @@ -3148,7 +3160,7 @@ xfs_log_ticket_get(
*/
xlog_ticket_t *
xlog_ticket_alloc(
struct log *log,
struct xlog *log,
int unit_bytes,
int cnt,
char client,
Expand Down Expand Up @@ -3279,7 +3291,7 @@ xlog_ticket_alloc(
*/
void
xlog_verify_dest_ptr(
struct log *log,
struct xlog *log,
char *ptr)
{
int i;
Expand Down Expand Up @@ -3308,7 +3320,7 @@ xlog_verify_dest_ptr(
*/
STATIC void
xlog_verify_grant_tail(
struct log *log)
struct xlog *log)
{
int tail_cycle, tail_blocks;
int cycle, space;
Expand Down
22 changes: 11 additions & 11 deletions trunk/fs/xfs/xfs_log_cil.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
*/
static struct xlog_ticket *
xlog_cil_ticket_alloc(
struct log *log)
struct xlog *log)
{
struct xlog_ticket *tic;

Expand Down Expand Up @@ -72,7 +72,7 @@ xlog_cil_ticket_alloc(
*/
void
xlog_cil_init_post_recovery(
struct log *log)
struct xlog *log)
{
log->l_cilp->xc_ctx->ticket = xlog_cil_ticket_alloc(log);
log->l_cilp->xc_ctx->sequence = 1;
Expand Down Expand Up @@ -182,7 +182,7 @@ xlog_cil_prepare_log_vecs(
*/
STATIC void
xfs_cil_prepare_item(
struct log *log,
struct xlog *log,
struct xfs_log_vec *lv,
int *len,
int *diff_iovecs)
Expand Down Expand Up @@ -231,7 +231,7 @@ xfs_cil_prepare_item(
*/
static void
xlog_cil_insert_items(
struct log *log,
struct xlog *log,
struct xfs_log_vec *log_vector,
struct xlog_ticket *ticket)
{
Expand Down Expand Up @@ -373,7 +373,7 @@ xlog_cil_committed(
*/
STATIC int
xlog_cil_push(
struct log *log)
struct xlog *log)
{
struct xfs_cil *cil = log->l_cilp;
struct xfs_log_vec *lv;
Expand Down Expand Up @@ -601,7 +601,7 @@ xlog_cil_push_work(
*/
static void
xlog_cil_push_background(
struct log *log)
struct xlog *log)
{
struct xfs_cil *cil = log->l_cilp;

Expand Down Expand Up @@ -629,7 +629,7 @@ xlog_cil_push_background(

static void
xlog_cil_push_foreground(
struct log *log,
struct xlog *log,
xfs_lsn_t push_seq)
{
struct xfs_cil *cil = log->l_cilp;
Expand Down Expand Up @@ -683,7 +683,7 @@ xfs_log_commit_cil(
xfs_lsn_t *commit_lsn,
int flags)
{
struct log *log = mp->m_log;
struct xlog *log = mp->m_log;
int log_flags = 0;
struct xfs_log_vec *log_vector;

Expand Down Expand Up @@ -754,7 +754,7 @@ xfs_log_commit_cil(
*/
xfs_lsn_t
xlog_cil_force_lsn(
struct log *log,
struct xlog *log,
xfs_lsn_t sequence)
{
struct xfs_cil *cil = log->l_cilp;
Expand Down Expand Up @@ -833,7 +833,7 @@ xfs_log_item_in_current_chkpt(
*/
int
xlog_cil_init(
struct log *log)
struct xlog *log)
{
struct xfs_cil *cil;
struct xfs_cil_ctx *ctx;
Expand Down Expand Up @@ -869,7 +869,7 @@ xlog_cil_init(

void
xlog_cil_destroy(
struct log *log)
struct xlog *log)
{
if (log->l_cilp->xc_ctx) {
if (log->l_cilp->xc_ctx->ticket)
Expand Down
Loading

0 comments on commit 013a903

Please sign in to comment.