xfs_vfs.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright (c) 2000-2006 Silicon Graphics, Inc.
  3. * All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it would be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write the Free Software Foundation,
  16. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef __XFS_VFS_H__
  19. #define __XFS_VFS_H__
  20. #include <linux/vfs.h>
  21. #include "xfs_fs.h"
  22. struct inode;
  23. struct fid;
  24. struct cred;
  25. struct seq_file;
  26. struct super_block;
  27. struct xfs_inode;
  28. struct xfs_mount;
  29. struct xfs_mount_args;
  30. typedef struct kstatfs bhv_statvfs_t;
  31. typedef struct bhv_vfs_sync_work {
  32. struct list_head w_list;
  33. struct xfs_mount *w_mount;
  34. void *w_data; /* syncer routine argument */
  35. void (*w_syncer)(struct xfs_mount *, void *);
  36. } bhv_vfs_sync_work_t;
  37. #define SYNC_ATTR 0x0001 /* sync attributes */
  38. #define SYNC_CLOSE 0x0002 /* close file system down */
  39. #define SYNC_DELWRI 0x0004 /* look at delayed writes */
  40. #define SYNC_WAIT 0x0008 /* wait for i/o to complete */
  41. #define SYNC_BDFLUSH 0x0010 /* BDFLUSH is calling -- don't block */
  42. #define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */
  43. #define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */
  44. #define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */
  45. #define SYNC_IOWAIT 0x0100 /* wait for all I/O to complete */
  46. #define SYNC_SUPER 0x0200 /* flush superblock to disk */
  47. /*
  48. * When remounting a filesystem read-only or freezing the filesystem,
  49. * we have two phases to execute. This first phase is syncing the data
  50. * before we quiesce the fielsystem, and the second is flushing all the
  51. * inodes out after we've waited for all the transactions created by
  52. * the first phase to complete. The second phase uses SYNC_INODE_QUIESCE
  53. * to ensure that the inodes are written to their location on disk
  54. * rather than just existing in transactions in the log. This means
  55. * after a quiesce there is no log replay required to write the inodes
  56. * to disk (this is the main difference between a sync and a quiesce).
  57. */
  58. #define SYNC_DATA_QUIESCE (SYNC_DELWRI|SYNC_FSDATA|SYNC_WAIT|SYNC_IOWAIT)
  59. #define SYNC_INODE_QUIESCE (SYNC_REMOUNT|SYNC_ATTR|SYNC_WAIT)
  60. #define SHUTDOWN_META_IO_ERROR 0x0001 /* write attempt to metadata failed */
  61. #define SHUTDOWN_LOG_IO_ERROR 0x0002 /* write attempt to the log failed */
  62. #define SHUTDOWN_FORCE_UMOUNT 0x0004 /* shutdown from a forced unmount */
  63. #define SHUTDOWN_CORRUPT_INCORE 0x0008 /* corrupt in-memory data structures */
  64. #define SHUTDOWN_REMOTE_REQ 0x0010 /* shutdown came from remote cell */
  65. #define SHUTDOWN_DEVICE_REQ 0x0020 /* failed all paths to the device */
  66. #define xfs_test_for_freeze(mp) ((mp)->m_super->s_frozen)
  67. #define xfs_wait_for_freeze(mp,l) vfs_check_frozen((mp)->m_super, (l))
  68. #endif /* __XFS_VFS_H__ */