diff options
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.h | 102 | ||||
-rw-r--r-- | fs/xfs/xfs_alloc.h | 20 | ||||
-rw-r--r-- | fs/xfs/xfs_iomap.h | 20 |
3 files changed, 71 insertions, 71 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h index 2a9749a3a762..814f9e83b516 100644 --- a/fs/xfs/linux-2.6/xfs_buf.h +++ b/fs/xfs/linux-2.6/xfs_buf.h | |||
@@ -44,57 +44,57 @@ typedef enum { | |||
44 | XBRW_ZERO = 3, /* Zero target memory */ | 44 | XBRW_ZERO = 3, /* Zero target memory */ |
45 | } xfs_buf_rw_t; | 45 | } xfs_buf_rw_t; |
46 | 46 | ||
47 | typedef enum { | 47 | #define XBF_READ (1 << 0) /* buffer intended for reading from device */ |
48 | XBF_READ = (1 << 0), /* buffer intended for reading from device */ | 48 | #define XBF_WRITE (1 << 1) /* buffer intended for writing to device */ |
49 | XBF_WRITE = (1 << 1), /* buffer intended for writing to device */ | 49 | #define XBF_MAPPED (1 << 2) /* buffer mapped (b_addr valid) */ |
50 | XBF_MAPPED = (1 << 2), /* buffer mapped (b_addr valid) */ | 50 | #define XBF_ASYNC (1 << 4) /* initiator will not wait for completion */ |
51 | XBF_ASYNC = (1 << 4), /* initiator will not wait for completion */ | 51 | #define XBF_DONE (1 << 5) /* all pages in the buffer uptodate */ |
52 | XBF_DONE = (1 << 5), /* all pages in the buffer uptodate */ | 52 | #define XBF_DELWRI (1 << 6) /* buffer has dirty pages */ |
53 | XBF_DELWRI = (1 << 6), /* buffer has dirty pages */ | 53 | #define XBF_STALE (1 << 7) /* buffer has been staled, do not find it */ |
54 | XBF_STALE = (1 << 7), /* buffer has been staled, do not find it */ | 54 | #define XBF_FS_MANAGED (1 << 8) /* filesystem controls freeing memory */ |
55 | XBF_FS_MANAGED = (1 << 8), /* filesystem controls freeing memory */ | 55 | #define XBF_ORDERED (1 << 11)/* use ordered writes */ |
56 | XBF_ORDERED = (1 << 11), /* use ordered writes */ | 56 | #define XBF_READ_AHEAD (1 << 12)/* asynchronous read-ahead */ |
57 | XBF_READ_AHEAD = (1 << 12), /* asynchronous read-ahead */ | 57 | #define XBF_LOG_BUFFER (1 << 13)/* this is a buffer used for the log */ |
58 | XBF_LOG_BUFFER = (1 << 13), /* this is a buffer used for the log */ | 58 | |
59 | 59 | /* flags used only as arguments to access routines */ | |
60 | /* flags used only as arguments to access routines */ | 60 | #define XBF_LOCK (1 << 14)/* lock requested */ |
61 | XBF_LOCK = (1 << 14), /* lock requested */ | 61 | #define XBF_TRYLOCK (1 << 15)/* lock requested, but do not wait */ |
62 | XBF_TRYLOCK = (1 << 15), /* lock requested, but do not wait */ | 62 | #define XBF_DONT_BLOCK (1 << 16)/* do not block in current thread */ |
63 | XBF_DONT_BLOCK = (1 << 16), /* do not block in current thread */ | 63 | |
64 | 64 | /* flags used only internally */ | |
65 | /* flags used only internally */ | 65 | #define _XBF_PAGE_CACHE (1 << 17)/* backed by pagecache */ |
66 | _XBF_PAGE_CACHE = (1 << 17),/* backed by pagecache */ | 66 | #define _XBF_PAGES (1 << 18)/* backed by refcounted pages */ |
67 | _XBF_PAGES = (1 << 18), /* backed by refcounted pages */ | 67 | #define _XBF_RUN_QUEUES (1 << 19)/* run block device task queue */ |
68 | _XBF_RUN_QUEUES = (1 << 19),/* run block device task queue */ | 68 | #define _XBF_DELWRI_Q (1 << 21)/* buffer on delwri queue */ |
69 | _XBF_DELWRI_Q = (1 << 21), /* buffer on delwri queue */ | 69 | |
70 | 70 | /* | |
71 | /* | 71 | * Special flag for supporting metadata blocks smaller than a FSB. |
72 | * Special flag for supporting metadata blocks smaller than a FSB. | 72 | * |
73 | * | 73 | * In this case we can have multiple xfs_buf_t on a single page and |
74 | * In this case we can have multiple xfs_buf_t on a single page and | 74 | * need to lock out concurrent xfs_buf_t readers as they only |
75 | * need to lock out concurrent xfs_buf_t readers as they only | 75 | * serialise access to the buffer. |
76 | * serialise access to the buffer. | 76 | * |
77 | * | 77 | * If the FSB size >= PAGE_CACHE_SIZE case, we have no serialisation |
78 | * If the FSB size >= PAGE_CACHE_SIZE case, we have no serialisation | 78 | * between reads of the page. Hence we can have one thread read the |
79 | * between reads of the page. Hence we can have one thread read the | 79 | * page and modify it, but then race with another thread that thinks |
80 | * page and modify it, but then race with another thread that thinks | 80 | * the page is not up-to-date and hence reads it again. |
81 | * the page is not up-to-date and hence reads it again. | 81 | * |
82 | * | 82 | * The result is that the first modifcation to the page is lost. |
83 | * The result is that the first modifcation to the page is lost. | 83 | * This sort of AGF/AGI reading race can happen when unlinking inodes |
84 | * This sort of AGF/AGI reading race can happen when unlinking inodes | 84 | * that require truncation and results in the AGI unlinked list |
85 | * that require truncation and results in the AGI unlinked list | 85 | * modifications being lost. |
86 | * modifications being lost. | 86 | */ |
87 | */ | 87 | #define _XBF_PAGE_LOCKED (1 << 22) |
88 | _XBF_PAGE_LOCKED = (1 << 22), | 88 | |
89 | 89 | /* | |
90 | /* | 90 | * If we try a barrier write, but it fails we have to communicate |
91 | * If we try a barrier write, but it fails we have to communicate | 91 | * this to the upper layers. Unfortunately b_error gets overwritten |
92 | * this to the upper layers. Unfortunately b_error gets overwritten | 92 | * when the buffer is re-issued so we have to add another flag to |
93 | * when the buffer is re-issued so we have to add another flag to | 93 | * keep this information. |
94 | * keep this information. | 94 | */ |
95 | */ | 95 | #define _XFS_BARRIER_FAILED (1 << 23) |
96 | _XFS_BARRIER_FAILED = (1 << 23), | 96 | |
97 | } xfs_buf_flags_t; | 97 | typedef unsigned int xfs_buf_flags_t; |
98 | 98 | ||
99 | #define XFS_BUF_FLAGS \ | 99 | #define XFS_BUF_FLAGS \ |
100 | { XBF_READ, "READ" }, \ | 100 | { XBF_READ, "READ" }, \ |
diff --git a/fs/xfs/xfs_alloc.h b/fs/xfs/xfs_alloc.h index 6d05199b667c..895009a97271 100644 --- a/fs/xfs/xfs_alloc.h +++ b/fs/xfs/xfs_alloc.h | |||
@@ -27,16 +27,16 @@ struct xfs_busy_extent; | |||
27 | /* | 27 | /* |
28 | * Freespace allocation types. Argument to xfs_alloc_[v]extent. | 28 | * Freespace allocation types. Argument to xfs_alloc_[v]extent. |
29 | */ | 29 | */ |
30 | typedef enum xfs_alloctype | 30 | #define XFS_ALLOCTYPE_ANY_AG 0x01 /* allocate anywhere, use rotor */ |
31 | { | 31 | #define XFS_ALLOCTYPE_FIRST_AG 0x02 /* ... start at ag 0 */ |
32 | XFS_ALLOCTYPE_ANY_AG, /* allocate anywhere, use rotor */ | 32 | #define XFS_ALLOCTYPE_START_AG 0x04 /* anywhere, start in this a.g. */ |
33 | XFS_ALLOCTYPE_FIRST_AG, /* ... start at ag 0 */ | 33 | #define XFS_ALLOCTYPE_THIS_AG 0x08 /* anywhere in this a.g. */ |
34 | XFS_ALLOCTYPE_START_AG, /* anywhere, start in this a.g. */ | 34 | #define XFS_ALLOCTYPE_START_BNO 0x10 /* near this block else anywhere */ |
35 | XFS_ALLOCTYPE_THIS_AG, /* anywhere in this a.g. */ | 35 | #define XFS_ALLOCTYPE_NEAR_BNO 0x20 /* in this a.g. and near this block */ |
36 | XFS_ALLOCTYPE_START_BNO, /* near this block else anywhere */ | 36 | #define XFS_ALLOCTYPE_THIS_BNO 0x40 /* at exactly this block */ |
37 | XFS_ALLOCTYPE_NEAR_BNO, /* in this a.g. and near this block */ | 37 | |
38 | XFS_ALLOCTYPE_THIS_BNO /* at exactly this block */ | 38 | /* this should become an enum again when the tracing code is fixed */ |
39 | } xfs_alloctype_t; | 39 | typedef unsigned int xfs_alloctype_t; |
40 | 40 | ||
41 | #define XFS_ALLOC_TYPES \ | 41 | #define XFS_ALLOC_TYPES \ |
42 | { XFS_ALLOCTYPE_ANY_AG, "ANY_AG" }, \ | 42 | { XFS_ALLOCTYPE_ANY_AG, "ANY_AG" }, \ |
diff --git a/fs/xfs/xfs_iomap.h b/fs/xfs/xfs_iomap.h index 2cea2daf01ca..7748a430f50d 100644 --- a/fs/xfs/xfs_iomap.h +++ b/fs/xfs/xfs_iomap.h | |||
@@ -18,16 +18,16 @@ | |||
18 | #ifndef __XFS_IOMAP_H__ | 18 | #ifndef __XFS_IOMAP_H__ |
19 | #define __XFS_IOMAP_H__ | 19 | #define __XFS_IOMAP_H__ |
20 | 20 | ||
21 | typedef enum { | 21 | /* base extent manipulation calls */ |
22 | /* base extent manipulation calls */ | 22 | #define BMAPI_READ (1 << 0) /* read extents */ |
23 | BMAPI_READ = (1 << 0), /* read extents */ | 23 | #define BMAPI_WRITE (1 << 1) /* create extents */ |
24 | BMAPI_WRITE = (1 << 1), /* create extents */ | 24 | #define BMAPI_ALLOCATE (1 << 2) /* delayed allocate to real extents */ |
25 | BMAPI_ALLOCATE = (1 << 2), /* delayed allocate to real extents */ | 25 | |
26 | /* modifiers */ | 26 | /* modifiers */ |
27 | BMAPI_IGNSTATE = (1 << 4), /* ignore unwritten state on read */ | 27 | #define BMAPI_IGNSTATE (1 << 4) /* ignore unwritten state on read */ |
28 | BMAPI_DIRECT = (1 << 5), /* direct instead of buffered write */ | 28 | #define BMAPI_DIRECT (1 << 5) /* direct instead of buffered write */ |
29 | BMAPI_TRYLOCK = (1 << 7), /* non-blocking request */ | 29 | #define BMAPI_MMA (1 << 6) /* allocate for mmap write */ |
30 | } bmapi_flags_t; | 30 | #define BMAPI_TRYLOCK (1 << 7) /* non-blocking request */ |
31 | 31 | ||
32 | #define BMAPI_FLAGS \ | 32 | #define BMAPI_FLAGS \ |
33 | { BMAPI_READ, "READ" }, \ | 33 | { BMAPI_READ, "READ" }, \ |