diff options
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r-- | fs/xfs/xfs_mount.h | 59 |
1 files changed, 36 insertions, 23 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index a6c023bc0fb2..9ff48a16a7ee 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
@@ -78,7 +78,8 @@ typedef int (*xfs_send_destroy_t)(struct xfs_inode *, dm_right_t); | |||
78 | typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct xfs_mount *, | 78 | typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct xfs_mount *, |
79 | struct xfs_inode *, dm_right_t, | 79 | struct xfs_inode *, dm_right_t, |
80 | struct xfs_inode *, dm_right_t, | 80 | struct xfs_inode *, dm_right_t, |
81 | const char *, const char *, mode_t, int, int); | 81 | const unsigned char *, const unsigned char *, |
82 | mode_t, int, int); | ||
82 | typedef int (*xfs_send_mount_t)(struct xfs_mount *, dm_right_t, | 83 | typedef int (*xfs_send_mount_t)(struct xfs_mount *, dm_right_t, |
83 | char *, char *); | 84 | char *, char *); |
84 | typedef void (*xfs_send_unmount_t)(struct xfs_mount *, struct xfs_inode *, | 85 | typedef void (*xfs_send_unmount_t)(struct xfs_mount *, struct xfs_inode *, |
@@ -93,6 +94,9 @@ typedef struct xfs_dmops { | |||
93 | xfs_send_unmount_t xfs_send_unmount; | 94 | xfs_send_unmount_t xfs_send_unmount; |
94 | } xfs_dmops_t; | 95 | } xfs_dmops_t; |
95 | 96 | ||
97 | #define XFS_DMAPI_UNMOUNT_FLAGS(mp) \ | ||
98 | (((mp)->m_dmevmask & (1 << DM_EVENT_UNMOUNT)) ? 0 : DM_FLAGS_UNWANTED) | ||
99 | |||
96 | #define XFS_SEND_DATA(mp, ev,ip,off,len,fl,lock) \ | 100 | #define XFS_SEND_DATA(mp, ev,ip,off,len,fl,lock) \ |
97 | (*(mp)->m_dm_ops->xfs_send_data)(ev,ip,off,len,fl,lock) | 101 | (*(mp)->m_dm_ops->xfs_send_data)(ev,ip,off,len,fl,lock) |
98 | #define XFS_SEND_MMAP(mp, vma,fl) \ | 102 | #define XFS_SEND_MMAP(mp, vma,fl) \ |
@@ -101,12 +105,24 @@ typedef struct xfs_dmops { | |||
101 | (*(mp)->m_dm_ops->xfs_send_destroy)(ip,right) | 105 | (*(mp)->m_dm_ops->xfs_send_destroy)(ip,right) |
102 | #define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ | 106 | #define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ |
103 | (*(mp)->m_dm_ops->xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl) | 107 | (*(mp)->m_dm_ops->xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl) |
104 | #define XFS_SEND_PREUNMOUNT(mp,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ | ||
105 | (*(mp)->m_dm_ops->xfs_send_namesp)(DM_EVENT_PREUNMOUNT,mp,b1,r1,b2,r2,n1,n2,mode,rval,fl) | ||
106 | #define XFS_SEND_MOUNT(mp,right,path,name) \ | 108 | #define XFS_SEND_MOUNT(mp,right,path,name) \ |
107 | (*(mp)->m_dm_ops->xfs_send_mount)(mp,right,path,name) | 109 | (*(mp)->m_dm_ops->xfs_send_mount)(mp,right,path,name) |
108 | #define XFS_SEND_UNMOUNT(mp, ip,right,mode,rval,fl) \ | 110 | #define XFS_SEND_PREUNMOUNT(mp) \ |
109 | (*(mp)->m_dm_ops->xfs_send_unmount)(mp,ip,right,mode,rval,fl) | 111 | do { \ |
112 | if (mp->m_flags & XFS_MOUNT_DMAPI) { \ | ||
113 | (*(mp)->m_dm_ops->xfs_send_namesp)(DM_EVENT_PREUNMOUNT, mp, \ | ||
114 | (mp)->m_rootip, DM_RIGHT_NULL, \ | ||
115 | (mp)->m_rootip, DM_RIGHT_NULL, \ | ||
116 | NULL, NULL, 0, 0, XFS_DMAPI_UNMOUNT_FLAGS(mp)); \ | ||
117 | } \ | ||
118 | } while (0) | ||
119 | #define XFS_SEND_UNMOUNT(mp) \ | ||
120 | do { \ | ||
121 | if (mp->m_flags & XFS_MOUNT_DMAPI) { \ | ||
122 | (*(mp)->m_dm_ops->xfs_send_unmount)(mp, (mp)->m_rootip, \ | ||
123 | DM_RIGHT_NULL, 0, 0, XFS_DMAPI_UNMOUNT_FLAGS(mp)); \ | ||
124 | } \ | ||
125 | } while (0) | ||
110 | 126 | ||
111 | 127 | ||
112 | #ifdef HAVE_PERCPU_SB | 128 | #ifdef HAVE_PERCPU_SB |
@@ -192,8 +208,8 @@ typedef struct xfs_mount { | |||
192 | uint m_ag_maxlevels; /* XFS_AG_MAXLEVELS */ | 208 | uint m_ag_maxlevels; /* XFS_AG_MAXLEVELS */ |
193 | uint m_bm_maxlevels[2]; /* XFS_BM_MAXLEVELS */ | 209 | uint m_bm_maxlevels[2]; /* XFS_BM_MAXLEVELS */ |
194 | uint m_in_maxlevels; /* max inobt btree levels. */ | 210 | uint m_in_maxlevels; /* max inobt btree levels. */ |
195 | struct xfs_perag *m_perag; /* per-ag accounting info */ | 211 | struct radix_tree_root m_perag_tree; /* per-ag accounting info */ |
196 | struct rw_semaphore m_peraglock; /* lock for m_perag (pointer) */ | 212 | spinlock_t m_perag_lock; /* lock for m_perag_tree */ |
197 | struct mutex m_growlock; /* growfs mutex */ | 213 | struct mutex m_growlock; /* growfs mutex */ |
198 | int m_fixedfsid[2]; /* unchanged for life of FS */ | 214 | int m_fixedfsid[2]; /* unchanged for life of FS */ |
199 | uint m_dmevmask; /* DMI events for this FS */ | 215 | uint m_dmevmask; /* DMI events for this FS */ |
@@ -209,6 +225,7 @@ typedef struct xfs_mount { | |||
209 | __uint64_t m_maxioffset; /* maximum inode offset */ | 225 | __uint64_t m_maxioffset; /* maximum inode offset */ |
210 | __uint64_t m_resblks; /* total reserved blocks */ | 226 | __uint64_t m_resblks; /* total reserved blocks */ |
211 | __uint64_t m_resblks_avail;/* available reserved blocks */ | 227 | __uint64_t m_resblks_avail;/* available reserved blocks */ |
228 | __uint64_t m_resblks_save; /* reserved blks @ remount,ro */ | ||
212 | int m_dalign; /* stripe unit */ | 229 | int m_dalign; /* stripe unit */ |
213 | int m_swidth; /* stripe width */ | 230 | int m_swidth; /* stripe width */ |
214 | int m_sinoalign; /* stripe unit inode alignment */ | 231 | int m_sinoalign; /* stripe unit inode alignment */ |
@@ -228,7 +245,7 @@ typedef struct xfs_mount { | |||
228 | struct xfs_qmops *m_qm_ops; /* vector of XQM ops */ | 245 | struct xfs_qmops *m_qm_ops; /* vector of XQM ops */ |
229 | atomic_t m_active_trans; /* number trans frozen */ | 246 | atomic_t m_active_trans; /* number trans frozen */ |
230 | #ifdef HAVE_PERCPU_SB | 247 | #ifdef HAVE_PERCPU_SB |
231 | xfs_icsb_cnts_t *m_sb_cnts; /* per-cpu superblock counters */ | 248 | xfs_icsb_cnts_t __percpu *m_sb_cnts; /* per-cpu superblock counters */ |
232 | unsigned long m_icsb_counters; /* disabled per-cpu counters */ | 249 | unsigned long m_icsb_counters; /* disabled per-cpu counters */ |
233 | struct notifier_block m_icsb_notifier; /* hotplug cpu notifier */ | 250 | struct notifier_block m_icsb_notifier; /* hotplug cpu notifier */ |
234 | struct mutex m_icsb_mutex; /* balancer sync lock */ | 251 | struct mutex m_icsb_mutex; /* balancer sync lock */ |
@@ -242,6 +259,7 @@ typedef struct xfs_mount { | |||
242 | wait_queue_head_t m_wait_single_sync_task; | 259 | wait_queue_head_t m_wait_single_sync_task; |
243 | __int64_t m_update_flags; /* sb flags we need to update | 260 | __int64_t m_update_flags; /* sb flags we need to update |
244 | on the next remount,rw */ | 261 | on the next remount,rw */ |
262 | struct list_head m_mplist; /* inode shrinker mount list */ | ||
245 | } xfs_mount_t; | 263 | } xfs_mount_t; |
246 | 264 | ||
247 | /* | 265 | /* |
@@ -369,31 +387,22 @@ xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d) | |||
369 | } | 387 | } |
370 | 388 | ||
371 | /* | 389 | /* |
372 | * perag get/put wrappers for eventual ref counting | 390 | * perag get/put wrappers for ref counting |
373 | */ | 391 | */ |
374 | static inline xfs_perag_t * | 392 | struct xfs_perag *xfs_perag_get(struct xfs_mount *mp, xfs_agnumber_t agno); |
375 | xfs_get_perag(struct xfs_mount *mp, xfs_ino_t ino) | 393 | void xfs_perag_put(struct xfs_perag *pag); |
376 | { | ||
377 | return &mp->m_perag[XFS_INO_TO_AGNO(mp, ino)]; | ||
378 | } | ||
379 | |||
380 | static inline void | ||
381 | xfs_put_perag(struct xfs_mount *mp, xfs_perag_t *pag) | ||
382 | { | ||
383 | /* nothing to see here, move along */ | ||
384 | } | ||
385 | 394 | ||
386 | /* | 395 | /* |
387 | * Per-cpu superblock locking functions | 396 | * Per-cpu superblock locking functions |
388 | */ | 397 | */ |
389 | #ifdef HAVE_PERCPU_SB | 398 | #ifdef HAVE_PERCPU_SB |
390 | STATIC_INLINE void | 399 | static inline void |
391 | xfs_icsb_lock(xfs_mount_t *mp) | 400 | xfs_icsb_lock(xfs_mount_t *mp) |
392 | { | 401 | { |
393 | mutex_lock(&mp->m_icsb_mutex); | 402 | mutex_lock(&mp->m_icsb_mutex); |
394 | } | 403 | } |
395 | 404 | ||
396 | STATIC_INLINE void | 405 | static inline void |
397 | xfs_icsb_unlock(xfs_mount_t *mp) | 406 | xfs_icsb_unlock(xfs_mount_t *mp) |
398 | { | 407 | { |
399 | mutex_unlock(&mp->m_icsb_mutex); | 408 | mutex_unlock(&mp->m_icsb_mutex); |
@@ -413,6 +422,7 @@ typedef struct xfs_mod_sb { | |||
413 | } xfs_mod_sb_t; | 422 | } xfs_mod_sb_t; |
414 | 423 | ||
415 | extern int xfs_log_sbcount(xfs_mount_t *, uint); | 424 | extern int xfs_log_sbcount(xfs_mount_t *, uint); |
425 | extern __uint64_t xfs_default_resblks(xfs_mount_t *mp); | ||
416 | extern int xfs_mountfs(xfs_mount_t *mp); | 426 | extern int xfs_mountfs(xfs_mount_t *mp); |
417 | 427 | ||
418 | extern void xfs_unmountfs(xfs_mount_t *); | 428 | extern void xfs_unmountfs(xfs_mount_t *); |
@@ -427,6 +437,8 @@ extern void xfs_freesb(xfs_mount_t *); | |||
427 | extern int xfs_fs_writable(xfs_mount_t *); | 437 | extern int xfs_fs_writable(xfs_mount_t *); |
428 | extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); | 438 | extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); |
429 | 439 | ||
440 | extern int xfs_dev_is_read_only(struct xfs_mount *, char *); | ||
441 | |||
430 | extern int xfs_dmops_get(struct xfs_mount *); | 442 | extern int xfs_dmops_get(struct xfs_mount *); |
431 | extern void xfs_dmops_put(struct xfs_mount *); | 443 | extern void xfs_dmops_put(struct xfs_mount *); |
432 | 444 | ||
@@ -435,7 +447,8 @@ extern struct xfs_dmops xfs_dmcore_xfs; | |||
435 | #endif /* __KERNEL__ */ | 447 | #endif /* __KERNEL__ */ |
436 | 448 | ||
437 | extern void xfs_mod_sb(struct xfs_trans *, __int64_t); | 449 | extern void xfs_mod_sb(struct xfs_trans *, __int64_t); |
438 | extern xfs_agnumber_t xfs_initialize_perag(struct xfs_mount *, xfs_agnumber_t); | 450 | extern int xfs_initialize_perag(struct xfs_mount *, xfs_agnumber_t, |
451 | xfs_agnumber_t *); | ||
439 | extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *); | 452 | extern void xfs_sb_from_disk(struct xfs_sb *, struct xfs_dsb *); |
440 | extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t); | 453 | extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t); |
441 | 454 | ||