diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-10-30 01:56:32 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 01:56:32 -0400 |
commit | 278d0ca14e889c3932a05d1a68675252a12b3466 (patch) | |
tree | a228d171d4aded60b27639e30eca1bf58ed7daa6 /fs/xfs/xfs_bmap_btree.c | |
parent | 38bb74237d2d94c1aced2ec626d7d0f317e360da (diff) |
[XFS] implement generic xfs_btree_update
From: Dave Chinner <dgc@sgi.com>
The most complicated part here is the lastrec tracking for the alloc
btree. Most logic is in the update_lastrec method which has to do some
hopefully good enough dirty magic to maintain it.
[hch: split out from bigger patch and a rework of the lastrec
logic]
SGI-PV: 985583
SGI-Modid: xfs-linux-melb:xfs-kern:32194a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Bill O'Donnell <billodo@sgi.com>
Signed-off-by: David Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_bmap_btree.c')
-rw-r--r-- | fs/xfs/xfs_bmap_btree.c | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c index 0a56257b7fd5..99200a9898f7 100644 --- a/fs/xfs/xfs_bmap_btree.c +++ b/fs/xfs/xfs_bmap_btree.c | |||
@@ -1964,51 +1964,6 @@ xfs_bmbt_to_bmdr( | |||
1964 | } | 1964 | } |
1965 | 1965 | ||
1966 | /* | 1966 | /* |
1967 | * Update the record to the passed values. | ||
1968 | */ | ||
1969 | int | ||
1970 | xfs_bmbt_update( | ||
1971 | xfs_btree_cur_t *cur, | ||
1972 | xfs_fileoff_t off, | ||
1973 | xfs_fsblock_t bno, | ||
1974 | xfs_filblks_t len, | ||
1975 | xfs_exntst_t state) | ||
1976 | { | ||
1977 | xfs_bmbt_block_t *block; | ||
1978 | xfs_buf_t *bp; | ||
1979 | int error; | ||
1980 | xfs_bmbt_key_t key; | ||
1981 | int ptr; | ||
1982 | xfs_bmbt_rec_t *rp; | ||
1983 | |||
1984 | XFS_BMBT_TRACE_CURSOR(cur, ENTRY); | ||
1985 | XFS_BMBT_TRACE_ARGFFFI(cur, (xfs_dfiloff_t)off, (xfs_dfsbno_t)bno, | ||
1986 | (xfs_dfilblks_t)len, (int)state); | ||
1987 | block = xfs_bmbt_get_block(cur, 0, &bp); | ||
1988 | #ifdef DEBUG | ||
1989 | if ((error = xfs_btree_check_lblock(cur, block, 0, bp))) { | ||
1990 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | ||
1991 | return error; | ||
1992 | } | ||
1993 | #endif | ||
1994 | ptr = cur->bc_ptrs[0]; | ||
1995 | rp = XFS_BMAP_REC_IADDR(block, ptr, cur); | ||
1996 | xfs_bmbt_disk_set_allf(rp, off, bno, len, state); | ||
1997 | xfs_bmbt_log_recs(cur, bp, ptr, ptr); | ||
1998 | if (ptr > 1) { | ||
1999 | XFS_BMBT_TRACE_CURSOR(cur, EXIT); | ||
2000 | return 0; | ||
2001 | } | ||
2002 | key.br_startoff = cpu_to_be64(off); | ||
2003 | if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) { | ||
2004 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | ||
2005 | return error; | ||
2006 | } | ||
2007 | XFS_BMBT_TRACE_CURSOR(cur, EXIT); | ||
2008 | return 0; | ||
2009 | } | ||
2010 | |||
2011 | /* | ||
2012 | * Check extent records, which have just been read, for | 1967 | * Check extent records, which have just been read, for |
2013 | * any bit in the extent flag field. ASSERT on debug | 1968 | * any bit in the extent flag field. ASSERT on debug |
2014 | * kernels, as this condition should not occur. | 1969 | * kernels, as this condition should not occur. |