Commit 67a385f2 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] ncpfs (6/7): trivial endianness annotations

100% straightforward annotations - from gcc POV no code had been changed.
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 513f36cc
......@@ -174,7 +174,7 @@ ncp_force_unlink(struct inode *dir, struct dentry* dentry)
{
int res=0x9c,res2;
struct nw_modify_dos_info info;
__u32 old_nwattr;
__le32 old_nwattr;
struct inode *inode;
memset(&info, 0, sizeof(info));
......@@ -211,8 +211,8 @@ ncp_force_rename(struct inode *old_dir, struct dentry* old_dentry, char *_old_na
struct nw_modify_dos_info info;
int res=0x90,res2;
struct inode *old_inode = old_dentry->d_inode;
__u32 old_nwattr = NCP_FINFO(old_inode)->nwattr;
__u32 new_nwattr = 0; /* shut compiler warning */
__le32 old_nwattr = NCP_FINFO(old_inode)->nwattr;
__le32 new_nwattr = 0; /* shut compiler warning */
int old_nwattr_changed = 0;
int new_nwattr_changed = 0;
......@@ -766,7 +766,9 @@ int ncp_conn_logged_in(struct super_block *sb)
if (ncp_single_volume(server)) {
int len;
struct dentry* dent;
__u32 volNumber, dirEntNum, DosDirNum;
__u32 volNumber;
__le32 dirEntNum;
__le32 DosDirNum;
__u8 __name[NCP_MAXPATHLEN + 1];
len = sizeof(__name);
......@@ -885,7 +887,7 @@ static int ncp_instantiate(struct inode *dir, struct dentry *dentry,
}
int ncp_create_new(struct inode *dir, struct dentry *dentry, int mode,
dev_t rdev, int attributes)
dev_t rdev, __le32 attributes)
{
struct ncp_server *server = NCP_SERVER(dir);
struct ncp_entry_info finfo;
......
......@@ -792,7 +792,7 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = dentry->d_inode;
int result = 0;
int info_mask;
__le32 info_mask;
struct nw_modify_dos_info info;
struct ncp_server *server;
......
......@@ -299,7 +299,9 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
case NCP_IOC_SETROOT:
{
struct ncp_setroot_ioctl sr;
__u32 vnum, de, dosde;
__u32 vnum;
__le32 de;
__le32 dosde;
struct dentry* dentry;
if (!capable(CAP_SYS_ADMIN))
......
......@@ -29,10 +29,10 @@ static void ncp_add_byte(struct ncp_server *server, __u8 x)
return;
}
static void ncp_add_word(struct ncp_server *server, __u16 x)
static void ncp_add_word(struct ncp_server *server, __le16 x)
{
assert_server_locked(server);
put_unaligned(x, (__u16 *) (&(server->packet[server->current_size])));
put_unaligned(x, (__le16 *) (&(server->packet[server->current_size])));
server->current_size += 2;
return;
}
......@@ -44,10 +44,10 @@ static void ncp_add_be16(struct ncp_server *server, __u16 x)
server->current_size += 2;
}
static void ncp_add_dword(struct ncp_server *server, __u32 x)
static void ncp_add_dword(struct ncp_server *server, __le32 x)
{
assert_server_locked(server);
put_unaligned(x, (__u32 *) (&(server->packet[server->current_size])));
put_unaligned(x, (__le32 *) (&(server->packet[server->current_size])));
server->current_size += 4;
return;
}
......@@ -121,7 +121,7 @@ static __u8
static inline __u16 WVAL_LH(void* data)
{
return le16_to_cpu(get_unaligned((__u16*)data));
return le16_to_cpu(get_unaligned((__le16*)data));
}
static __u16
......@@ -138,13 +138,13 @@ static __u16
static inline __u32 DVAL_LH(void* data)
{
return le32_to_cpu(get_unaligned((__u32*)data));
return le32_to_cpu(get_unaligned((__le32*)data));
}
static __u32
static __le32
ncp_reply_dword(struct ncp_server *server, int offset)
{
return get_unaligned((__u32 *) ncp_reply_data(server, offset));
return get_unaligned((__le32 *) ncp_reply_data(server, offset));
}
static inline __u32 ncp_reply_dword_lh(struct ncp_server* server, int offset) {
......@@ -306,7 +306,7 @@ ncp_make_closed(struct inode *inode)
}
static void ncp_add_handle_path(struct ncp_server *server, __u8 vol_num,
__u32 dir_base, int have_dir_base,
__le32 dir_base, int have_dir_base,
const char *path)
{
ncp_add_byte(server, vol_num);
......@@ -324,7 +324,7 @@ static void ncp_add_handle_path(struct ncp_server *server, __u8 vol_num,
}
}
int ncp_dirhandle_alloc(struct ncp_server* server, __u8 volnum, __u32 dirent,
int ncp_dirhandle_alloc(struct ncp_server* server, __u8 volnum, __le32 dirent,
__u8* dirhandle) {
int result;
......@@ -423,7 +423,7 @@ int ncp_obtain_info(struct ncp_server *server, struct inode *dir, char *path,
struct nw_info_struct *target)
{
__u8 volnum = NCP_FINFO(dir)->volNumber;
__u32 dirent = NCP_FINFO(dir)->dirEntNum;
__le32 dirent = NCP_FINFO(dir)->dirEntNum;
int result;
if (target == NULL) {
......@@ -454,9 +454,9 @@ int ncp_obtain_info(struct ncp_server *server, struct inode *dir, char *path,
#ifdef CONFIG_NCPFS_NFS_NS
static int
ncp_obtain_DOS_dir_base(struct ncp_server *server,
__u8 volnum, __u32 dirent,
__u8 volnum, __le32 dirent,
char *path, /* At most 1 component */
__u32 *DOS_dir_base)
__le32 *DOS_dir_base)
{
int result;
......@@ -527,9 +527,9 @@ ncp_get_known_namespace(struct ncp_server *server, __u8 volume)
static int
ncp_ObtainSpecificDirBase(struct ncp_server *server,
__u8 nsSrc, __u8 nsDst, __u8 vol_num, __u32 dir_base,
__u8 nsSrc, __u8 nsDst, __u8 vol_num, __le32 dir_base,
char *path, /* At most 1 component */
__u32 *dirEntNum, __u32 *DosDirNum)
__le32 *dirEntNum, __le32 *DosDirNum)
{
int result;
......@@ -557,8 +557,8 @@ ncp_ObtainSpecificDirBase(struct ncp_server *server,
int
ncp_mount_subdir(struct ncp_server *server,
__u8 volNumber, __u8 srcNS, __u32 dirEntNum,
__u32* volume, __u32* newDirEnt, __u32* newDosEnt)
__u8 volNumber, __u8 srcNS, __le32 dirEntNum,
__u32* volume, __le32* newDirEnt, __le32* newDosEnt)
{
int dstNS;
int result;
......@@ -578,7 +578,7 @@ ncp_mount_subdir(struct ncp_server *server,
int
ncp_get_volume_root(struct ncp_server *server, const char *volname,
__u32* volume, __u32* dirent, __u32* dosdirent)
__u32* volume, __le32* dirent, __le32* dosdirent)
{
int result;
__u8 volnum;
......@@ -640,11 +640,11 @@ ncp_lookup_volume(struct ncp_server *server, const char *volname,
int ncp_modify_file_or_subdir_dos_info_path(struct ncp_server *server,
struct inode *dir,
const char *path,
__u32 info_mask,
__le32 info_mask,
const struct nw_modify_dos_info *info)
{
__u8 volnum = NCP_FINFO(dir)->volNumber;
__u32 dirent = NCP_FINFO(dir)->dirEntNum;
__le32 dirent = NCP_FINFO(dir)->dirEntNum;
int result;
ncp_init_request(server);
......@@ -664,7 +664,7 @@ int ncp_modify_file_or_subdir_dos_info_path(struct ncp_server *server,
int ncp_modify_file_or_subdir_dos_info(struct ncp_server *server,
struct inode *dir,
__u32 info_mask,
__le32 info_mask,
const struct nw_modify_dos_info *info)
{
return ncp_modify_file_or_subdir_dos_info_path(server, dir, NULL,
......@@ -672,7 +672,7 @@ int ncp_modify_file_or_subdir_dos_info(struct ncp_server *server,
}
#ifdef CONFIG_NCPFS_NFS_NS
int ncp_modify_nfs_info(struct ncp_server *server, __u8 volnum, __u32 dirent,
int ncp_modify_nfs_info(struct ncp_server *server, __u8 volnum, __le32 dirent,
__u32 mode, __u32 rdev)
{
......@@ -701,8 +701,8 @@ int ncp_modify_nfs_info(struct ncp_server *server, __u8 volnum, __u32 dirent,
static int
ncp_DeleteNSEntry(struct ncp_server *server,
__u8 have_dir_base, __u8 volnum, __u32 dirent,
char* name, __u8 ns, int attr)
__u8 have_dir_base, __u8 volnum, __le32 dirent,
char* name, __u8 ns, __le16 attr)
{
int result;
......@@ -724,7 +724,7 @@ ncp_del_file_or_subdir2(struct ncp_server *server,
{
struct inode *inode = dentry->d_inode;
__u8 volnum;
__u32 dirent;
__le32 dirent;
if (!inode) {
#ifdef CONFIG_NCPFS_DEBUGDENTRY
......@@ -742,7 +742,7 @@ ncp_del_file_or_subdir(struct ncp_server *server,
struct inode *dir, char *name)
{
__u8 volnum = NCP_FINFO(dir)->volNumber;
__u32 dirent = NCP_FINFO(dir)->dirEntNum;
__le32 dirent = NCP_FINFO(dir)->dirEntNum;
#ifdef CONFIG_NCPFS_NFS_NS
if (server->name_space[volnum]==NW_NS_NFS)
......@@ -772,13 +772,13 @@ static inline void ConvertToNWfromDWORD(__u16 v0, __u16 v1, __u8 ret[6])
int ncp_open_create_file_or_subdir(struct ncp_server *server,
struct inode *dir, char *name,
int open_create_mode,
__u32 create_attributes,
int desired_acc_rights,
__le32 create_attributes,
__le16 desired_acc_rights,
struct ncp_entry_info *target)
{
__u16 search_attribs = cpu_to_le16(0x0006);
__le16 search_attribs = cpu_to_le16(0x0006);
__u8 volnum;
__u32 dirent;
__le32 dirent;
int result;
volnum = NCP_FINFO(dir)->volNumber;
......@@ -826,7 +826,7 @@ ncp_initialize_search(struct ncp_server *server, struct inode *dir,
struct nw_search_sequence *target)
{
__u8 volnum = NCP_FINFO(dir)->volNumber;
__u32 dirent = NCP_FINFO(dir)->dirEntNum;
__le32 dirent = NCP_FINFO(dir)->dirEntNum;
int result;
ncp_init_request(server);
......@@ -935,7 +935,7 @@ int ncp_search_for_fileset(struct ncp_server *server,
int
ncp_RenameNSEntry(struct ncp_server *server,
struct inode *old_dir, char *old_name, int old_type,
struct inode *old_dir, char *old_name, __le16 old_type,
struct inode *new_dir, char *new_name)
{
int result = -EINVAL;
......@@ -978,7 +978,7 @@ int ncp_ren_or_mov_file_or_subdir(struct ncp_server *server,
struct inode *new_dir, char *new_name)
{
int result;
int old_type = cpu_to_le16(0x06);
__le16 old_type = cpu_to_le16(0x06);
/* If somebody can do it atomic, call me... vandrove@vc.cvut.cz */
result = ncp_RenameNSEntry(server, old_dir, old_name, old_type,
......@@ -1050,7 +1050,7 @@ ncp_read_bounce(struct ncp_server *server, const char *file_id,
result = ncp_request2(server, 72, bounce, bufsize);
ncp_unlock_server(server);
if (!result) {
int len = be16_to_cpu(get_unaligned((__u16*)((char*)bounce +
int len = be16_to_cpu(get_unaligned((__be16*)((char*)bounce +
sizeof(struct ncp_reply_header))));
result = -EIO;
if (len <= to_read) {
......
......@@ -71,19 +71,19 @@ int ncp_obtain_info(struct ncp_server *server, struct inode *, char *,
struct nw_info_struct *target);
int ncp_obtain_nfs_info(struct ncp_server *server, struct nw_info_struct *target);
int ncp_get_volume_root(struct ncp_server *server, const char *volname,
__u32 *volume, __u32 *dirent, __u32 *dosdirent);
__u32 *volume, __le32 *dirent, __le32 *dosdirent);
int ncp_lookup_volume(struct ncp_server *, const char *, struct nw_info_struct *);
int ncp_modify_file_or_subdir_dos_info(struct ncp_server *, struct inode *,
__u32, const struct nw_modify_dos_info *info);
__le32, const struct nw_modify_dos_info *info);
int ncp_modify_file_or_subdir_dos_info_path(struct ncp_server *, struct inode *,
const char* path, __u32, const struct nw_modify_dos_info *info);
int ncp_modify_nfs_info(struct ncp_server *, __u8 volnum, __u32 dirent,
const char* path, __le32, const struct nw_modify_dos_info *info);
int ncp_modify_nfs_info(struct ncp_server *, __u8 volnum, __le32 dirent,
__u32 mode, __u32 rdev);
int ncp_del_file_or_subdir2(struct ncp_server *, struct dentry*);
int ncp_del_file_or_subdir(struct ncp_server *, struct inode *, char *);
int ncp_open_create_file_or_subdir(struct ncp_server *, struct inode *, char *,
int, __u32, int, struct ncp_entry_info *);
int, __le32, __le16, struct ncp_entry_info *);
int ncp_initialize_search(struct ncp_server *, struct inode *,
struct nw_search_sequence *target);
......@@ -113,13 +113,13 @@ ncp_ClearPhysicalRecord(struct ncp_server *server,
#endif /* CONFIG_NCPFS_IOCTL_LOCKING */
int
ncp_mount_subdir(struct ncp_server *, __u8, __u8, __u32,
__u32* volume, __u32* dirent, __u32* dosdirent);
int ncp_dirhandle_alloc(struct ncp_server *, __u8 vol, __u32 dirent, __u8 *dirhandle);
ncp_mount_subdir(struct ncp_server *, __u8, __u8, __le32,
__u32* volume, __le32* dirent, __le32* dosdirent);
int ncp_dirhandle_alloc(struct ncp_server *, __u8 vol, __le32 dirent, __u8 *dirhandle);
int ncp_dirhandle_free(struct ncp_server *, __u8 dirhandle);
int ncp_create_new(struct inode *dir, struct dentry *dentry,
int mode, dev_t rdev, int attributes);
int mode, dev_t rdev, __le32 attributes);
static inline int ncp_is_nfs_extras(struct ncp_server* server, unsigned int volnum) {
#ifdef CONFIG_NCPFS_NFS_NS
......
......@@ -337,7 +337,7 @@ static void info_server(struct ncp_server *server, unsigned int id, const void *
{
if (server->info_sock) {
struct kvec iov[2];
__u32 hdr[2];
__be32 hdr[2];
hdr[0] = cpu_to_be32(len + 8);
hdr[1] = cpu_to_be32(id);
......
......@@ -67,8 +67,8 @@ static int ncp_symlink_readpage(struct file *file, struct page *page)
if (NCP_FINFO(inode)->flags & NCPI_KLUDGE_SYMLINK) {
if (length<NCP_MIN_SYMLINK_SIZE ||
((__u32 *)rawlink)[0]!=NCP_SYMLINK_MAGIC0 ||
((__u32 *)rawlink)[1]!=NCP_SYMLINK_MAGIC1)
((__le32 *)rawlink)[0]!=NCP_SYMLINK_MAGIC0 ||
((__le32 *)rawlink)[1]!=NCP_SYMLINK_MAGIC1)
goto failEIO;
link = rawlink + 8;
length -= 8;
......@@ -110,7 +110,8 @@ int ncp_symlink(struct inode *dir, struct dentry *dentry, const char *symname) {
char *rawlink;
int length, err, i, outlen;
int kludge;
int mode, attr;
int mode;
__le32 attr;
unsigned int hdr;
DPRINTK("ncp_symlink(dir=%p,dentry=%p,symname=%s)\n",dir,dentry,symname);
......@@ -133,8 +134,8 @@ int ncp_symlink(struct inode *dir, struct dentry *dentry, const char *symname) {
if (kludge) {
mode = 0;
attr = aSHARED | aHIDDEN;
((__u32 *)rawlink)[0]=NCP_SYMLINK_MAGIC0;
((__u32 *)rawlink)[1]=NCP_SYMLINK_MAGIC1;
((__le32 *)rawlink)[0]=NCP_SYMLINK_MAGIC0;
((__le32 *)rawlink)[1]=NCP_SYMLINK_MAGIC1;
hdr = 8;
} else {
mode = S_IFLNK | S_IRWXUGO;
......
......@@ -129,24 +129,24 @@ struct nw_nfs_info {
struct nw_info_struct {
__u32 spaceAlloc __attribute__((packed));
__u32 attributes __attribute__((packed));
__le32 attributes __attribute__((packed));
__u16 flags __attribute__((packed));
__u32 dataStreamSize __attribute__((packed));
__u32 totalStreamSize __attribute__((packed));
__le32 dataStreamSize __attribute__((packed));
__le32 totalStreamSize __attribute__((packed));
__u16 numberOfStreams __attribute__((packed));
__u16 creationTime __attribute__((packed));
__u16 creationDate __attribute__((packed));
__le16 creationTime __attribute__((packed));
__le16 creationDate __attribute__((packed));
__u32 creatorID __attribute__((packed));
__u16 modifyTime __attribute__((packed));
__u16 modifyDate __attribute__((packed));
__le16 modifyTime __attribute__((packed));
__le16 modifyDate __attribute__((packed));
__u32 modifierID __attribute__((packed));
__u16 lastAccessDate __attribute__((packed));
__le16 lastAccessDate __attribute__((packed));
__u16 archiveTime __attribute__((packed));
__u16 archiveDate __attribute__((packed));
__u32 archiverID __attribute__((packed));
__u16 inheritedRightsMask __attribute__((packed));
__u32 dirEntNum __attribute__((packed));
__u32 DosDirNum __attribute__((packed));
__le32 dirEntNum __attribute__((packed));
__le32 DosDirNum __attribute__((packed));
__u32 volNumber __attribute__((packed));
__u32 EADataSize __attribute__((packed));
__u32 EAKeyCount __attribute__((packed));
......@@ -176,17 +176,17 @@ struct nw_info_struct {
#define DM_MAXIMUM_SPACE (cpu_to_le32(0x2000))
struct nw_modify_dos_info {
__u32 attributes __attribute__((packed));
__u16 creationDate __attribute__((packed));
__u16 creationTime __attribute__((packed));
__le32 attributes __attribute__((packed));
__le16 creationDate __attribute__((packed));
__le16 creationTime __attribute__((packed));
__u32 creatorID __attribute__((packed));
__u16 modifyDate __attribute__((packed));
__u16 modifyTime __attribute__((packed));
__le16 modifyDate __attribute__((packed));
__le16 modifyTime __attribute__((packed));
__u32 modifierID __attribute__((packed));
__u16 archiveDate __attribute__((packed));
__u16 archiveTime __attribute__((packed));
__u32 archiverID __attribute__((packed));
__u16 lastAccessDate __attribute__((packed));
__le16 lastAccessDate __attribute__((packed));
__u16 inheritanceGrantMask __attribute__((packed));
__u16 inheritanceRevokeMask __attribute__((packed));
__u32 maximumSpace __attribute__((packed));
......
......@@ -36,7 +36,7 @@ struct ncp_fs_info {
used for read/write requests! */
int volume_number;
__u32 directory_id;
__le32 directory_id;
};
struct ncp_fs_info_v2 {
......@@ -46,7 +46,7 @@ struct ncp_fs_info_v2 {
unsigned int buffer_size;
unsigned int volume_number;
__u32 directory_id;
__le32 directory_id;
__u32 dummy1;
__u32 dummy2;
......@@ -78,7 +78,7 @@ struct ncp_setroot_ioctl
{
int volNumber;
int namespace;
__u32 dirEntNum;
__le32 dirEntNum;
};
struct ncp_objectname_ioctl
......
......@@ -15,10 +15,10 @@
* all the information we need to work with an inode after creation.
*/
struct ncp_inode_info {
__u32 dirEntNum;
__u32 DosDirNum;
__u32 volNumber;
__u32 nwattr;
__le32 dirEntNum;
__le32 DosDirNum;
__u8 volNumber;
__le32 nwattr;
struct semaphore open_sem;
atomic_t opened;
int access;
......
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