diff options
Diffstat (limited to 'fs/xfs/xfs_bmap.h')
-rw-r--r-- | fs/xfs/xfs_bmap.h | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/fs/xfs/xfs_bmap.h b/fs/xfs/xfs_bmap.h index 3e84e8e8d79e..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); |
@@ -148,36 +163,30 @@ typedef struct xfs_bmalloca { | |||
148 | #define BMAP_RIGHT_VALID (1 << 7) | 163 | #define BMAP_RIGHT_VALID (1 << 7) |
149 | #define BMAP_ATTRFORK (1 << 8) | 164 | #define BMAP_ATTRFORK (1 << 8) |
150 | 165 | ||
151 | #if defined(__KERNEL__) && defined(XFS_BMAP_TRACE) | 166 | #define XFS_BMAP_EXT_FLAGS \ |
152 | /* | 167 | { BMAP_LEFT_CONTIG, "LC" }, \ |
153 | * Trace operations for bmap extent tracing | 168 | { BMAP_RIGHT_CONTIG, "RC" }, \ |
154 | */ | 169 | { BMAP_LEFT_FILLING, "LF" }, \ |
155 | #define XFS_BMAP_KTRACE_DELETE 1 | 170 | { BMAP_RIGHT_FILLING, "RF" }, \ |
156 | #define XFS_BMAP_KTRACE_INSERT 2 | 171 | { BMAP_ATTRFORK, "ATTR" } |
157 | #define XFS_BMAP_KTRACE_PRE_UP 3 | ||
158 | #define XFS_BMAP_KTRACE_POST_UP 4 | ||
159 | |||
160 | #define XFS_BMAP_TRACE_SIZE 4096 /* size of global trace buffer */ | ||
161 | #define XFS_BMAP_KTRACE_SIZE 32 /* size of per-inode trace buffer */ | ||
162 | extern ktrace_t *xfs_bmap_trace_buf; | ||
163 | 172 | ||
164 | /* | 173 | /* |
165 | * 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. | ||
166 | */ | 177 | */ |
178 | #if defined(__KERNEL) && defined(DEBUG) | ||
167 | void | 179 | void |
168 | xfs_bmap_trace_exlist( | 180 | xfs_bmap_trace_exlist( |
169 | const char *fname, /* function name */ | ||
170 | struct xfs_inode *ip, /* incore inode pointer */ | 181 | struct xfs_inode *ip, /* incore inode pointer */ |
171 | xfs_extnum_t cnt, /* count of entries in list */ | 182 | xfs_extnum_t cnt, /* count of entries in list */ |
172 | int whichfork); /* data or attr fork */ | 183 | int whichfork, |
184 | unsigned long caller_ip); /* data or attr fork */ | ||
173 | #define XFS_BMAP_TRACE_EXLIST(ip,c,w) \ | 185 | #define XFS_BMAP_TRACE_EXLIST(ip,c,w) \ |
174 | xfs_bmap_trace_exlist(__func__,ip,c,w) | 186 | xfs_bmap_trace_exlist(ip,c,w, _THIS_IP_) |
175 | 187 | #else | |
176 | #else /* __KERNEL__ && XFS_BMAP_TRACE */ | ||
177 | |||
178 | #define XFS_BMAP_TRACE_EXLIST(ip,c,w) | 188 | #define XFS_BMAP_TRACE_EXLIST(ip,c,w) |
179 | 189 | #endif | |
180 | #endif /* __KERNEL__ && XFS_BMAP_TRACE */ | ||
181 | 190 | ||
182 | /* | 191 | /* |
183 | * Convert inode from non-attributed to attributed. | 192 | * Convert inode from non-attributed to attributed. |