xfs_fs_subr.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of version 2 of the GNU General Public License as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it would be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. *
  12. * Further, this software is distributed without any warranty that it is
  13. * free of the rightful claim of any third person regarding infringement
  14. * or the like. Any license provided herein, whether implied or
  15. * otherwise, applies only to this software file. Patent licenses, if
  16. * any, provided herein do not apply to combinations of this program with
  17. * other software, or any other product whatsoever.
  18. *
  19. * You should have received a copy of the GNU General Public License along
  20. * with this program; if not, write the Free Software Foundation, Inc., 59
  21. * Temple Place - Suite 330, Boston MA 02111-1307, USA.
  22. *
  23. * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
  24. * Mountain View, CA 94043, or:
  25. *
  26. * http://www.sgi.com
  27. *
  28. * For further information regarding this notice, see:
  29. *
  30. * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  31. */
  32. #include "xfs.h"
  33. /*
  34. * Stub for no-op vnode operations that return error status.
  35. */
  36. int
  37. fs_noerr(void)
  38. {
  39. return 0;
  40. }
  41. /*
  42. * Operation unsupported under this file system.
  43. */
  44. int
  45. fs_nosys(void)
  46. {
  47. return ENOSYS;
  48. }
  49. /*
  50. * Stub for inactive, strategy, and read/write lock/unlock. Does nothing.
  51. */
  52. /* ARGSUSED */
  53. void
  54. fs_noval(void)
  55. {
  56. }
  57. /*
  58. * vnode pcache layer for vnode_tosspages.
  59. * 'last' parameter unused but left in for IRIX compatibility
  60. */
  61. void
  62. fs_tosspages(
  63. bhv_desc_t *bdp,
  64. xfs_off_t first,
  65. xfs_off_t last,
  66. int fiopt)
  67. {
  68. vnode_t *vp = BHV_TO_VNODE(bdp);
  69. struct inode *ip = LINVFS_GET_IP(vp);
  70. if (VN_CACHED(vp))
  71. truncate_inode_pages(ip->i_mapping, first);
  72. }
  73. /*
  74. * vnode pcache layer for vnode_flushinval_pages.
  75. * 'last' parameter unused but left in for IRIX compatibility
  76. */
  77. void
  78. fs_flushinval_pages(
  79. bhv_desc_t *bdp,
  80. xfs_off_t first,
  81. xfs_off_t last,
  82. int fiopt)
  83. {
  84. vnode_t *vp = BHV_TO_VNODE(bdp);
  85. struct inode *ip = LINVFS_GET_IP(vp);
  86. if (VN_CACHED(vp)) {
  87. filemap_fdatawrite(ip->i_mapping);
  88. filemap_fdatawait(ip->i_mapping);
  89. truncate_inode_pages(ip->i_mapping, first);
  90. }
  91. }
  92. /*
  93. * vnode pcache layer for vnode_flush_pages.
  94. * 'last' parameter unused but left in for IRIX compatibility
  95. */
  96. int
  97. fs_flush_pages(
  98. bhv_desc_t *bdp,
  99. xfs_off_t first,
  100. xfs_off_t last,
  101. uint64_t flags,
  102. int fiopt)
  103. {
  104. vnode_t *vp = BHV_TO_VNODE(bdp);
  105. struct inode *ip = LINVFS_GET_IP(vp);
  106. if (VN_CACHED(vp)) {
  107. filemap_fdatawrite(ip->i_mapping);
  108. filemap_fdatawait(ip->i_mapping);
  109. }
  110. return 0;
  111. }