Blame view
fs/xfs/xfs_log.h
4.19 KB
0b61f8a40 xfs: convert to S... |
1 |
// SPDX-License-Identifier: GPL-2.0 |
1da177e4c Linux-2.6.12-rc2 |
2 |
/* |
7b7187698 [XFS] Update lice... |
3 4 |
* Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. * All Rights Reserved. |
1da177e4c Linux-2.6.12-rc2 |
5 6 7 |
*/ #ifndef __XFS_LOG_H__ #define __XFS_LOG_H__ |
89ae379d5 xfs: use a list_h... |
8 |
struct xfs_cil_ctx; |
fc06c6d06 xfs: separate out... |
9 10 11 12 13 14 |
struct xfs_log_vec { struct xfs_log_vec *lv_next; /* next lv in build list */ int lv_niovecs; /* number of iovecs in lv */ struct xfs_log_iovec *lv_iovecp; /* iovec array */ struct xfs_log_item *lv_item; /* owner */ char *lv_buf; /* formatted buffer */ |
110dc24ad xfs: log vector r... |
15 16 |
int lv_bytes; /* accounted space in buffer */ int lv_buf_len; /* aligned size of buffer */ |
7492c5b42 xfs: Reduce alloc... |
17 |
int lv_size; /* size of allocated lv */ |
fc06c6d06 xfs: separate out... |
18 19 20 |
}; #define XFS_LOG_VEC_ORDERED (-1) |
1234351cb xfs: introduce xl... |
21 |
static inline void * |
bde7cff67 xfs: format log i... |
22 23 |
xlog_prepare_iovec(struct xfs_log_vec *lv, struct xfs_log_iovec **vecp, uint type) |
1234351cb xfs: introduce xl... |
24 25 |
{ struct xfs_log_iovec *vec = *vecp; |
bde7cff67 xfs: format log i... |
26 27 28 29 30 31 |
if (vec) { ASSERT(vec - lv->lv_iovecp < lv->lv_niovecs); vec++; } else { vec = &lv->lv_iovecp[0]; } |
1234351cb xfs: introduce xl... |
32 |
vec->i_type = type; |
bde7cff67 xfs: format log i... |
33 34 35 |
vec->i_addr = lv->lv_buf + lv->lv_buf_len; ASSERT(IS_ALIGNED((unsigned long)vec->i_addr, sizeof(uint64_t))); |
1234351cb xfs: introduce xl... |
36 |
|
bde7cff67 xfs: format log i... |
37 |
*vecp = vec; |
1234351cb xfs: introduce xl... |
38 39 |
return vec->i_addr; } |
110dc24ad xfs: log vector r... |
40 41 42 43 44 45 46 47 48 49 |
/* * We need to make sure the next buffer is naturally aligned for the biggest * basic data type we put into it. We already accounted for this padding when * sizing the buffer. * * However, this padding does not get written into the log, and hence we have to * track the space used by the log vectors separately to prevent log space hangs * due to inaccurate accounting (i.e. a leak) of the used log space through the * CIL context ticket. */ |
bde7cff67 xfs: format log i... |
50 51 52 |
static inline void xlog_finish_iovec(struct xfs_log_vec *lv, struct xfs_log_iovec *vec, int len) { |
bde7cff67 xfs: format log i... |
53 |
lv->lv_buf_len += round_up(len, sizeof(uint64_t)); |
110dc24ad xfs: log vector r... |
54 |
lv->lv_bytes += len; |
bde7cff67 xfs: format log i... |
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
vec->i_len = len; } static inline void * xlog_copy_iovec(struct xfs_log_vec *lv, struct xfs_log_iovec **vecp, uint type, void *data, int len) { void *buf; buf = xlog_prepare_iovec(lv, vecp, type); memcpy(buf, data, len); xlog_finish_iovec(lv, *vecp, len); return buf; } |
fc06c6d06 xfs: separate out... |
69 |
/* |
c41564b5a [XFS] We really s... |
70 |
* By comparing each component, we don't have to worry about extra |
1da177e4c Linux-2.6.12-rc2 |
71 72 |
* endian issues in treating two 32 bit numbers as one 64 bit number */ |
a13656470 [PATCH] remove gc... |
73 |
static inline xfs_lsn_t _lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2) |
1da177e4c Linux-2.6.12-rc2 |
74 75 76 77 78 79 80 81 82 83 84 85 86 |
{ if (CYCLE_LSN(lsn1) != CYCLE_LSN(lsn2)) return (CYCLE_LSN(lsn1)<CYCLE_LSN(lsn2))? -999 : 999; if (BLOCK_LSN(lsn1) != BLOCK_LSN(lsn2)) return (BLOCK_LSN(lsn1)<BLOCK_LSN(lsn2))? -999 : 999; return 0; } #define XFS_LSN_CMP(x,y) _lsn_cmp(x,y) /* |
1da177e4c Linux-2.6.12-rc2 |
87 88 89 |
* Flags to xfs_log_force() * * XFS_LOG_SYNC: Synchronous force in-core log to disk |
1da177e4c Linux-2.6.12-rc2 |
90 91 |
*/ #define XFS_LOG_SYNC 0x1 |
1da177e4c Linux-2.6.12-rc2 |
92 |
|
1da177e4c Linux-2.6.12-rc2 |
93 94 |
/* Log manager interfaces */ struct xfs_mount; |
35a8a72f0 xfs: stop passing... |
95 |
struct xlog_in_core; |
cc09c0dc5 [XFS] Fix double ... |
96 |
struct xlog_ticket; |
43f5efc5b xfs: factor log i... |
97 98 |
struct xfs_log_item; struct xfs_item_ops; |
955833cf2 xfs: make the log... |
99 |
struct xfs_trans; |
35a8a72f0 xfs: stop passing... |
100 |
|
60e5bb784 xfs: merge _xfs_l... |
101 |
int xfs_log_force(struct xfs_mount *mp, uint flags); |
656de4ffa xfs: merge _xfs_l... |
102 103 |
int xfs_log_force_lsn(struct xfs_mount *mp, xfs_lsn_t lsn, uint flags, int *log_forced); |
1da177e4c Linux-2.6.12-rc2 |
104 105 106 107 |
int xfs_log_mount(struct xfs_mount *mp, struct xfs_buftarg *log_target, xfs_daddr_t start_block, int num_bblocks); |
4249023a5 [XFS] cleanup xfs... |
108 |
int xfs_log_mount_finish(struct xfs_mount *mp); |
a7a9250e1 fs: xfs: xfs_log:... |
109 |
void xfs_log_mount_cancel(struct xfs_mount *); |
09a423a3d xfs: split tail_l... |
110 |
xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp); |
1c3046254 xfs: allow assign... |
111 |
xfs_lsn_t xlog_assign_tail_lsn_locked(struct xfs_mount *mp); |
cfb7cdca0 xfs: cleanup xfs_... |
112 |
void xfs_log_space_wake(struct xfs_mount *mp); |
f97a43e43 xfs: simplify the... |
113 |
void xfs_log_release_iclog(struct xlog_in_core *iclog); |
1da177e4c Linux-2.6.12-rc2 |
114 115 116 |
int xfs_log_reserve(struct xfs_mount *mp, int length, int count, |
35a8a72f0 xfs: stop passing... |
117 |
struct xlog_ticket **ticket, |
c8ce540db xfs: remove doubl... |
118 |
uint8_t clientid, |
710b1e2c2 xfs: remove trans... |
119 |
bool permanent); |
9006fb91c xfs: split and cl... |
120 |
int xfs_log_regrant(struct xfs_mount *mp, struct xlog_ticket *tic); |
21b699c89 xfs: cleanup log ... |
121 |
void xfs_log_unmount(struct xfs_mount *mp); |
1da177e4c Linux-2.6.12-rc2 |
122 |
int xfs_log_force_umount(struct xfs_mount *mp, int logerror); |
1da177e4c Linux-2.6.12-rc2 |
123 |
|
71e330b59 xfs: Introduce de... |
124 |
struct xlog_ticket *xfs_log_ticket_get(struct xlog_ticket *ticket); |
cc09c0dc5 [XFS] Fix double ... |
125 |
void xfs_log_ticket_put(struct xlog_ticket *ticket); |
c6f972644 xfs: convert xfs_... |
126 |
void xfs_log_commit_cil(struct xfs_mount *mp, struct xfs_trans *tp, |
70393313d xfs: saner xfs_tr... |
127 |
xfs_lsn_t *commit_lsn, bool regrant); |
12e6a0f44 xfs: remove the a... |
128 |
void xlog_cil_process_committed(struct list_head *list); |
ccf7c23fc xfs: Ensure inode... |
129 |
bool xfs_log_item_in_current_chkpt(struct xfs_log_item *lip); |
71e330b59 xfs: Introduce de... |
130 |
|
f661f1e0b xfs: sync work is... |
131 |
void xfs_log_work_queue(struct xfs_mount *mp); |
c75921a72 xfs: xfs_quiesce_... |
132 |
void xfs_log_quiesce(struct xfs_mount *mp); |
a45086e27 xfs: validate met... |
133 |
bool xfs_log_check_lsn(struct xfs_mount *, xfs_lsn_t); |
0c60d3aa0 xfs: refactor log... |
134 |
bool xfs_log_in_recovery(struct xfs_mount *); |
f661f1e0b xfs: sync work is... |
135 |
|
ed1575daf xfs: expose the l... |
136 |
xfs_lsn_t xlog_grant_push_threshold(struct xlog *log, int need_bytes); |
1da177e4c Linux-2.6.12-rc2 |
137 |
#endif /* __XFS_LOG_H__ */ |