Commit bfef1166 authored by Richard Russon's avatar Richard Russon

Merge flatcap.org:/home/flatcap/backup/bk/linux-2.6

into flatcap.org:/home/flatcap/backup/bk/ntfs-2.6
parents ca844c33 72bcfa77
......@@ -54,6 +54,7 @@ ToDo/Notes:
- Fix a bug found by the new sparse bitwise warnings where the default
upcase table was defined as a pointer to wchar_t rather than ntfschar
in fs/ntfs/ntfs.h and super.c.
- Change {const_,}cpu_to_le{16,32}(0) to just 0 as suggested by Al Viro.
2.1.18 - Fix scheduling latencies at mount time as well as an endianness bug.
......
......@@ -28,8 +28,7 @@
* The little endian Unicode string $I30 as a global constant.
*/
ntfschar I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'),
const_cpu_to_le16('3'), const_cpu_to_le16('0'),
const_cpu_to_le16(0) };
const_cpu_to_le16('3'), const_cpu_to_le16('0'), 0 };
/**
* ntfs_lookup_inode_by_name - find an inode in a directory given its name
......
......@@ -130,7 +130,7 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na)
if (!ni->name)
return -ENOMEM;
memcpy(ni->name, na->name, i);
ni->name[i] = cpu_to_le16(0);
ni->name[i] = 0;
}
return 0;
}
......
......@@ -143,13 +143,13 @@ typedef le32 NTFS_RECORD_TYPE;
static inline BOOL __ntfs_is_magic(le32 x, NTFS_RECORD_TYPE r)
{
return (x == (__force le32)r);
return (x == r);
}
#define ntfs_is_magic(x, m) __ntfs_is_magic(x, magic_##m)
static inline BOOL __ntfs_is_magicp(le32 *p, NTFS_RECORD_TYPE r)
{
return (*p == (__force le32)r);
return (*p == r);
}
#define ntfs_is_magicp(p, m) __ntfs_is_magicp(p, magic_##m)
......
......@@ -111,10 +111,9 @@ typedef struct {
* These are the so far known RESTART_AREA_* flags (16-bit) which contain
* information about the log file in which they are present.
*/
typedef enum {
RESTART_VOLUME_IS_CLEAN = const_cpu_to_le16(0x0002),
REST_AREA_SPACE_FILLER = 0xffff /* Just to make flags 16-bit. */
} __attribute__ ((__packed__)) RESTART_AREA_FLAGS;
#define RESTART_VOLUME_IS_CLEAN const_cpu_to_le16(0x0002)
typedef le16 RESTART_AREA_FLAGS;
/*
* Log file restart area record. The offset of this record is found by adding
......
......@@ -47,11 +47,11 @@ static void __format_mft_record(MFT_RECORD *m, const int size,
*(le16*)((char*)m + ((sizeof(MFT_RECORD) + 1) & ~1)) = cpu_to_le16(1);
m->lsn = cpu_to_le64(0LL);
m->sequence_number = cpu_to_le16(1);
m->link_count = cpu_to_le16(0);
m->link_count = 0;
/* Aligned to 8-byte boundary. */
m->attrs_offset = cpu_to_le16((le16_to_cpu(m->usa_ofs) +
(le16_to_cpu(m->usa_count) << 1) + 7) & ~7);
m->flags = cpu_to_le16(0);
m->flags = 0;
/*
* Using attrs_offset plus eight bytes (for the termination attribute),
* aligned to 8-byte boundary.
......@@ -60,10 +60,10 @@ static void __format_mft_record(MFT_RECORD *m, const int size,
~7);
m->bytes_allocated = cpu_to_le32(size);
m->base_mft_record = cpu_to_le64((MFT_REF)0);
m->next_attr_instance = cpu_to_le16(0);
m->next_attr_instance = 0;
a = (ATTR_RECORD*)((char*)m + le16_to_cpu(m->attrs_offset));
a->type = AT_END;
a->length = cpu_to_le32(0);
a->length = 0;
}
/**
......
......@@ -1114,9 +1114,9 @@ static BOOL load_and_init_quota(ntfs_volume *vol)
static const ntfschar Quota[7] = { const_cpu_to_le16('$'),
const_cpu_to_le16('Q'), const_cpu_to_le16('u'),
const_cpu_to_le16('o'), const_cpu_to_le16('t'),
const_cpu_to_le16('a'), const_cpu_to_le16(0) };
const_cpu_to_le16('a'), 0 };
static ntfschar Q[3] = { const_cpu_to_le16('$'),
const_cpu_to_le16('Q'), const_cpu_to_le16(0) };
const_cpu_to_le16('Q'), 0 };
ntfs_debug("Entering.");
/*
......
......@@ -276,7 +276,7 @@ int ntfs_nlstoucs(const ntfs_volume *vol, const char *ins,
} /* else (wc_len < 0) */
goto conversion_err;
}
ucs[o] = cpu_to_le16(0);
ucs[o] = 0;
*outs = ucs;
return o;
} /* else (!ucs) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment