[XFS] Fix up sparse warnings.
[safe/jmp/linux-2.6] / fs / xfs / xfs_bmap.h
index 011ccaa..87224b7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
+ * Copyright (c) 2000-2006 Silicon Graphics, Inc.
  * All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or
@@ -25,6 +25,22 @@ struct xfs_inode;
 struct xfs_mount;
 struct xfs_trans;
 
+extern kmem_zone_t     *xfs_bmap_free_item_zone;
+
+/*
+ * DELTA: describe a change to the in-core extent list.
+ *
+ * Internally the use of xed_blockount is somewhat funky.
+ * xed_blockcount contains an offset much of the time because this
+ * makes merging changes easier.  (xfs_fileoff_t and xfs_filblks_t are
+ * the same underlying type).
+ */
+typedef struct xfs_extdelta
+{
+       xfs_fileoff_t           xed_startoff;   /* offset of range */
+       xfs_filblks_t           xed_blockcount; /* blocks in range */
+} xfs_extdelta_t;
+
 /*
  * List of extents to be free "later".
  * The list is kept sorted on xbf_startblock.
@@ -130,12 +146,14 @@ extern ktrace_t   *xfs_bmap_trace_buf;
  */
 void
 xfs_bmap_trace_exlist(
-       char                    *fname,         /* function name */
+       const char              *fname,         /* function name */
        struct xfs_inode        *ip,            /* incore inode pointer */
        xfs_extnum_t            cnt,            /* count of entries in list */
        int                     whichfork);     /* data or attr fork */
+#define        XFS_BMAP_TRACE_EXLIST(ip,c,w)   \
+       xfs_bmap_trace_exlist(__FUNCTION__,ip,c,w)
 #else
-#define        xfs_bmap_trace_exlist(f,ip,c,w)
+#define        XFS_BMAP_TRACE_EXLIST(ip,c,w)
 #endif
 
 /*
@@ -188,7 +206,6 @@ int                                         /* error */
 xfs_bmap_finish(
        struct xfs_trans        **tp,           /* transaction pointer addr */
        xfs_bmap_free_t         *flist,         /* i/o: list extents to free */
-       xfs_fsblock_t           firstblock,     /* controlled a.g. for allocs */
        int                     *committed);    /* xact committed or not */
 
 /*
@@ -275,7 +292,9 @@ xfs_bmapi(
        xfs_extlen_t            total,          /* total blocks needed */
        struct xfs_bmbt_irec    *mval,          /* output: map values */
        int                     *nmap,          /* i/o: mval size/count */
-       xfs_bmap_free_t         *flist);        /* i/o: list extents to free */
+       xfs_bmap_free_t         *flist,         /* i/o: list extents to free */
+       xfs_extdelta_t          *delta);        /* o: change made to incore
+                                                  extents */
 
 /*
  * Map file blocks to filesystem blocks, simple version.
@@ -309,6 +328,8 @@ xfs_bunmapi(
        xfs_fsblock_t           *firstblock,    /* first allocated block
                                                   controls a.g. for allocs */
        xfs_bmap_free_t         *flist,         /* i/o: list extents to free */
+       xfs_extdelta_t          *delta,         /* o: change made to incore
+                                                  extents */
        int                     *done);         /* set if not done yet */
 
 /*
@@ -316,7 +337,7 @@ xfs_bunmapi(
  */
 int                                            /* error code */
 xfs_getbmap(
-       bhv_desc_t              *bdp,           /* XFS behavior descriptor*/
+       xfs_inode_t             *ip,
        struct getbmap          *bmv,           /* user bmap structure */
        void                    __user *ap,     /* pointer to user's array */
        int                     iflags);        /* interface flags */
@@ -353,23 +374,16 @@ xfs_check_nostate_extents(
        xfs_extnum_t            num);
 
 /*
- * Call xfs_bmap_do_search_extents() to search for the extent
- * record containing block bno. If in multi-level in-core extent
- * allocation mode, find and extract the target extent buffer,
- * otherwise just use the direct extent list.
+ * Search the extent records for the entry containing block bno.
+ * If bno lies in a hole, point to the next entry.  If bno lies
+ * past eof, *eofp will be set, and *prevp will contain the last
+ * entry (null if none).  Else, *lastxp will be set to the index
+ * of the found entry; *gotp will contain the entry.
  */
-xfs_bmbt_rec_t *
+xfs_bmbt_rec_host_t *
 xfs_bmap_search_multi_extents(struct xfs_ifork *, xfs_fileoff_t, int *,
                        xfs_extnum_t *, xfs_bmbt_irec_t *, xfs_bmbt_irec_t *);
 
-/*
- * Search an extent list for the extent which includes block
- * bno.
- */
-xfs_bmbt_rec_t *xfs_bmap_do_search_extents(xfs_bmbt_rec_t *,
-                       xfs_extnum_t, xfs_extnum_t, xfs_fileoff_t, int *,
-                       xfs_extnum_t *, xfs_bmbt_irec_t *, xfs_bmbt_irec_t *);
-
 #endif /* __KERNEL__ */
 
 #endif /* __XFS_BMAP_H__ */