aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_buf.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_buf.h')
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.h73
1 files changed, 22 insertions, 51 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
index 67c19f799232..237a35b915d1 100644
--- a/fs/xfs/linux-2.6/xfs_buf.h
+++ b/fs/xfs/linux-2.6/xfs_buf.h
@@ -1,39 +1,20 @@
1/* 1/*
2 * Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. 2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
3 * 4 *
4 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or
5 * under the terms of version 2 of the GNU General Public License as 6 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
7 * 8 *
8 * This program is distributed in the hope that it would be useful, but 9 * This program is distributed in the hope that it would be useful,
9 * WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
11 * 13 *
12 * Further, this software is distributed without any warranty that it is 14 * You should have received a copy of the GNU General Public License
13 * free of the rightful claim of any third person regarding infringement 15 * along with this program; if not, write the Free Software Foundation,
14 * or the like. Any license provided herein, whether implied or 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
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 */ 17 */
32
33/*
34 * Written by Steve Lord, Jim Mostek, Russell Cattelan at SGI
35 */
36
37#ifndef __XFS_BUF_H__ 18#ifndef __XFS_BUF_H__
38#define __XFS_BUF_H__ 19#define __XFS_BUF_H__
39 20
@@ -69,15 +50,12 @@ typedef enum page_buf_flags_e { /* pb_flags values */
69 PBF_READ = (1 << 0), /* buffer intended for reading from device */ 50 PBF_READ = (1 << 0), /* buffer intended for reading from device */
70 PBF_WRITE = (1 << 1), /* buffer intended for writing to device */ 51 PBF_WRITE = (1 << 1), /* buffer intended for writing to device */
71 PBF_MAPPED = (1 << 2), /* buffer mapped (pb_addr valid) */ 52 PBF_MAPPED = (1 << 2), /* buffer mapped (pb_addr valid) */
72 PBF_PARTIAL = (1 << 3), /* buffer partially read */
73 PBF_ASYNC = (1 << 4), /* initiator will not wait for completion */ 53 PBF_ASYNC = (1 << 4), /* initiator will not wait for completion */
74 PBF_NONE = (1 << 5), /* buffer not read at all */ 54 PBF_DONE = (1 << 5), /* all pages in the buffer uptodate */
75 PBF_DELWRI = (1 << 6), /* buffer has dirty pages */ 55 PBF_DELWRI = (1 << 6), /* buffer has dirty pages */
76 PBF_STALE = (1 << 7), /* buffer has been staled, do not find it */ 56 PBF_STALE = (1 << 7), /* buffer has been staled, do not find it */
77 PBF_FS_MANAGED = (1 << 8), /* filesystem controls freeing memory */ 57 PBF_FS_MANAGED = (1 << 8), /* filesystem controls freeing memory */
78 PBF_FS_DATAIOD = (1 << 9), /* schedule IO completion on fs datad */ 58 PBF_ORDERED = (1 << 11), /* use ordered writes */
79 PBF_FORCEIO = (1 << 10), /* ignore any cache state */
80 PBF_FLUSH = (1 << 11), /* flush disk write cache */
81 PBF_READ_AHEAD = (1 << 12), /* asynchronous read-ahead */ 59 PBF_READ_AHEAD = (1 << 12), /* asynchronous read-ahead */
82 60
83 /* flags used only as arguments to access routines */ 61 /* flags used only as arguments to access routines */
@@ -92,9 +70,6 @@ typedef enum page_buf_flags_e { /* pb_flags values */
92 _PBF_DELWRI_Q = (1 << 21), /* buffer on delwri queue */ 70 _PBF_DELWRI_Q = (1 << 21), /* buffer on delwri queue */
93} page_buf_flags_t; 71} page_buf_flags_t;
94 72
95#define PBF_UPDATE (PBF_READ | PBF_WRITE)
96#define PBF_NOT_DONE(pb) (((pb)->pb_flags & (PBF_PARTIAL|PBF_NONE)) != 0)
97#define PBF_DONE(pb) (((pb)->pb_flags & (PBF_PARTIAL|PBF_NONE)) == 0)
98 73
99typedef struct xfs_bufhash { 74typedef struct xfs_bufhash {
100 struct list_head bh_list; 75 struct list_head bh_list;
@@ -258,7 +233,6 @@ extern void pagebuf_unlock( /* unlock buffer */
258 233
259extern void pagebuf_iodone( /* mark buffer I/O complete */ 234extern void pagebuf_iodone( /* mark buffer I/O complete */
260 xfs_buf_t *, /* buffer to mark */ 235 xfs_buf_t *, /* buffer to mark */
261 int, /* use data/log helper thread. */
262 int); /* run completion locally, or in 236 int); /* run completion locally, or in
263 * a helper thread. */ 237 * a helper thread. */
264 238
@@ -378,21 +352,21 @@ extern void pagebuf_trace(
378#define XFS_BUF_GETERROR(x) pagebuf_geterror(x) 352#define XFS_BUF_GETERROR(x) pagebuf_geterror(x)
379#define XFS_BUF_ISERROR(x) (pagebuf_geterror(x)?1:0) 353#define XFS_BUF_ISERROR(x) (pagebuf_geterror(x)?1:0)
380 354
381#define XFS_BUF_DONE(x) ((x)->pb_flags &= ~(PBF_PARTIAL|PBF_NONE)) 355#define XFS_BUF_DONE(x) ((x)->pb_flags |= PBF_DONE)
382#define XFS_BUF_UNDONE(x) ((x)->pb_flags |= PBF_PARTIAL|PBF_NONE) 356#define XFS_BUF_UNDONE(x) ((x)->pb_flags &= ~PBF_DONE)
383#define XFS_BUF_ISDONE(x) (!(PBF_NOT_DONE(x))) 357#define XFS_BUF_ISDONE(x) ((x)->pb_flags & PBF_DONE)
384 358
385#define XFS_BUF_BUSY(x) ((x)->pb_flags |= PBF_FORCEIO) 359#define XFS_BUF_BUSY(x) do { } while (0)
386#define XFS_BUF_UNBUSY(x) ((x)->pb_flags &= ~PBF_FORCEIO) 360#define XFS_BUF_UNBUSY(x) do { } while (0)
387#define XFS_BUF_ISBUSY(x) (1) 361#define XFS_BUF_ISBUSY(x) (1)
388 362
389#define XFS_BUF_ASYNC(x) ((x)->pb_flags |= PBF_ASYNC) 363#define XFS_BUF_ASYNC(x) ((x)->pb_flags |= PBF_ASYNC)
390#define XFS_BUF_UNASYNC(x) ((x)->pb_flags &= ~PBF_ASYNC) 364#define XFS_BUF_UNASYNC(x) ((x)->pb_flags &= ~PBF_ASYNC)
391#define XFS_BUF_ISASYNC(x) ((x)->pb_flags & PBF_ASYNC) 365#define XFS_BUF_ISASYNC(x) ((x)->pb_flags & PBF_ASYNC)
392 366
393#define XFS_BUF_FLUSH(x) ((x)->pb_flags |= PBF_FLUSH) 367#define XFS_BUF_ORDERED(x) ((x)->pb_flags |= PBF_ORDERED)
394#define XFS_BUF_UNFLUSH(x) ((x)->pb_flags &= ~PBF_FLUSH) 368#define XFS_BUF_UNORDERED(x) ((x)->pb_flags &= ~PBF_ORDERED)
395#define XFS_BUF_ISFLUSH(x) ((x)->pb_flags & PBF_FLUSH) 369#define XFS_BUF_ISORDERED(x) ((x)->pb_flags & PBF_ORDERED)
396 370
397#define XFS_BUF_SHUT(x) printk("XFS_BUF_SHUT not implemented yet\n") 371#define XFS_BUF_SHUT(x) printk("XFS_BUF_SHUT not implemented yet\n")
398#define XFS_BUF_UNSHUT(x) printk("XFS_BUF_UNSHUT not implemented yet\n") 372#define XFS_BUF_UNSHUT(x) printk("XFS_BUF_UNSHUT not implemented yet\n")
@@ -412,9 +386,6 @@ extern void pagebuf_trace(
412 386
413#define XFS_BUF_BP_ISMAPPED(bp) 1 387#define XFS_BUF_BP_ISMAPPED(bp) 1
414 388
415#define XFS_BUF_DATAIO(x) ((x)->pb_flags |= PBF_FS_DATAIOD)
416#define XFS_BUF_UNDATAIO(x) ((x)->pb_flags &= ~PBF_FS_DATAIOD)
417
418#define XFS_BUF_IODONE_FUNC(buf) (buf)->pb_iodone 389#define XFS_BUF_IODONE_FUNC(buf) (buf)->pb_iodone
419#define XFS_BUF_SET_IODONE_FUNC(buf, func) \ 390#define XFS_BUF_SET_IODONE_FUNC(buf, func) \
420 (buf)->pb_iodone = (func) 391 (buf)->pb_iodone = (func)
@@ -510,7 +481,7 @@ static inline void xfs_buf_relse(xfs_buf_t *bp)
510 pagebuf_trace(bp, id, NULL, (void *)__builtin_return_address(0)) 481 pagebuf_trace(bp, id, NULL, (void *)__builtin_return_address(0))
511 482
512#define xfs_biodone(pb) \ 483#define xfs_biodone(pb) \
513 pagebuf_iodone(pb, (pb->pb_flags & PBF_FS_DATAIOD), 0) 484 pagebuf_iodone(pb, 0)
514 485
515#define xfs_biomove(pb, off, len, data, rw) \ 486#define xfs_biomove(pb, off, len, data, rw) \
516 pagebuf_iomove((pb), (off), (len), (data), \ 487 pagebuf_iomove((pb), (off), (len), (data), \