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
33#include "xfs.h"
34
35/*
36 * Stub for no-op vnode operations that return error status.
37 */
38int
39fs_noerr()
40{
41	return 0;
42}
43
44/*
45 * Operation unsupported under this file system.
46 */
47int
48fs_nosys()
49{
50	return ENOSYS;
51}
52
53/*
54 * Stub for inactive, strategy, and read/write lock/unlock.  Does nothing.
55 */
56/* ARGSUSED */
57void
58fs_noval()
59{
60}
61
62/*
63 * vnode pcache layer for vnode_tosspages.
64 * 'last' parameter unused but left in for IRIX compatibility
65 */
66void
67fs_tosspages(
68	bhv_desc_t	*bdp,
69	xfs_off_t	first,
70	xfs_off_t	last,
71	int		fiopt)
72{
73#ifdef XXXKAN
74	vnode_t		*vp = BHV_TO_VNODE(bdp);
75	struct inode	*ip = LINVFS_GET_IP(vp);
76
77	if (VN_CACHED(vp))
78		truncate_inode_pages(ip->i_mapping, first);
79#endif
80}
81
82
83/*
84 * vnode pcache layer for vnode_flushinval_pages.
85 * 'last' parameter unused but left in for IRIX compatibility
86 */
87void
88fs_flushinval_pages(
89	bhv_desc_t	*bdp,
90	xfs_off_t	first,
91	xfs_off_t	last,
92	int		fiopt)
93{
94#ifdef XXXKAN
95	vnode_t		*vp = BHV_TO_VNODE(bdp);
96	struct inode	*ip = LINVFS_GET_IP(vp);
97
98	if (VN_CACHED(vp)) {
99		filemap_fdatasync(ip->i_mapping);
100		fsync_inode_data_buffers(ip);
101		filemap_fdatawait(ip->i_mapping);
102
103		truncate_inode_pages(ip->i_mapping, first);
104	}
105#endif
106}
107
108/*
109 * vnode pcache layer for vnode_flush_pages.
110 * 'last' parameter unused but left in for IRIX compatibility
111 */
112int
113fs_flush_pages(
114	bhv_desc_t	*bdp,
115	xfs_off_t	first,
116	xfs_off_t	last,
117	uint64_t	flags,
118	int		fiopt)
119{
120#ifdef XXXKAN
121	vnode_t		*vp = BHV_TO_VNODE(bdp);
122	struct inode	*ip = LINVFS_GET_IP(vp);
123
124	if (VN_CACHED(vp)) {
125		filemap_fdatasync(ip->i_mapping);
126		fsync_inode_data_buffers(ip);
127		filemap_fdatawait(ip->i_mapping);
128	}
129#endif
130	return 0;
131}
132