~ubuntu-branches/ubuntu/utopic/xfsprogs/utopic-proposed

« back to all changes in this revision

Viewing changes to include/xfs_log.h

  • Committer: Bazaar Package Importer
  • Author(s): Nathan Scott
  • Date: 2009-05-06 11:29:18 UTC
  • mfrom: (8.1.1 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090506112918-uzoyzcp90rtr8td7
Tags: 3.0.2
New bugfix release

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#define CYCLE_LSN(lsn) ((uint)((lsn)>>32))
24
24
#define BLOCK_LSN(lsn) ((uint)(lsn))
 
25
 
25
26
/* this is used in a spot where we might otherwise double-endian-flip */
26
 
#define CYCLE_LSN_DISK(lsn) (((uint *)&(lsn))[0])
 
27
#define CYCLE_LSN_DISK(lsn) (((__be32 *)&(lsn))[0])
27
28
 
28
29
#ifdef __KERNEL__
29
30
/*
30
 
 * By comparing each compnent, we don't have to worry about extra
 
31
 * By comparing each component, we don't have to worry about extra
31
32
 * endian issues in treating two 32 bit numbers as one 64 bit number
32
33
 */
33
 
static
34
 
#if defined(__GNUC__) && (__GNUC__ == 2) && ( (__GNUC_MINOR__ == 95) || (__GNUC_MINOR__ == 96))
35
 
__attribute__((unused)) /* gcc 2.95, 2.96 miscompile this when inlined */
36
 
#else
37
 
__inline__
38
 
#endif
39
 
xfs_lsn_t       _lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2)
 
34
static inline xfs_lsn_t _lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2)
40
35
{
41
36
        if (CYCLE_LSN(lsn1) != CYCLE_LSN(lsn2))
42
37
                return (CYCLE_LSN(lsn1)<CYCLE_LSN(lsn2))? -999 : 999;
54
49
 */
55
50
 
56
51
/*
57
 
 * Flags to xfs_log_mount
58
 
 */
59
 
#define XFS_LOG_RECOVER         0x1
60
 
 
61
 
/*
62
52
 * Flags to xfs_log_done()
63
53
 */
64
54
#define XFS_LOG_REL_PERM_RESERV 0x1
65
55
 
66
 
 
67
56
/*
68
57
 * Flags to xfs_log_reserve()
69
58
 *
76
65
#define XFS_LOG_SLEEP           0x0
77
66
#define XFS_LOG_NOSLEEP         0x1
78
67
#define XFS_LOG_PERM_RESERV     0x2
79
 
#define XFS_LOG_RESV_ALL        (XFS_LOG_NOSLEEP|XFS_LOG_PERM_RESERV)
80
 
 
81
68
 
82
69
/*
83
70
 * Flags to xfs_log_force()
102
89
 
103
90
 
104
91
/* Region types for iovec's i_type */
105
 
#if defined(XFS_LOG_RES_DEBUG)
106
92
#define XLOG_REG_TYPE_BFORMAT           1
107
93
#define XLOG_REG_TYPE_BCHUNK            2
108
94
#define XLOG_REG_TYPE_EFI_FORMAT        3
123
109
#define XLOG_REG_TYPE_COMMIT            18
124
110
#define XLOG_REG_TYPE_TRANSHDR          19
125
111
#define XLOG_REG_TYPE_MAX               19
126
 
#endif
127
112
 
128
 
#if defined(XFS_LOG_RES_DEBUG)
129
113
#define XLOG_VEC_SET_TYPE(vecp, t) ((vecp)->i_type = (t))
130
 
#else
131
 
#define XLOG_VEC_SET_TYPE(vecp, t)
132
 
#endif
133
 
 
134
114
 
135
115
typedef struct xfs_log_iovec {
136
116
        xfs_caddr_t             i_addr;         /* beginning address of region */
137
117
        int             i_len;          /* length in bytes of region */
138
 
#if defined(XFS_LOG_RES_DEBUG)
139
 
        uint            i_type;         /* type of region */
140
 
#endif
 
118
        uint            i_type;         /* type of region */
141
119
} xfs_log_iovec_t;
142
120
 
143
121
typedef void* xfs_log_ticket_t;
164
142
                         xfs_lsn_t      lsn,
165
143
                         uint           flags,
166
144
                         int            *log_forced);
167
 
#define xfs_log_force(mp, lsn, flags) \
168
 
        _xfs_log_force(mp, lsn, flags, NULL);
 
145
void      xfs_log_force(struct xfs_mount        *mp,
 
146
                        xfs_lsn_t               lsn,
 
147
                        uint                    flags);
169
148
int       xfs_log_mount(struct xfs_mount        *mp,
170
149
                        struct xfs_buftarg      *log_target,
171
150
                        xfs_daddr_t             start_block,
172
151
                        int                     num_bblocks);
173
 
int       xfs_log_mount_finish(struct xfs_mount *mp, int);
 
152
int       xfs_log_mount_finish(struct xfs_mount *mp);
174
153
void      xfs_log_move_tail(struct xfs_mount    *mp,
175
154
                            xfs_lsn_t           tail_lsn);
176
155
int       xfs_log_notify(struct xfs_mount       *mp,