xfs: kill some warnings on i386 builds
[safe/jmp/linux-2.6] / fs / xfs / xfs_filestream.c
index c38fd14..a631e14 100644 (file)
@@ -34,6 +34,7 @@
 #include "xfs_utils.h"
 #include "xfs_mru_cache.h"
 #include "xfs_filestream.h"
+#include "xfs_trace.h"
 
 #ifdef XFS_FILESTREAMS_TRACE
 
@@ -140,7 +141,7 @@ _xfs_filestream_pick_ag(
        xfs_extlen_t    minlen)
 {
        int             err, trylock, nscan;
-       xfs_extlen_t    delta, longest, need, free, minfree, maxfree = 0;
+       xfs_extlen_t    longest, free, minfree, maxfree = 0;
        xfs_agnumber_t  ag, max_ag = NULLAGNUMBER;
        struct xfs_perag *pag;
 
@@ -186,12 +187,7 @@ _xfs_filestream_pick_ag(
                        goto next_ag;
                }
 
-               need = XFS_MIN_FREELIST_PAG(pag, mp);
-               delta = need > pag->pagf_flcount ? need - pag->pagf_flcount : 0;
-               longest = (pag->pagf_longest > delta) ?
-                         (pag->pagf_longest - delta) :
-                         (pag->pagf_flcount > 0 || pag->pagf_longest > 0);
-
+               longest = xfs_alloc_longest_free_extent(mp, pag);
                if (((minlen && longest >= minlen) ||
                     (!minlen && pag->pagf_freeblks >= minfree)) &&
                    (!pag->pagf_metadata || !(flags & XFS_PICK_USERDATA) ||
@@ -399,9 +395,7 @@ xfs_filestream_init(void)
        item_zone = kmem_zone_init(sizeof(fstrm_item_t), "fstrm_item");
        if (!item_zone)
                return -ENOMEM;
-#ifdef XFS_FILESTREAMS_TRACE
-       xfs_filestreams_trace_buf = ktrace_alloc(XFS_FSTRM_KTRACE_SIZE, KM_SLEEP);
-#endif
+
        return 0;
 }
 
@@ -412,9 +406,6 @@ xfs_filestream_init(void)
 void
 xfs_filestream_uninit(void)
 {
-#ifdef XFS_FILESTREAMS_TRACE
-       ktrace_free(xfs_filestreams_trace_buf);
-#endif
        kmem_zone_destroy(item_zone);
 }
 
@@ -547,10 +538,8 @@ xfs_filestream_associate(
         * waiting for the lock because someone else is waiting on the lock we
         * hold and we cannot drop that as we are in a transaction here.
         *
-        * Lucky for us, this inversion is rarely a problem because it's a
-        * directory inode that we are trying to lock here and that means the
-        * only place that matters is xfs_sync_inodes() and SYNC_DELWRI is
-        * used. i.e. freeze, remount-ro, quotasync or unmount.
+        * Lucky for us, this inversion is not a problem because it's a
+        * directory inode that we are trying to lock here.
         *
         * So, if we can't get the iolock without sleeping then just give up
         */