STATIC int xfs_uuid_mount(xfs_mount_t *);
STATIC void xfs_uuid_unmount(xfs_mount_t *mp);
-void xfs_xlatesb(void *, xfs_sb_t *, int, xfs_arch_t, __int64_t);
-
static struct {
short offset;
short type; /* 0 = integer
return XFS_ERROR(EFSCORRUPTED);
}
+ /*
+ * Version 1 directory format has never worked on Linux.
+ */
+ if (unlikely(!XFS_SB_VERSION_HASDIRV2(sbp))) {
+ cmn_err(CE_WARN,
+ "XFS: Attempted to mount file system using version 1 directory format");
+ return XFS_ERROR(ENOSYS);
+ }
+
/*
* Until this is fixed only page-sized or smaller data blocks work.
*/
* sb - a superblock
* dir - conversion direction: <0 - convert sb to buf
* >0 - convert buf to sb
- * arch - architecture to read/write from/to buf
* fields - which fields to copy (bitmask)
*/
void
void *data,
xfs_sb_t *sb,
int dir,
- xfs_arch_t arch,
__int64_t fields)
{
xfs_caddr_t buf_ptr;
ASSERT(xfs_sb_info[f].type == 0 || xfs_sb_info[f].type == 1);
- if (arch == ARCH_NOCONVERT ||
- size == 1 ||
- xfs_sb_info[f].type == 1) {
+ if (size == 1 || xfs_sb_info[f].type == 1) {
if (dir > 0) {
memcpy(mem_ptr + first, buf_ptr + first, size);
} else {
case 2:
INT_XLATE(*(__uint16_t*)(buf_ptr+first),
*(__uint16_t*)(mem_ptr+first),
- dir, arch);
+ dir, ARCH_CONVERT);
break;
case 4:
INT_XLATE(*(__uint32_t*)(buf_ptr+first),
*(__uint32_t*)(mem_ptr+first),
- dir, arch);
+ dir, ARCH_CONVERT);
break;
case 8:
INT_XLATE(*(__uint64_t*)(buf_ptr+first),
- *(__uint64_t*)(mem_ptr+first), dir, arch);
+ *(__uint64_t*)(mem_ptr+first), dir, ARCH_CONVERT);
break;
default:
ASSERT(0);
* But first do some basic consistency checking.
*/
sbp = XFS_BUF_TO_SBP(bp);
- xfs_xlatesb(XFS_BUF_PTR(bp), &(mp->m_sb), 1,
- ARCH_CONVERT, XFS_SB_ALL_BITS);
+ xfs_xlatesb(XFS_BUF_PTR(bp), &(mp->m_sb), 1, XFS_SB_ALL_BITS);
error = xfs_mount_validate_sb(mp, &(mp->m_sb));
if (error) {
/* translate/copy */
- xfs_xlatesb(XFS_BUF_PTR(bp), &(mp->m_sb), -1, ARCH_CONVERT, fields);
+ xfs_xlatesb(XFS_BUF_PTR(bp), &(mp->m_sb), -1, fields);
/* find modified range */