2 * Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved.
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.
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.
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.
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.
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
28 * For further information regarding this notice, see:
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
34 * Written by Steve Lord at SGI
37 #ifndef __PAGE_BUF_PRIVATE_H__
38 #define __PAGE_BUF_PRIVATE_H__
42 #define _PAGE_BUF_INTERNAL_
43 #define PB_DEFINE_TRACES
44 #include "page_buf_trace.h"
46 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,9)
47 #define page_buffers(page) ((page)->buffers)
48 #define page_has_buffers(page) ((page)->buffers)
51 #ifdef PAGEBUF_LOCK_TRACKING
52 #define PB_SET_OWNER(pb) (pb->pb_last_holder = current->pid)
53 #define PB_CLEAR_OWNER(pb) (pb->pb_last_holder = -1)
54 #define PB_GET_OWNER(pb) (pb->pb_last_holder)
56 #define PB_SET_OWNER(pb)
57 #define PB_CLEAR_OWNER(pb)
58 #define PB_GET_OWNER(pb)
59 #endif /* PAGEBUF_LOCK_TRACKING */
61 /* Tracing utilities for pagebuf */
65 page_buf_flags_t flags;
67 unsigned short lock_value;
75 struct pagebuf_trace_buf {
81 #define PB_TRACE_BUFSIZE 1024
82 #define CIRC_INC(i) (((i) + 1) & (PB_TRACE_BUFSIZE - 1))
85 * Tunable pagebuf parameters
88 typedef struct pb_sysctl_val {
94 typedef struct pagebuf_param {
95 pb_sysctl_val_t flush_interval; /* interval between runs of the
96 * delwri flush daemon. */
97 pb_sysctl_val_t age_buffer; /* time for buffer to age before
99 pb_sysctl_val_t stats_clear; /* clear the pagebuf stats */
100 pb_sysctl_val_t debug; /* debug tracing on or off */
110 extern pagebuf_param_t pb_params;
119 u_int32_t pb_get_locked;
120 u_int32_t pb_get_locked_waited;
121 u_int32_t pb_busy_locked;
122 u_int32_t pb_miss_locked;
123 u_int32_t pb_page_retries;
124 u_int32_t pb_page_found;
125 u_int32_t pb_get_read;
128 extern struct pbstats pbstats;
130 #define PB_STATS_INC(count) ( count ++ )
133 # define STATIC static
136 #endif /* __PAGE_BUF_PRIVATE_H__ */