Skip to content

Commit

Permalink
xfs: rename log structure to xlog
Browse files Browse the repository at this point in the history
Rename the XFS log structure to xlog to help crash distinquish it from the
other logs in Linux.

Signed-off-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
  • Loading branch information
Mark Tinguely authored and Ben Myers committed Jun 21, 2012
1 parent 8866fc6 commit f7bdf03
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 88 deletions.
76 changes: 44 additions & 32 deletions 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 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 f7bdf03

Please sign in to comment.