]> err.no Git - linux-2.6/blobdiff - fs/xfs/xfs_mount.h
Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer...
[linux-2.6] / fs / xfs / xfs_mount.h
index 7f671f8269b4ddacde42d4bd2f255144e6ed1ac0..63e0693a358a295e4657eabde52ebc88b8de965e 100644 (file)
@@ -56,35 +56,27 @@ struct cred;
 struct log;
 struct xfs_mount_args;
 struct xfs_inode;
-struct xfs_iocore;
 struct xfs_bmbt_irec;
 struct xfs_bmap_free;
 struct xfs_extdelta;
 struct xfs_swapext;
 struct xfs_mru_cache;
 
-#define        AIL_LOCK_T              lock_t
-#define        AIL_LOCKINIT(x,y)       spinlock_init(x,y)
-#define        AIL_LOCK_DESTROY(x)     spinlock_destroy(x)
-#define        AIL_LOCK(mp,s)          s=mutex_spinlock(&(mp)->m_ail_lock)
-#define        AIL_UNLOCK(mp,s)        mutex_spinunlock(&(mp)->m_ail_lock, s)
-
-
 /*
  * Prototypes and functions for the Data Migration subsystem.
  */
 
-typedef int    (*xfs_send_data_t)(int, bhv_vnode_t *,
-                       xfs_off_t, size_t, int, bhv_vrwlock_t *);
+typedef int    (*xfs_send_data_t)(int, struct xfs_inode *,
+                       xfs_off_t, size_t, int, int *);
 typedef int    (*xfs_send_mmap_t)(struct vm_area_struct *, uint);
-typedef int    (*xfs_send_destroy_t)(bhv_vnode_t *, dm_right_t);
+typedef int    (*xfs_send_destroy_t)(struct xfs_inode *, dm_right_t);
 typedef int    (*xfs_send_namesp_t)(dm_eventtype_t, struct xfs_mount *,
-                       bhv_vnode_t *,
-                       dm_right_t, bhv_vnode_t *, dm_right_t,
-                       char *, char *, mode_t, int, int);
+                       struct xfs_inode *, dm_right_t,
+                       struct xfs_inode *, dm_right_t,
+                       const char *, const char *, mode_t, int, int);
 typedef int    (*xfs_send_mount_t)(struct xfs_mount *, dm_right_t,
                        char *, char *);
