move vn_iowait / vn_iowake into xfs_aops.c
[linux-block.git] / fs / xfs / linux-2.6 / xfs_vnode.c
index b52528bbbfff7953510639c5fda9d447e995adee..f6d141122792bf2dcf8c2ab49e93d6f5e38cb826 100644 (file)
 #include "xfs_mount.h"
 
 
-/*
- * Dedicated vnode inactive/reclaim sync wait queues.
- * Prime number of hash buckets since address is used as the key.
- */
-#define NVSYNC                  37
-#define vptosync(v)             (&vsync[((unsigned long)v) % NVSYNC])
-static wait_queue_head_t vsync[NVSYNC];
-
-void __init
-vn_init(void)
-{
-       int i;
-
-       for (i = 0; i < NVSYNC; i++)
-               init_waitqueue_head(&vsync[i]);
-}
-
-void
-vn_iowait(
-       xfs_inode_t     *ip)
-{
-       wait_queue_head_t *wq = vptosync(ip);
-
-       wait_event(*wq, (atomic_read(&ip->i_iocount) == 0));
-}
-
-void
-vn_iowake(
-       xfs_inode_t     *ip)
-{
-       if (atomic_dec_and_test(&ip->i_iocount))
-               wake_up(vptosync(ip));
-}
-
-/*
- * Volume managers supporting multiple paths can send back ENODEV when the
- * final path disappears.  In this case continuing to fill the page cache
- * with dirty data which cannot be written out is evil, so prevent that.
- */
-void
-vn_ioerror(
-       xfs_inode_t     *ip,
-       int             error,
-       char            *f,
-       int             l)
-{
-       if (unlikely(error == -ENODEV))
-               xfs_do_force_shutdown(ip->i_mount, SHUTDOWN_DEVICE_REQ, f, l);
-}
-
 #ifdef XFS_INODE_TRACE
 
-/*
- * Reference count of Linux inode if present, -1 if the xfs_inode
- * has no associated Linux inode.
- */
-static inline int xfs_icount(struct xfs_inode *ip)
-{
-       struct inode *vp = VFS_I(ip);
-
-       if (vp)
-               return vn_count(vp);
-       return -1;
-}
-
 #define KTRACE_ENTER(ip, vk, s, line, ra)                      \
        ktrace_enter(   (ip)->i_trace,                          \
 /*  0 */               (void *)(__psint_t)(vk),                \
 /*  1 */               (void *)(s),                            \
 /*  2 */               (void *)(__psint_t) line,               \
-/*  3 */               (void *)(__psint_t)xfs_icount(ip),      \
+/*  3 */               (void *)(__psint_t)atomic_read(&VFS_I(ip)->i_count), \
 /*  4 */               (void *)(ra),                           \
 /*  5 */               NULL,                                   \
 /*  6 */               (void *)(__psint_t)current_cpu(),       \