diff options
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r-- | fs/xfs/xfs_mount.h | 127 |
1 files changed, 11 insertions, 116 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index c618f7cb5f0e..f7c620ec6e69 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
@@ -56,20 +56,12 @@ struct cred; | |||
56 | struct log; | 56 | struct log; |
57 | struct xfs_mount_args; | 57 | struct xfs_mount_args; |
58 | struct xfs_inode; | 58 | struct xfs_inode; |
59 | struct xfs_iocore; | ||
60 | struct xfs_bmbt_irec; | 59 | struct xfs_bmbt_irec; |
61 | struct xfs_bmap_free; | 60 | struct xfs_bmap_free; |
62 | struct xfs_extdelta; | 61 | struct xfs_extdelta; |
63 | struct xfs_swapext; | 62 | struct xfs_swapext; |
64 | struct xfs_mru_cache; | 63 | struct xfs_mru_cache; |
65 | 64 | ||
66 | #define AIL_LOCK_T lock_t | ||
67 | #define AIL_LOCKINIT(x,y) spinlock_init(x,y) | ||
68 | #define AIL_LOCK_DESTROY(x) spinlock_destroy(x) | ||
69 | #define AIL_LOCK(mp,s) s=mutex_spinlock(&(mp)->m_ail_lock) | ||
70 | #define AIL_UNLOCK(mp,s) mutex_spinunlock(&(mp)->m_ail_lock, s) | ||
71 | |||
72 | |||
73 | /* | 65 | /* |
74 | * Prototypes and functions for the Data Migration subsystem. | 66 | * Prototypes and functions for the Data Migration subsystem. |
75 | */ | 67 | */ |
@@ -196,105 +188,6 @@ typedef struct xfs_qmops { | |||
196 | #define XFS_QM_QUOTACTL(mp, cmd, id, addr) \ | 188 | #define XFS_QM_QUOTACTL(mp, cmd, id, addr) \ |
197 | (*(mp)->m_qm_ops->xfs_quotactl)(mp, cmd, id, addr) | 189 | (*(mp)->m_qm_ops->xfs_quotactl)(mp, cmd, id, addr) |
198 | 190 | ||
199 | |||
200 | /* | ||
201 | * Prototypes and functions for I/O core modularization. | ||
202 | */ | ||
203 | |||
204 | typedef int (*xfs_ioinit_t)(struct xfs_mount *, | ||
205 | struct xfs_mount_args *, int); | ||
206 | typedef int (*xfs_bmapi_t)(struct xfs_trans *, void *, | ||
207 | xfs_fileoff_t, xfs_filblks_t, int, | ||
208 | xfs_fsblock_t *, xfs_extlen_t, | ||
209 | struct xfs_bmbt_irec *, int *, | ||
210 | struct xfs_bmap_free *, struct xfs_extdelta *); | ||
211 | typedef int (*xfs_bunmapi_t)(struct xfs_trans *, | ||
212 | void *, xfs_fileoff_t, | ||
213 | xfs_filblks_t, int, xfs_extnum_t, | ||
214 | xfs_fsblock_t *, struct xfs_bmap_free *, | ||
215 | struct xfs_extdelta *, int *); | ||
216 | typedef int (*xfs_bmap_eof_t)(void *, xfs_fileoff_t, int, int *); | ||
217 | typedef int (*xfs_iomap_write_direct_t)( | ||
218 | void *, xfs_off_t, size_t, int, | ||
219 | struct xfs_bmbt_irec *, int *, int); | ||
220 | typedef int (*xfs_iomap_write_delay_t)( | ||
221 | void *, xfs_off_t, size_t, int, | ||
222 | struct xfs_bmbt_irec *, int *); | ||
223 | typedef int (*xfs_iomap_write_allocate_t)( | ||
224 | void *, xfs_off_t, size_t, | ||
225 | struct xfs_bmbt_irec *, int *); | ||
226 | typedef int (*xfs_iomap_write_unwritten_t)( | ||
227 | void *, xfs_off_t, size_t); | ||
228 | typedef uint (*xfs_lck_map_shared_t)(void *); | ||
229 | typedef void (*xfs_lock_t)(void *, uint); | ||
230 | typedef void (*xfs_lock_demote_t)(void *, uint); | ||
231 | typedef int (*xfs_lock_nowait_t)(void *, uint); | ||
232 | typedef void (*xfs_unlk_t)(void *, unsigned int); | ||
233 | typedef xfs_fsize_t (*xfs_size_t)(void *); | ||
234 | typedef xfs_fsize_t (*xfs_iodone_t)(struct xfs_mount *); | ||
235 | typedef int (*xfs_swap_extents_t)(void *, void *, | ||
236 | struct xfs_swapext*); | ||
237 | |||
238 | typedef struct xfs_ioops { | ||
239 | xfs_ioinit_t xfs_ioinit; | ||
240 | xfs_bmapi_t xfs_bmapi_func; | ||
241 | xfs_bunmapi_t xfs_bunmapi_func; | ||
242 | xfs_bmap_eof_t xfs_bmap_eof_func; | ||
243 | xfs_iomap_write_direct_t xfs_iomap_write_direct; | ||
244 | xfs_iomap_write_delay_t xfs_iomap_write_delay; | ||
245 | xfs_iomap_write_allocate_t xfs_iomap_write_allocate; | ||
246 | xfs_iomap_write_unwritten_t xfs_iomap_write_unwritten; | ||
247 | xfs_lock_t xfs_ilock; | ||
248 | xfs_lck_map_shared_t xfs_lck_map_shared; | ||
249 | xfs_lock_demote_t xfs_ilock_demote; | ||
250 | xfs_lock_nowait_t xfs_ilock_nowait; | ||
251 | xfs_unlk_t xfs_unlock; | ||
252 | xfs_size_t xfs_size_func; | ||
253 | xfs_iodone_t xfs_iodone; | ||
254 | xfs_swap_extents_t xfs_swap_extents_func; | ||
255 | } xfs_ioops_t; | ||
256 | |||
257 | #define XFS_IOINIT(mp, args, flags) \ | ||
258 | (*(mp)->m_io_ops.xfs_ioinit)(mp, args, flags) | ||
259 | #define XFS_BMAPI(mp, trans,io,bno,len,f,first,tot,mval,nmap,flist,delta) \ | ||
260 | (*(mp)->m_io_ops.xfs_bmapi_func) \ | ||
261 | (trans,(io)->io_obj,bno,len,f,first,tot,mval,nmap,flist,delta) | ||
262 | #define XFS_BUNMAPI(mp, trans,io,bno,len,f,nexts,first,flist,delta,done) \ | ||
263 | (*(mp)->m_io_ops.xfs_bunmapi_func) \ | ||
264 | (trans,(io)->io_obj,bno,len,f,nexts,first,flist,delta,done) | ||
265 | #define XFS_BMAP_EOF(mp, io, endoff, whichfork, eof) \ | ||
266 | (*(mp)->m_io_ops.xfs_bmap_eof_func) \ | ||
267 | ((io)->io_obj, endoff, whichfork, eof) | ||
268 | #define XFS_IOMAP_WRITE_DIRECT(mp, io, offset, count, flags, mval, nmap, found)\ | ||
269 | (*(mp)->m_io_ops.xfs_iomap_write_direct) \ | ||
270 | ((io)->io_obj, offset, count, flags, mval, nmap, found) | ||
271 | #define XFS_IOMAP_WRITE_DELAY(mp, io, offset, count, flags, mval, nmap) \ | ||
272 | (*(mp)->m_io_ops.xfs_iomap_write_delay) \ | ||
273 | ((io)->io_obj, offset, count, flags, mval, nmap) | ||
274 | #define XFS_IOMAP_WRITE_ALLOCATE(mp, io, offset, count, mval, nmap) \ | ||
275 | (*(mp)->m_io_ops.xfs_iomap_write_allocate) \ | ||
276 | ((io)->io_obj, offset, count, mval, nmap) | ||
277 | #define XFS_IOMAP_WRITE_UNWRITTEN(mp, io, offset, count) \ | ||
278 | (*(mp)->m_io_ops.xfs_iomap_write_unwritten) \ | ||
279 | ((io)->io_obj, offset, count) | ||
280 | #define XFS_LCK_MAP_SHARED(mp, io) \ | ||
281 | (*(mp)->m_io_ops.xfs_lck_map_shared)((io)->io_obj) | ||
282 | #define XFS_ILOCK(mp, io, mode) \ | ||
283 | (*(mp)->m_io_ops.xfs_ilock)((io)->io_obj, mode) | ||
284 | #define XFS_ILOCK_NOWAIT(mp, io, mode) \ | ||
285 | (*(mp)->m_io_ops.xfs_ilock_nowait)((io)->io_obj, mode) | ||
286 | #define XFS_IUNLOCK(mp, io, mode) \ | ||
287 | (*(mp)->m_io_ops.xfs_unlock)((io)->io_obj, mode) | ||
288 | #define XFS_ILOCK_DEMOTE(mp, io, mode) \ | ||
289 | (*(mp)->m_io_ops.xfs_ilock_demote)((io)->io_obj, mode) | ||
290 | #define XFS_SIZE(mp, io) \ | ||
291 | (*(mp)->m_io_ops.xfs_size_func)((io)->io_obj) | ||
292 | #define XFS_IODONE(mp) \ | ||
293 | (*(mp)->m_io_ops.xfs_iodone)(mp) | ||
294 | #define XFS_SWAP_EXTENTS(mp, io, tio, sxp) \ | ||
295 | (*(mp)->m_io_ops.xfs_swap_extents_func) \ | ||
296 | ((io)->io_obj, (tio)->io_obj, sxp) | ||
297 | |||
298 | #ifdef HAVE_PERCPU_SB | 191 | #ifdef HAVE_PERCPU_SB |
299 | 192 | ||
300 | /* | 193 | /* |
@@ -326,14 +219,20 @@ extern void xfs_icsb_sync_counters_flags(struct xfs_mount *, int); | |||
326 | #define xfs_icsb_sync_counters_flags(mp, flags) do { } while (0) | 219 | #define xfs_icsb_sync_counters_flags(mp, flags) do { } while (0) |
327 | #endif | 220 | #endif |
328 | 221 | ||
222 | typedef struct xfs_ail { | ||
223 | xfs_ail_entry_t xa_ail; | ||
224 | uint xa_gen; | ||
225 | struct task_struct *xa_task; | ||
226 | xfs_lsn_t xa_target; | ||
227 | } xfs_ail_t; | ||
228 | |||
329 | typedef struct xfs_mount { | 229 | typedef struct xfs_mount { |
330 | struct super_block *m_super; | 230 | struct super_block *m_super; |
331 | xfs_tid_t m_tid; /* next unused tid for fs */ | 231 | xfs_tid_t m_tid; /* next unused tid for fs */ |
332 | AIL_LOCK_T m_ail_lock; /* fs AIL mutex */ | 232 | spinlock_t m_ail_lock; /* fs AIL mutex */ |
333 | xfs_ail_entry_t m_ail; /* fs active log item list */ | 233 | xfs_ail_t m_ail; /* fs active log item list */ |
334 | uint m_ail_gen; /* fs AIL generation count */ | ||
335 | xfs_sb_t m_sb; /* copy of fs superblock */ | 234 | xfs_sb_t m_sb; /* copy of fs superblock */ |
336 | lock_t m_sb_lock; /* sb counter mutex */ | 235 | spinlock_t m_sb_lock; /* sb counter lock */ |
337 | struct xfs_buf *m_sb_bp; /* buffer for superblock */ | 236 | struct xfs_buf *m_sb_bp; /* buffer for superblock */ |
338 | char *m_fsname; /* filesystem name */ | 237 | char *m_fsname; /* filesystem name */ |
339 | int m_fsname_len; /* strlen of fs name */ | 238 | int m_fsname_len; /* strlen of fs name */ |
@@ -342,7 +241,7 @@ typedef struct xfs_mount { | |||
342 | int m_bsize; /* fs logical block size */ | 241 | int m_bsize; /* fs logical block size */ |
343 | xfs_agnumber_t m_agfrotor; /* last ag where space found */ | 242 | xfs_agnumber_t m_agfrotor; /* last ag where space found */ |
344 | xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ | 243 | xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ |
345 | lock_t m_agirotor_lock;/* .. and lock protecting it */ | 244 | spinlock_t m_agirotor_lock;/* .. and lock protecting it */ |
346 | xfs_agnumber_t m_maxagi; /* highest inode alloc group */ | 245 | xfs_agnumber_t m_maxagi; /* highest inode alloc group */ |
347 | struct xfs_inode *m_inodes; /* active inode list */ | 246 | struct xfs_inode *m_inodes; /* active inode list */ |
348 | struct list_head m_del_inodes; /* inodes to reclaim */ | 247 | struct list_head m_del_inodes; /* inodes to reclaim */ |
@@ -423,7 +322,6 @@ typedef struct xfs_mount { | |||
423 | * hash table */ | 322 | * hash table */ |
424 | struct xfs_dmops *m_dm_ops; /* vector of DMI ops */ | 323 | struct xfs_dmops *m_dm_ops; /* vector of DMI ops */ |
425 | struct xfs_qmops *m_qm_ops; /* vector of XQM ops */ | 324 | struct xfs_qmops *m_qm_ops; /* vector of XQM ops */ |
426 | struct xfs_ioops m_io_ops; /* vector of I/O ops */ | ||
427 | atomic_t m_active_trans; /* number trans frozen */ | 325 | atomic_t m_active_trans; /* number trans frozen */ |
428 | #ifdef HAVE_PERCPU_SB | 326 | #ifdef HAVE_PERCPU_SB |
429 | xfs_icsb_cnts_t *m_sb_cnts; /* per-cpu superblock counters */ | 327 | xfs_icsb_cnts_t *m_sb_cnts; /* per-cpu superblock counters */ |
@@ -610,8 +508,6 @@ typedef struct xfs_mod_sb { | |||
610 | 508 | ||
611 | #define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock)) | 509 | #define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock)) |
612 | #define XFS_MOUNT_IUNLOCK(mp) mutex_unlock(&((mp)->m_ilock)) | 510 | #define XFS_MOUNT_IUNLOCK(mp) mutex_unlock(&((mp)->m_ilock)) |
613 | #define XFS_SB_LOCK(mp) mutex_spinlock(&(mp)->m_sb_lock) | ||
614 | #define XFS_SB_UNLOCK(mp,s) mutex_spinunlock(&(mp)->m_sb_lock,(s)) | ||
615 | 511 | ||
616 | extern xfs_mount_t *xfs_mount_init(void); | 512 | extern xfs_mount_t *xfs_mount_init(void); |
617 | extern void xfs_mod_sb(xfs_trans_t *, __int64_t); | 513 | extern void xfs_mod_sb(xfs_trans_t *, __int64_t); |
@@ -646,7 +542,6 @@ extern int xfs_qmops_get(struct xfs_mount *, struct xfs_mount_args *); | |||
646 | extern void xfs_qmops_put(struct xfs_mount *); | 542 | extern void xfs_qmops_put(struct xfs_mount *); |
647 | 543 | ||
648 | extern struct xfs_dmops xfs_dmcore_xfs; | 544 | extern struct xfs_dmops xfs_dmcore_xfs; |
649 | extern struct xfs_ioops xfs_iocore_xfs; | ||
650 | 545 | ||
651 | extern int xfs_init(void); | 546 | extern int xfs_init(void); |
652 | extern void xfs_cleanup(void); | 547 | extern void xfs_cleanup(void); |