-typedef void   (*xfs_send_unmount_t)(struct xfs_mount *, bhv_vnode_t *,
+typedef void   (*xfs_send_unmount_t)(struct xfs_mount *, struct xfs_inode *,
                        dm_right_t, mode_t, int, int);
 
 typedef struct xfs_dmops {
@@ -96,20 +88,20 @@ typedef struct xfs_dmops {
        xfs_send_unmount_t      xfs_send_unmount;
 } xfs_dmops_t;
 
-#define XFS_SEND_DATA(mp, ev,vp,off,len,fl,lock) \
-       (*(mp)->m_dm_ops->xfs_send_data)(ev,vp,off,len,fl,lock)
+#define XFS_SEND_DATA(mp, ev,ip,off,len,fl,lock) \
+       (*(mp)->m_dm_ops->xfs_send_data)(ev,ip,off,len,fl,lock)
 #define XFS_SEND_MMAP(mp, vma,fl) \
        (*(mp)->m_dm_ops->xfs_send_mmap)(vma,fl)
-#define XFS_SEND_DESTROY(mp, vp,right) \
-       (*(mp)->m_dm_ops->xfs_send_destroy)(vp,right)
+#define XFS_SEND_DESTROY(mp, ip,right) \
+       (*(mp)->m_dm_ops->xfs_send_destroy)(ip,right)
 #define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \
        (*(mp)->m_dm_ops->xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl)
 #define XFS_SEND_PREUNMOUNT(mp,b1,r1,b2,r2,n1,n2,mode,rval,fl) \
        (*(mp)->m_dm_ops->xfs_send_namesp)(DM_EVENT_PREUNMOUNT,mp,b1,r1,b2,r2,n1,n2,mode,rval,fl)
 #define XFS_SEND_MOUNT(mp,right,path,name) \
        (*(mp)->m_dm_ops->xfs_send_mount)(mp,right,path,name)
-#define XFS_SEND_UNMOUNT(mp, vp,right,mode,rval,fl) \
-       (*(mp)->m_dm_ops->xfs_send_unmount)(mp,vp,right,mode,rval,fl)
+#define XFS_SEND_UNMOUNT(mp, ip,right,mode,rval,fl) \
+       (*(mp)->m_dm_ops->xfs_send_unmount)(mp,ip,right,mode,rval,fl)
 
 
 /*
@@ -196,105 +188,6 @@ typedef struct xfs_qmops {
 #define XFS_QM_QUOTACTL(mp, cmd, id, addr) \
        (*(mp)->m_qm_ops->xfs_quotactl)(mp, cmd, id, addr)
 
-
-/*
- * Prototypes and functions for I/O core modularization.
- */
-
-typedef int            (*xfs_ioinit_t)(struct xfs_mount *,
-                               struct xfs_mount_args *, int);
-typedef int            (*xfs_bmapi_t)(struct xfs_trans *, void *,
-                               xfs_fileoff_t, xfs_filblks_t, int,
-                               xfs_fsblock_t *, xfs_extlen_t,
-                               struct xfs_bmbt_irec *, int *,
-                               struct xfs_bmap_free *, struct xfs_extdelta *);
-typedef int            (*xfs_bunmapi_t)(struct xfs_trans *,
-                               void *, xfs_fileoff_t,
-                               xfs_filblks_t, int, xfs_extnum_t,
-                               xfs_fsblock_t *, struct xfs_bmap_free *,
-                               struct xfs_extdelta *, int *);
-typedef int            (*xfs_bmap_eof_t)(void *, xfs_fileoff_t, int, int *);
-typedef int            (*xfs_iomap_write_direct_t)(
-                               void *, xfs_off_t, size_t, int,
-                               struct xfs_bmbt_irec *, int *, int);
-typedef int            (*xfs_iomap_write_delay_t)(
-                               void *, xfs_off_t, size_t, int,
-                               struct xfs_bmbt_irec *, int *);
-typedef int            (*xfs_iomap_write_allocate_t)(
-                               void *, xfs_off_t, size_t,
-                               struct xfs_bmbt_irec *, int *);
-typedef int            (*xfs_iomap_write_unwritten_t)(
-                               void *, xfs_off_t, size_t);
-typedef uint           (*xfs_lck_map_shared_t)(void *);
-typedef void           (*xfs_lock_t)(void *, uint);
-typedef void           (*xfs_lock_demote_t)(void *, uint);
-typedef int            (*xfs_lock_nowait_t)(void *, uint);
-typedef void           (*xfs_unlk_t)(void *, unsigned int);
-typedef xfs_fsize_t    (*xfs_size_t)(void *);
-typedef xfs_fsize_t    (*xfs_iodone_t)(struct xfs_mount *);
-typedef int            (*xfs_swap_extents_t)(void *, void *,
-                               struct xfs_swapext*);
-
-typedef struct xfs_ioops {
-       xfs_ioinit_t                    xfs_ioinit;
-       xfs_bmapi_t                     xfs_bmapi_func;
-       xfs_bunmapi_t                   xfs_bunmapi_func;
-       xfs_bmap_eof_t                  xfs_bmap_eof_func;
-       xfs_iomap_write_direct_t        xfs_iomap_write_direct;
-       xfs_iomap_write_delay_t         xfs_iomap_write_delay;
-       xfs_iomap_write_allocate_t      xfs_iomap_write_allocate;
-       xfs_iomap_write_unwritten_t     xfs_iomap_write_unwritten;
-       xfs_lock_t                      xfs_ilock;
-       xfs_lck_map_shared_t            xfs_lck_map_shared;
-       xfs_lock_demote_t               xfs_ilock_demote;
-       xfs_lock_nowait_t               xfs_ilock_nowait;
-       xfs_unlk_t                      xfs_unlock;
-       xfs_size_t                      xfs_size_func;
-       xfs_iodone_t                    xfs_iodone;
-       xfs_swap_extents_t              xfs_swap_extents_func;
-} xfs_ioops_t;
-
-#define XFS_IOINIT(mp, args, flags) \
-       (*(mp)->m_io_ops.xfs_ioinit)(mp, args, flags)
-#define XFS_BMAPI(mp, trans,io,bno,len,f,first,tot,mval,nmap,flist,delta) \
-       (*(mp)->m_io_ops.xfs_bmapi_func) \
-               (trans,(io)->io_obj,bno,len,f,first,tot,mval,nmap,flist,delta)
-#define XFS_BUNMAPI(mp, trans,io,bno,len,f,nexts,first,flist,delta,done) \
-       (*(mp)->m_io_ops.xfs_bunmapi_func) \
-               (trans,(io)->io_obj,bno,len,f,nexts,first,flist,delta,done)
-#define XFS_BMAP_EOF(mp, io, endoff, whichfork, eof) \
-       (*(mp)->m_io_ops.xfs_bmap_eof_func) \
-               ((io)->io_obj, endoff, whichfork, eof)
-#define XFS_IOMAP_WRITE_DIRECT(mp, io, offset, count, flags, mval, nmap, found)\
-       (*(mp)->m_io_ops.xfs_iomap_write_direct) \
-               ((io)->io_obj, offset, count, flags, mval, nmap, found)
-#define XFS_IOMAP_WRITE_DELAY(mp, io, offset, count, flags, mval, nmap) \
-       (*(mp)->m_io_ops.xfs_iomap_write_delay) \
-               ((io)->io_obj, offset, count, flags, mval, nmap)
-#define XFS_IOMAP_WRITE_ALLOCATE(mp, io, offset, count, mval, nmap) \
-       (*(mp)->m_io_ops.xfs_iomap_write_allocate) \
-               ((io)->io_obj, offset, count, mval, nmap)
-#define XFS_IOMAP_WRITE_UNWRITTEN(mp, io, offset, count) \
-       (*(mp)->m_io_ops.xfs_iomap_write_unwritten) \
-               ((io)->io_obj, offset, count)
-#define XFS_LCK_MAP_SHARED(mp, io) \
-       (*(mp)->m_io_ops.xfs_lck_map_shared)((io)->io_obj)
-#define XFS_ILOCK(mp, io, mode) \
-       (*(mp)->m_io_ops.xfs_ilock)((io)->io_obj, mode)
-#define XFS_ILOCK_NOWAIT(mp, io, mode) \
-       (*(mp)->m_io_ops.xfs_ilock_nowait)((io)->io_obj, mode)
-#define XFS_IUNLOCK(mp, io, mode) \
-       (*(mp)->m_io_ops.xfs_unlock)((io)->io_obj, mode)
-#define XFS_ILOCK_DEMOTE(mp, io, mode) \
-       (*(mp)->m_io_ops.xfs_ilock_demote)((io)->io_obj, mode)
-#define XFS_SIZE(mp, io) \
-       (*(mp)->m_io_ops.xfs_size_func)((io)->io_obj)
-#define XFS_IODONE(mp) \
-       (*(mp)->m_io_ops.xfs_iodone)(mp)
-#define XFS_SWAP_EXTENTS(mp, io, tio, sxp) \
-       (*(mp)->m_io_ops.xfs_swap_extents_func) \
-               ((io)->io_obj, (tio)->io_obj, sxp)
-
 #ifdef HAVE_PERCPU_SB
 
 /*
@@ -313,27 +206,34 @@ typedef struct xfs_icsb_cnts {
 
 #define XFS_ICSB_FLAG_LOCK     (1 << 0)        /* counter lock bit */
 
-#define XFS_ICSB_SB_LOCKED     (1 << 0)        /* sb already locked */
 #define XFS_ICSB_LAZY_COUNT    (1 << 1)        /* accuracy not needed */
 
 extern int     xfs_icsb_init_counters(struct xfs_mount *);
 extern void    xfs_icsb_reinit_counters(struct xfs_mount *);
-extern void    xfs_icsb_sync_counters_flags(struct xfs_mount *, int);
+extern void    xfs_icsb_sync_counters(struct xfs_mount *, int);
+extern void    xfs_icsb_sync_counters_locked(struct xfs_mount *, int);
 
 #else
 #define xfs_icsb_init_counters(mp)     (0)
 #define xfs_icsb_reinit_counters(mp)   do { } while (0)
-#define xfs_icsb_sync_counters_flags(mp, flags)        do { } while (0)
+#define xfs_icsb_sync_counters(mp, flags)      do { } while (0)
+#define xfs_icsb_sync_counters_locked(mp, flags) do { } while (0)
 #endif
 
+typedef struct xfs_ail {
+       struct list_head        xa_ail;
+       uint                    xa_gen;
+       struct task_struct      *xa_task;
+       xfs_lsn_t               xa_target;
+} xfs_ail_t;
+
 typedef struct xfs_mount {
        struct super_block      *m_super;
        xfs_tid_t               m_tid;          /* next unused tid for fs */
-       AIL_LOCK_T              m_ail_lock;     /* fs AIL mutex */
-       xfs_ail_entry_t         m_ail;          /* fs active log item list */
-       uint                    m_ail_gen;      /* fs AIL generation count */
+       spinlock_t              m_ail_lock;     /* fs AIL mutex */
+       xfs_ail_t               m_ail;          /* fs active log item list */
        xfs_sb_t                m_sb;           /* copy of fs superblock */
-       lock_t                  m_sb_lock;      /* sb counter mutex */
+       spinlock_t              m_sb_lock;      /* sb counter lock */
        struct xfs_buf          *m_sb_bp;       /* buffer for superblock */
        char                    *m_fsname;      /* filesystem name */
        int                     m_fsname_len;   /* strlen of fs name */
@@ -342,7 +242,7 @@ typedef struct xfs_mount {
        int                     m_bsize;        /* fs logical block size */
        xfs_agnumber_t          m_agfrotor;     /* last ag where space found */
        xfs_agnumber_t          m_agirotor;     /* last ag dir inode alloced */
-       lock_t                  m_agirotor_lock;/* .. and lock protecting it */
+       spinlock_t              m_agirotor_lock;/* .. and lock protecting it */
        xfs_agnumber_t          m_maxagi;       /* highest inode alloc group */
        struct xfs_inode        *m_inodes;      /* active inode list */
        struct list_head        m_del_inodes;   /* inodes to reclaim */
@@ -384,7 +284,7 @@ typedef struct xfs_mount {
        uint                    m_in_maxlevels; /* XFS_IN_MAXLEVELS */
        struct xfs_perag        *m_perag;       /* per-ag accounting info */
        struct rw_semaphore     m_peraglock;    /* lock for m_perag (pointer) */
-       sema_t                  m_growlock;     /* growfs mutex */
+       struct mutex            m_growlock;     /* growfs mutex */
        int                     m_fixedfsid[2]; /* unchanged for life of FS */
        uint                    m_dmevmask;     /* DMI events for this FS */
        __uint64_t              m_flags;        /* global mount flags */
@@ -423,7 +323,6 @@ typedef struct xfs_mount {
                                                 * hash table */
        struct xfs_dmops        *m_dm_ops;      /* vector of DMI ops */
        struct xfs_qmops        *m_qm_ops;      /* vector of XQM ops */
-       struct xfs_ioops        m_io_ops;       /* vector of I/O ops */
        atomic_t                m_active_trans; /* number trans frozen */
 #ifdef HAVE_PERCPU_SB
        xfs_icsb_cnts_t         *m_sb_cnts;     /* per-cpu superblock counters */
@@ -468,7 +367,7 @@ typedef struct xfs_mount {
 #define XFS_MOUNT_SMALL_INUMS  (1ULL << 15)    /* users wants 32bit inodes */
 #define XFS_MOUNT_NOUUID       (1ULL << 16)    /* ignore uuid during mount */
 #define XFS_MOUNT_BARRIER      (1ULL << 17)
-#define XFS_MOUNT_IDELETE      (1ULL << 18)    /* delete empty inode clusters*/
+#define XFS_MOUNT_IKEEP                (1ULL << 18)    /* keep empty inode clusters*/
 #define XFS_MOUNT_SWALLOC      (1ULL << 19)    /* turn on stripe width
                                                 * allocation */
 #define XFS_MOUNT_RDONLY       (1ULL << 20)    /* read-only fs */
@@ -503,7 +402,7 @@ typedef struct xfs_mount {
 
 /*
  * Allow large block sizes to be reported to userspace programs if the
- * "largeio" mount option is used. 
+ * "largeio" mount option is used.
  *
  * If compatibility mode is specified, simply return the basic unit of caching
  * so that we don't get inefficient read/modify/write I/O from user apps.
@@ -610,8 +509,6 @@ typedef struct xfs_mod_sb {
 
 #define        XFS_MOUNT_ILOCK(mp)     mutex_lock(&((mp)->m_ilock))
 #define        XFS_MOUNT_IUNLOCK(mp)   mutex_unlock(&((mp)->m_ilock))
-#define        XFS_SB_LOCK(mp)         mutex_spinlock(&(mp)->m_sb_lock)
-#define        XFS_SB_UNLOCK(mp,s)     mutex_spinunlock(&(mp)->m_sb_lock,(s))
 
 extern xfs_mount_t *xfs_mount_init(void);
 extern void    xfs_mod_sb(xfs_trans_t *, __int64_t);
@@ -646,7 +543,6 @@ extern int  xfs_qmops_get(struct xfs_mount *, struct xfs_mount_args *);
 extern void    xfs_qmops_put(struct xfs_mount *);
 
 extern struct xfs_dmops xfs_dmcore_xfs;
-extern struct xfs_ioops xfs_iocore_xfs;
 
 extern int     xfs_init(void);
 extern void    xfs_cleanup(void);