diff options
author | Dean Roehrich <roehrich@sgi.com> | 2005-06-21 20:20:44 -0400 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-06-21 20:20:44 -0400 |
commit | e1a40fa907498030b6e432c0dbcb06d7a9f14ee3 (patch) | |
tree | 8f6ad8643346358ef39d7d28d1e001af81eb6e9a /fs/xfs/xfs_dmapi.h | |
parent | ad89d0212e32c5cf27dfcbad67b91a32b9878529 (diff) |
[XFS] Handle inode semaphores properly for dmapi queues
SGI-PV: 931572
SGI-Modid: xfs-linux-melb:xfs-kern:189560a
Signed-off-by: Dean Roehrich <roehrich@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dmapi.h')
-rw-r--r-- | fs/xfs/xfs_dmapi.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/xfs/xfs_dmapi.h b/fs/xfs/xfs_dmapi.h index 16cf9f7a4785..55c17adaaa37 100644 --- a/fs/xfs/xfs_dmapi.h +++ b/fs/xfs/xfs_dmapi.h | |||
@@ -166,27 +166,32 @@ typedef enum { | |||
166 | #define DM_FLAGS_NDELAY 0x001 /* return EAGAIN after dm_pending() */ | 166 | #define DM_FLAGS_NDELAY 0x001 /* return EAGAIN after dm_pending() */ |
167 | #define DM_FLAGS_UNWANTED 0x002 /* event not in fsys dm_eventset_t */ | 167 | #define DM_FLAGS_UNWANTED 0x002 /* event not in fsys dm_eventset_t */ |
168 | #define DM_FLAGS_ISEM 0x004 /* thread holds i_sem */ | 168 | #define DM_FLAGS_ISEM 0x004 /* thread holds i_sem */ |
169 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) | ||
170 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,21) | ||
171 | /* i_alloc_sem was added in 2.4.22-pre1 */ | ||
172 | #define DM_FLAGS_IALLOCSEM_RD 0x010 /* thread holds i_alloc_sem rd */ | 169 | #define DM_FLAGS_IALLOCSEM_RD 0x010 /* thread holds i_alloc_sem rd */ |
173 | #define DM_FLAGS_IALLOCSEM_WR 0x020 /* thread holds i_alloc_sem wr */ | 170 | #define DM_FLAGS_IALLOCSEM_WR 0x020 /* thread holds i_alloc_sem wr */ |
174 | #endif | ||
175 | #endif | ||
176 | 171 | ||
177 | /* | 172 | /* |
178 | * Based on IO_ISDIRECT, decide which i_ flag is set. | 173 | * Based on IO_ISDIRECT, decide which i_ flag is set. |
179 | */ | 174 | */ |
180 | #ifdef DM_FLAGS_IALLOCSEM_RD | 175 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) |
176 | #define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \ | ||
177 | DM_FLAGS_ISEM : 0) | ||
178 | #define DM_SEM_FLAG_WR (DM_FLAGS_IALLOCSEM_WR | DM_FLAGS_ISEM) | ||
179 | #endif | ||
180 | |||
181 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) && \ | ||
182 | (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,22)) | ||
181 | #define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \ | 183 | #define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \ |
182 | DM_FLAGS_IALLOCSEM_RD : DM_FLAGS_ISEM) | 184 | DM_FLAGS_IALLOCSEM_RD : DM_FLAGS_ISEM) |
183 | #define DM_SEM_FLAG_WR (DM_FLAGS_IALLOCSEM_WR | DM_FLAGS_ISEM) | 185 | #define DM_SEM_FLAG_WR (DM_FLAGS_IALLOCSEM_WR | DM_FLAGS_ISEM) |
184 | #else | 186 | #endif |
187 | |||
188 | #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,21) | ||
185 | #define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \ | 189 | #define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \ |
186 | 0 : DM_FLAGS_ISEM) | 190 | 0 : DM_FLAGS_ISEM) |
187 | #define DM_SEM_FLAG_WR (DM_FLAGS_ISEM) | 191 | #define DM_SEM_FLAG_WR (DM_FLAGS_ISEM) |
188 | #endif | 192 | #endif |
189 | 193 | ||
194 | |||
190 | /* | 195 | /* |
191 | * Macros to turn caller specified delay/block flags into | 196 | * Macros to turn caller specified delay/block flags into |
192 | * dm_send_xxxx_event flag DM_FLAGS_NDELAY. | 197 | * dm_send_xxxx_event flag DM_FLAGS_NDELAY. |
@@ -209,8 +214,4 @@ void xfs_dm_exit(struct file_system_type *); | |||
209 | #define XFS_DM_EXIT(fstype) | 214 | #define XFS_DM_EXIT(fstype) |
210 | #endif | 215 | #endif |
211 | 216 | ||
212 | #define HAVE_XFS_DM_MM | ||
213 | int xfs_dm_mm_get(struct vm_area_struct *vma); | ||
214 | void xfs_dm_mm_put(struct vm_area_struct *vma); | ||
215 | |||
216 | #endif /* __XFS_DMAPI_H__ */ | 217 | #endif /* __XFS_DMAPI_H__ */ |