aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/backref.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2011-11-02 15:48:34 -0400
committerChris Mason <chris.mason@oracle.com>2011-11-06 03:08:49 -0500
commit740c3d226cbba6cd6a32adfb66809c94938f3e57 (patch)
tree375a5d2ee3bdc66f29e69e99c3691c3200407820 /fs/btrfs/backref.c
parent806468f8bf76a3cb2b626dd282946a6c9c0a50f0 (diff)
Btrfs: fix the new inspection ioctls for 32 bit compat
The new ioctls to follow backrefs are not clean for 32/64 bit compat. This reworks them for u64s everywhere. They are brand new, so there are no problems with changing the interface now. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/backref.c')
-rw-r--r--fs/btrfs/backref.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 2351df0de450..8855aad3929c 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -676,14 +676,14 @@ static int inode_to_path(u64 inum, struct btrfs_inode_ref *iref,
676 bytes_left = ipath->fspath->bytes_left > s_ptr ? 676 bytes_left = ipath->fspath->bytes_left > s_ptr ?
677 ipath->fspath->bytes_left - s_ptr : 0; 677 ipath->fspath->bytes_left - s_ptr : 0;
678 678
679 fspath_min = (char *)ipath->fspath->str + (i + 1) * s_ptr; 679 fspath_min = (char *)ipath->fspath->val + (i + 1) * s_ptr;
680 fspath = iref_to_path(ipath->fs_root, ipath->btrfs_path, iref, eb, 680 fspath = iref_to_path(ipath->fs_root, ipath->btrfs_path, iref, eb,
681 inum, fspath_min, bytes_left); 681 inum, fspath_min, bytes_left);
682 if (IS_ERR(fspath)) 682 if (IS_ERR(fspath))
683 return PTR_ERR(fspath); 683 return PTR_ERR(fspath);
684 684
685 if (fspath > fspath_min) { 685 if (fspath > fspath_min) {
686 ipath->fspath->str[i] = fspath; 686 ipath->fspath->val[i] = (u64)fspath;
687 ++ipath->fspath->elem_cnt; 687 ++ipath->fspath->elem_cnt;
688 ipath->fspath->bytes_left = fspath - fspath_min; 688 ipath->fspath->bytes_left = fspath - fspath_min;
689 } else { 689 } else {
@@ -698,9 +698,9 @@ static int inode_to_path(u64 inum, struct btrfs_inode_ref *iref,
698/* 698/*
699 * this dumps all file system paths to the inode into the ipath struct, provided 699 * this dumps all file system paths to the inode into the ipath struct, provided
700 * is has been created large enough. each path is zero-terminated and accessed 700 * is has been created large enough. each path is zero-terminated and accessed
701 * from ipath->fspath->str[i]. 701 * from ipath->fspath->val[i].
702 * when it returns, there are ipath->fspath->elem_cnt number of paths available 702 * when it returns, there are ipath->fspath->elem_cnt number of paths available
703 * in ipath->fspath->str[]. when the allocated space wasn't sufficient, the 703 * in ipath->fspath->val[]. when the allocated space wasn't sufficient, the
704 * number of missed paths in recored in ipath->fspath->elem_missed, otherwise, 704 * number of missed paths in recored in ipath->fspath->elem_missed, otherwise,
705 * it's zero. ipath->fspath->bytes_missing holds the number of bytes that would 705 * it's zero. ipath->fspath->bytes_missing holds the number of bytes that would
706 * have been needed to return all paths. 706 * have been needed to return all paths.