]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/xfs/xfs_utils.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
[mv-sheeva.git] / fs / xfs / xfs_utils.c
index fefe1d60377fc825eecbf688ede1e2e6a4fce4ed..20ffec308e1e906cd09d661c3a9d409f97b5a8c3 100644 (file)
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
-#include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
 #include "xfs_bmap_btree.h"
-#include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
 #include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
  */
 int
 xfs_get_dir_entry(
-       vname_t         *dentry,
+       bhv_vname_t     *dentry,
        xfs_inode_t     **ipp)
 {
-       vnode_t         *vp;
-       bhv_desc_t      *bdp;
+       bhv_vnode_t     *vp;
 
        vp = VNAME_TO_VNODE(dentry);
-       bdp = vn_bhv_lookup_unlocked(VN_BHV_HEAD(vp), &xfs_vnodeops);
-       if (!bdp) {
-               *ipp = NULL;
+
+       *ipp = xfs_vtoi(vp);
+       if (!*ipp)
                return XFS_ERROR(ENOENT);
-       }
        VN_HOLD(vp);
-       *ipp = XFS_BHVTOI(bdp);
        return 0;
 }
 
@@ -72,11 +67,11 @@ int
 xfs_dir_lookup_int(
        bhv_desc_t      *dir_bdp,
        uint            lock_mode,
-       vname_t         *dentry,
+       bhv_vname_t     *dentry,
        xfs_ino_t       *inum,
        xfs_inode_t     **ipp)
 {
-       vnode_t         *dir_vp;
+       bhv_vnode_t     *dir_vp;
        xfs_inode_t     *dp;
        int             error;
 
@@ -85,8 +80,7 @@ xfs_dir_lookup_int(
 
        dp = XFS_BHVTOI(dir_bdp);
 
-       error = XFS_DIR_LOOKUP(dp->i_mount, NULL, dp,
-                               VNAME(dentry), VNAMELEN(dentry), inum);
+       error = xfs_dir_lookup(NULL, dp, VNAME(dentry), VNAMELEN(dentry), inum);
        if (!error) {
                /*
                 * Unlock the directory. We do this because we can't
@@ -228,7 +222,7 @@ xfs_dir_ialloc(
                }
 
                ntp = xfs_trans_dup(tp);
-               code = xfs_trans_commit(tp, 0, NULL);
+               code = xfs_trans_commit(tp, 0);
                tp = ntp;
                if (committed != NULL) {
                        *committed = 1;
@@ -426,7 +420,11 @@ xfs_truncate_file(
         * in a transaction.
         */
        xfs_ilock(ip, XFS_IOLOCK_EXCL);
-       xfs_itruncate_start(ip, XFS_ITRUNC_DEFINITE, (xfs_fsize_t)0);
+       error = xfs_itruncate_start(ip, XFS_ITRUNC_DEFINITE, (xfs_fsize_t)0);
+       if (error) {
+               xfs_iunlock(ip, XFS_IOLOCK_EXCL);
+               return error;
+       }
 
        tp = xfs_trans_alloc(mp, XFS_TRANS_TRUNCATE_FILE);
        if ((error = xfs_trans_reserve(tp, 0, XFS_ITRUNCATE_LOG_RES(mp), 0,
@@ -466,8 +464,7 @@ xfs_truncate_file(
                                 XFS_TRANS_ABORT);
        } else {
                xfs_ichgtime(ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
-               error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES,
-                                        NULL);
+               error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
        }
        xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);