diff options
Diffstat (limited to 'fs/xfs/xfs_bmap.h')
-rw-r--r-- | fs/xfs/xfs_bmap.h | 58 |
1 files changed, 40 insertions, 18 deletions
diff --git a/fs/xfs/xfs_bmap.h b/fs/xfs/xfs_bmap.h index 56f62d2edc35..419dafb9d87d 100644 --- a/fs/xfs/xfs_bmap.h +++ b/fs/xfs/xfs_bmap.h | |||
@@ -95,6 +95,21 @@ typedef struct xfs_bmap_free | |||
95 | /* need write cache flushing and no */ | 95 | /* need write cache flushing and no */ |
96 | /* additional allocation alignments */ | 96 | /* additional allocation alignments */ |
97 | 97 | ||
98 | #define XFS_BMAPI_FLAGS \ | ||
99 | { XFS_BMAPI_WRITE, "WRITE" }, \ | ||
100 | { XFS_BMAPI_DELAY, "DELAY" }, \ | ||
101 | { XFS_BMAPI_ENTIRE, "ENTIRE" }, \ | ||
102 | { XFS_BMAPI_METADATA, "METADATA" }, \ | ||
103 | { XFS_BMAPI_EXACT, "EXACT" }, \ | ||
104 | { XFS_BMAPI_ATTRFORK, "ATTRFORK" }, \ | ||
105 | { XFS_BMAPI_ASYNC, "ASYNC" }, \ | ||
106 | { XFS_BMAPI_RSVBLOCKS, "RSVBLOCKS" }, \ | ||
107 | { XFS_BMAPI_PREALLOC, "PREALLOC" }, \ | ||
108 | { XFS_BMAPI_IGSTATE, "IGSTATE" }, \ | ||
109 | { XFS_BMAPI_CONTIG, "CONTIG" }, \ | ||
110 | { XFS_BMAPI_CONVERT, "CONVERT" } | ||
111 | |||
112 | |||
98 | static inline int xfs_bmapi_aflag(int w) | 113 | static inline int xfs_bmapi_aflag(int w) |
99 | { | 114 | { |
100 | return (w == XFS_ATTR_FORK ? XFS_BMAPI_ATTRFORK : 0); | 115 | return (w == XFS_ATTR_FORK ? XFS_BMAPI_ATTRFORK : 0); |
@@ -135,36 +150,43 @@ typedef struct xfs_bmalloca { | |||
135 | char conv; /* overwriting unwritten extents */ | 150 | char conv; /* overwriting unwritten extents */ |
136 | } xfs_bmalloca_t; | 151 | } xfs_bmalloca_t; |
137 | 152 | ||
138 | #if defined(__KERNEL__) && defined(XFS_BMAP_TRACE) | ||
139 | /* | 153 | /* |
140 | * Trace operations for bmap extent tracing | 154 | * Flags for xfs_bmap_add_extent*. |
141 | */ | 155 | */ |
142 | #define XFS_BMAP_KTRACE_DELETE 1 | 156 | #define BMAP_LEFT_CONTIG (1 << 0) |
143 | #define XFS_BMAP_KTRACE_INSERT 2 | 157 | #define BMAP_RIGHT_CONTIG (1 << 1) |
144 | #define XFS_BMAP_KTRACE_PRE_UP 3 | 158 | #define BMAP_LEFT_FILLING (1 << 2) |
145 | #define XFS_BMAP_KTRACE_POST_UP 4 | 159 | #define BMAP_RIGHT_FILLING (1 << 3) |
146 | 160 | #define BMAP_LEFT_DELAY (1 << 4) | |
147 | #define XFS_BMAP_TRACE_SIZE 4096 /* size of global trace buffer */ | 161 | #define BMAP_RIGHT_DELAY (1 << 5) |
148 | #define XFS_BMAP_KTRACE_SIZE 32 /* size of per-inode trace buffer */ | 162 | #define BMAP_LEFT_VALID (1 << 6) |
149 | extern ktrace_t *xfs_bmap_trace_buf; | 163 | #define BMAP_RIGHT_VALID (1 << 7) |
164 | #define BMAP_ATTRFORK (1 << 8) | ||
165 | |||
166 | #define XFS_BMAP_EXT_FLAGS \ | ||
167 | { BMAP_LEFT_CONTIG, "LC" }, \ | ||
168 | { BMAP_RIGHT_CONTIG, "RC" }, \ | ||
169 | { BMAP_LEFT_FILLING, "LF" }, \ | ||
170 | { BMAP_RIGHT_FILLING, "RF" }, \ | ||
171 | { BMAP_ATTRFORK, "ATTR" } | ||
150 | 172 | ||
151 | /* | 173 | /* |
152 | * Add bmap trace insert entries for all the contents of the extent list. | 174 | * Add bmap trace insert entries for all the contents of the extent list. |
175 | * | ||
176 | * Quite excessive tracing. Only do this for debug builds. | ||
153 | */ | 177 | */ |
178 | #if defined(__KERNEL) && defined(DEBUG) | ||
154 | void | 179 | void |
155 | xfs_bmap_trace_exlist( | 180 | xfs_bmap_trace_exlist( |
156 | const char *fname, /* function name */ | ||
157 | struct xfs_inode *ip, /* incore inode pointer */ | 181 | struct xfs_inode *ip, /* incore inode pointer */ |
158 | xfs_extnum_t cnt, /* count of entries in list */ | 182 | xfs_extnum_t cnt, /* count of entries in list */ |
159 | int whichfork); /* data or attr fork */ | 183 | int whichfork, |
184 | unsigned long caller_ip); /* data or attr fork */ | ||
160 | #define XFS_BMAP_TRACE_EXLIST(ip,c,w) \ | 185 | #define XFS_BMAP_TRACE_EXLIST(ip,c,w) \ |
161 | xfs_bmap_trace_exlist(__func__,ip,c,w) | 186 | xfs_bmap_trace_exlist(ip,c,w, _THIS_IP_) |
162 | 187 | #else | |
163 | #else /* __KERNEL__ && XFS_BMAP_TRACE */ | ||
164 | |||
165 | #define XFS_BMAP_TRACE_EXLIST(ip,c,w) | 188 | #define XFS_BMAP_TRACE_EXLIST(ip,c,w) |
166 | 189 | #endif | |
167 | #endif /* __KERNEL__ && XFS_BMAP_TRACE */ | ||
168 | 190 | ||
169 | /* | 191 | /* |
170 | * Convert inode from non-attributed to attributed. | 192 | * Convert inode from non-attributed to attributed. |