X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fxfs%2Fxfs_extfree_item.c;fp=fs%2Fxfs%2Fxfs_extfree_item.c;h=f19282ec8549c13d21cd5a8469ffd9b507c3a8c4;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=6cf6d8769b975902c290a4485372b9b507793aa1;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c index 6cf6d8769..f19282ec8 100644 --- a/fs/xfs/xfs_extfree_item.c +++ b/fs/xfs/xfs_extfree_item.c @@ -23,6 +23,7 @@ #include "xfs_trans.h" #include "xfs_buf_item.h" #include "xfs_sb.h" +#include "xfs_dir.h" #include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_trans_priv.h" @@ -292,62 +293,6 @@ xfs_efi_init(xfs_mount_t *mp, return (efip); } -/* - * Copy an EFI format buffer from the given buf, and into the destination - * EFI format structure. - * The given buffer can be in 32 bit or 64 bit form (which has different padding), - * one of which will be the native format for this kernel. - * It will handle the conversion of formats if necessary. - */ -int -xfs_efi_copy_format(xfs_log_iovec_t *buf, xfs_efi_log_format_t *dst_efi_fmt) -{ - xfs_efi_log_format_t *src_efi_fmt = (xfs_efi_log_format_t *)buf->i_addr; - uint i; - uint len = sizeof(xfs_efi_log_format_t) + - (src_efi_fmt->efi_nextents - 1) * sizeof(xfs_extent_t); - uint len32 = sizeof(xfs_efi_log_format_32_t) + - (src_efi_fmt->efi_nextents - 1) * sizeof(xfs_extent_32_t); - uint len64 = sizeof(xfs_efi_log_format_64_t) + - (src_efi_fmt->efi_nextents - 1) * sizeof(xfs_extent_64_t); - - if (buf->i_len == len) { - memcpy((char *)dst_efi_fmt, (char*)src_efi_fmt, len); - return 0; - } else if (buf->i_len == len32) { - xfs_efi_log_format_32_t *src_efi_fmt_32 = - (xfs_efi_log_format_32_t *)buf->i_addr; - - dst_efi_fmt->efi_type = src_efi_fmt_32->efi_type; - dst_efi_fmt->efi_size = src_efi_fmt_32->efi_size; - dst_efi_fmt->efi_nextents = src_efi_fmt_32->efi_nextents; - dst_efi_fmt->efi_id = src_efi_fmt_32->efi_id; - for (i = 0; i < dst_efi_fmt->efi_nextents; i++) { - dst_efi_fmt->efi_extents[i].ext_start = - src_efi_fmt_32->efi_extents[i].ext_start; - dst_efi_fmt->efi_extents[i].ext_len = - src_efi_fmt_32->efi_extents[i].ext_len; - } - return 0; - } else if (buf->i_len == len64) { - xfs_efi_log_format_64_t *src_efi_fmt_64 = - (xfs_efi_log_format_64_t *)buf->i_addr; - - dst_efi_fmt->efi_type = src_efi_fmt_64->efi_type; - dst_efi_fmt->efi_size = src_efi_fmt_64->efi_size; - dst_efi_fmt->efi_nextents = src_efi_fmt_64->efi_nextents; - dst_efi_fmt->efi_id = src_efi_fmt_64->efi_id; - for (i = 0; i < dst_efi_fmt->efi_nextents; i++) { - dst_efi_fmt->efi_extents[i].ext_start = - src_efi_fmt_64->efi_extents[i].ext_start; - dst_efi_fmt->efi_extents[i].ext_len = - src_efi_fmt_64->efi_extents[i].ext_len; - } - return 0; - } - return EFSCORRUPTED; -} - /* * This is called by the efd item code below to release references to * the given efi item. Each efd calls this with the number of