oprofile: op_model_athlon.c support for AMD family 10h barcelona performance counters
[safe/jmp/linux-2.6] / fs / xfs / xfs_bmap.c
index bbef394..2e9b34b 100644 (file)
@@ -53,6 +53,7 @@
 #include "xfs_trans_space.h"
 #include "xfs_buf_item.h"
 #include "xfs_filestream.h"
+#include "xfs_vnodeops.h"
 
 
 #ifdef DEBUG
@@ -3492,8 +3493,8 @@ xfs_bmap_extents_to_btree(
        for (cnt = i = 0; i < nextents; i++) {
                ep = xfs_iext_get_ext(ifp, i);
                if (!ISNULLSTARTBLOCK(xfs_bmbt_get_startblock(ep))) {
-                       arp->l0 = INT_GET(ep->l0, ARCH_CONVERT);
-                       arp->l1 = INT_GET(ep->l1, ARCH_CONVERT);
+                       arp->l0 = cpu_to_be64(ep->l0);
+                       arp->l1 = cpu_to_be64(ep->l1);
                        arp++; cnt++;
                }
        }
@@ -4566,8 +4567,8 @@ xfs_bmap_read_extents(
                start = i;
                for (j = 0; j < num_recs; j++, i++, frp++) {
                        xfs_bmbt_rec_host_t *trp = xfs_iext_get_ext(ifp, i);
-                       trp->l0 = INT_GET(frp->l0, ARCH_CONVERT);
-                       trp->l1 = INT_GET(frp->l1, ARCH_CONVERT);
+                       trp->l0 = be64_to_cpu(frp->l0);
+                       trp->l1 = be64_to_cpu(frp->l1);
                }
                if (exntf == XFS_EXTFMT_NOSTATE) {
                        /*
@@ -5764,7 +5765,7 @@ xfs_getbmapx_fix_eof_hole(
  */
 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                     interface)      /* interface flags */
@@ -5773,7 +5774,6 @@ xfs_getbmap(
        int                     error;          /* return value */
        __int64_t               fixlen;         /* length for -1 case */
        int                     i;              /* extent number */
-       xfs_inode_t             *ip;            /* xfs incore inode pointer */
        bhv_vnode_t             *vp;            /* corresponding vnode */
        int                     lock;           /* lock state */
        xfs_bmbt_irec_t         *map;           /* buffer for user's data */
@@ -5791,8 +5791,7 @@ xfs_getbmap(
        int                     bmapi_flags;    /* flags for xfs_bmapi */
        __int32_t               oflags;         /* getbmapx bmv_oflags field */
 
-       vp = BHV_TO_VNODE(bdp);
-       ip = XFS_BHVTOI(bdp);
+       vp = XFS_ITOV(ip);
        mp = ip->i_mount;
 
        whichfork = interface & BMV_IF_ATTRFORK ? XFS_ATTR_FORK : XFS_DATA_FORK;
@@ -5811,10 +5810,9 @@ xfs_getbmap(
         *      could misinterpret holes in a DMAPI file as true holes,
         *      when in fact they may represent offline user data.
         */
-       if (   (interface & BMV_IF_NO_DMAPI_READ) == 0
-           && DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ)
-           && whichfork == XFS_DATA_FORK) {
-
+       if ((interface & BMV_IF_NO_DMAPI_READ) == 0 &&
+           DM_EVENT_ENABLED(ip, DM_EVENT_READ) &&
+           whichfork == XFS_DATA_FORK) {
                error = XFS_SEND_DATA(mp, DM_EVENT_READ, vp, 0, 0, 0, NULL);
                if (error)
                        return XFS_ERROR(error);
@@ -5871,7 +5869,8 @@ xfs_getbmap(
        if (whichfork == XFS_DATA_FORK &&
                (ip->i_delayed_blks || ip->i_size > ip->i_d.di_size)) {
                /* xfs_fsize_t last_byte = xfs_file_last_byte(ip); */
-               error = bhv_vop_flush_pages(vp, (xfs_off_t)0, -1, 0, FI_REMAPF);
+               error = xfs_flush_pages(ip, (xfs_off_t)0,
+                                              -1, 0, FI_REMAPF);
        }
 
        ASSERT(whichfork == XFS_ATTR_FORK || ip->i_delayed_blks == 0);