blob: f89340c61bf289ddc1dd81ce9580e3b97a36ef41 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Nathan Scott7b718762005-11-02 14:58:39 +11002 * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 *
Nathan Scott7b718762005-11-02 14:58:39 +11005 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 * published by the Free Software Foundation.
8 *
Nathan Scott7b718762005-11-02 14:58:39 +11009 * 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.
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 *
Nathan Scott7b718762005-11-02 14:58:39 +110014 * 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
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 */
18
19#include "xfs.h"
20
21/*
22 * Stub for no-op vnode operations that return error status.
23 */
24int
25fs_noerr(void)
26{
27 return 0;
28}
29
30/*
31 * Operation unsupported under this file system.
32 */
33int
34fs_nosys(void)
35{
36 return ENOSYS;
37}
38
39/*
40 * Stub for inactive, strategy, and read/write lock/unlock. Does nothing.
41 */
42/* ARGSUSED */
43void
44fs_noval(void)
45{
46}
47
48/*
49 * vnode pcache layer for vnode_tosspages.
50 * 'last' parameter unused but left in for IRIX compatibility
51 */
52void
53fs_tosspages(
54 bhv_desc_t *bdp,
55 xfs_off_t first,
56 xfs_off_t last,
57 int fiopt)
58{
59 vnode_t *vp = BHV_TO_VNODE(bdp);
60 struct inode *ip = LINVFS_GET_IP(vp);
61
62 if (VN_CACHED(vp))
63 truncate_inode_pages(ip->i_mapping, first);
64}
65
66
67/*
68 * vnode pcache layer for vnode_flushinval_pages.
69 * 'last' parameter unused but left in for IRIX compatibility
70 */
71void
72fs_flushinval_pages(
73 bhv_desc_t *bdp,
74 xfs_off_t first,
75 xfs_off_t last,
76 int fiopt)
77{
78 vnode_t *vp = BHV_TO_VNODE(bdp);
79 struct inode *ip = LINVFS_GET_IP(vp);
80
81 if (VN_CACHED(vp)) {
82 filemap_fdatawrite(ip->i_mapping);
83 filemap_fdatawait(ip->i_mapping);
84
85 truncate_inode_pages(ip->i_mapping, first);
86 }
87}
88
89/*
90 * vnode pcache layer for vnode_flush_pages.
91 * 'last' parameter unused but left in for IRIX compatibility
92 */
93int
94fs_flush_pages(
95 bhv_desc_t *bdp,
96 xfs_off_t first,
97 xfs_off_t last,
98 uint64_t flags,
99 int fiopt)
100{
101 vnode_t *vp = BHV_TO_VNODE(bdp);
102 struct inode *ip = LINVFS_GET_IP(vp);
103
104 if (VN_CACHED(vp)) {
105 filemap_fdatawrite(ip->i_mapping);
Nathan Scottee348072005-11-02 10:32:38 +1100106 if (flags & XFS_B_ASYNC)
107 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108 filemap_fdatawait(ip->i_mapping);
109 }
110
111 return 0;
112}