]> git.hungrycats.org Git - linux/commitdiff
[PATCH] quota endianness annotations
authorAlexander Viro <viro@www.linux.org.uk>
Wed, 6 Oct 2004 00:52:38 +0000 (17:52 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 6 Oct 2004 00:52:38 +0000 (17:52 -0700)
Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/quota_v1.c
fs/quota_v2.c
include/linux/quotaio_v2.h

index 7c7de9102c39c7a301e7a3cfa11b8beec9e6307a..a6cffdab7849c89d01c16930d177efee760c07db 100644 (file)
@@ -115,8 +115,8 @@ out:
 
 /* Header of new quota format */
 struct v2_disk_dqheader {
-       __u32 dqh_magic;        /* Magic number identifying file */
-       __u32 dqh_version;      /* File version */
+       __le32 dqh_magic;        /* Magic number identifying file */
+       __le32 dqh_version;      /* File version */
 };
 
 static int v1_check_quota_file(struct super_block *sb, int type)
index bcbce565cf6c7583ec44acc2d2ae1c9036b4e4fe..e12ca82cee113051ddc8cfc80b2bfa0c0a678515 100644 (file)
@@ -357,7 +357,7 @@ static int do_insert_tree(struct dquot *dquot, uint *treeblk, int depth)
        struct file *filp = sb_dqopt(dquot->dq_sb)->files[dquot->dq_type];
        dqbuf_t buf;
        int ret = 0, newson = 0, newact = 0;
-       u32 *ref;
+       __le32 *ref;
        uint newblk;
 
        if (!(buf = getdqbuf()))
@@ -376,7 +376,7 @@ static int do_insert_tree(struct dquot *dquot, uint *treeblk, int depth)
                        goto out_buf;
                }
        }
-       ref = (u32 *)buf;
+       ref = (__le32 *)buf;
        newblk = le32_to_cpu(ref[GETIDINDEX(dquot->dq_id, depth)]);
        if (!newblk)
                newson = 1;
@@ -510,7 +510,7 @@ static int remove_tree(struct dquot *dquot, uint *blk, int depth)
        dqbuf_t buf = getdqbuf();
        int ret = 0;
        uint newblk;
-       u32 *ref = (u32 *)buf;
+       __le32 *ref = (__le32 *)buf;
        
        if (!buf)
                return -ENOMEM;
@@ -595,7 +595,7 @@ static loff_t find_tree_dqentry(struct dquot *dquot, uint blk, int depth)
        struct file *filp = sb_dqopt(dquot->dq_sb)->files[dquot->dq_type];
        dqbuf_t buf = getdqbuf();
        loff_t ret = 0;
-       u32 *ref = (u32 *)buf;
+       __le32 *ref = (__le32 *)buf;
 
        if (!buf)
                return -ENOMEM;
index f18ced9119393797069d43bc582c2823966649af..303d7cbe30d43530d3a2ee4a16bae4ac2f66b4cc 100644 (file)
  * to blocks of these structures.
  */
 struct v2_disk_dqblk {
-       __u32 dqb_id;           /* id this quota applies to */
-       __u32 dqb_ihardlimit;   /* absolute limit on allocated inodes */
-       __u32 dqb_isoftlimit;   /* preferred inode limit */
-       __u32 dqb_curinodes;    /* current # allocated inodes */
-       __u32 dqb_bhardlimit;   /* absolute limit on disk space (in QUOTABLOCK_SIZE) */
-       __u32 dqb_bsoftlimit;   /* preferred limit on disk space (in QUOTABLOCK_SIZE) */
-       __u64 dqb_curspace;     /* current space occupied (in bytes) */
-       __u64 dqb_btime;        /* time limit for excessive disk use */
-       __u64 dqb_itime;        /* time limit for excessive inode use */
+       __le32 dqb_id;          /* id this quota applies to */
+       __le32 dqb_ihardlimit;  /* absolute limit on allocated inodes */
+       __le32 dqb_isoftlimit;  /* preferred inode limit */
+       __le32 dqb_curinodes;   /* current # allocated inodes */
+       __le32 dqb_bhardlimit;  /* absolute limit on disk space (in QUOTABLOCK_SIZE) */
+       __le32 dqb_bsoftlimit;  /* preferred limit on disk space (in QUOTABLOCK_SIZE) */
+       __le64 dqb_curspace;    /* current space occupied (in bytes) */
+       __le64 dqb_btime;       /* time limit for excessive disk use */
+       __le64 dqb_itime;       /* time limit for excessive inode use */
 };
 
 /*
@@ -43,18 +43,18 @@ struct v2_disk_dqblk {
  */
 /* First generic header */
 struct v2_disk_dqheader {
-       __u32 dqh_magic;        /* Magic number identifying file */
-       __u32 dqh_version;      /* File version */
+       __le32 dqh_magic;       /* Magic number identifying file */
+       __le32 dqh_version;     /* File version */
 };
 
 /* Header with type and version specific information */
 struct v2_disk_dqinfo {
-       __u32 dqi_bgrace;       /* Time before block soft limit becomes hard limit */
-       __u32 dqi_igrace;       /* Time before inode soft limit becomes hard limit */
-       __u32 dqi_flags;        /* Flags for quotafile (DQF_*) */
-       __u32 dqi_blocks;       /* Number of blocks in file */
-       __u32 dqi_free_blk;     /* Number of first free block in the list */
-       __u32 dqi_free_entry;   /* Number of block with at least one free entry */
+       __le32 dqi_bgrace;      /* Time before block soft limit becomes hard limit */
+       __le32 dqi_igrace;      /* Time before inode soft limit becomes hard limit */
+       __le32 dqi_flags;       /* Flags for quotafile (DQF_*) */
+       __le32 dqi_blocks;      /* Number of blocks in file */
+       __le32 dqi_free_blk;    /* Number of first free block in the list */
+       __le32 dqi_free_entry;  /* Number of block with at least one free entry */
 };
 
 /*
@@ -62,11 +62,11 @@ struct v2_disk_dqinfo {
  *  there will be space for exactly 21 quota-entries in a block
  */
 struct v2_disk_dqdbheader {
-       __u32 dqdh_next_free;   /* Number of next block with free entry */
-       __u32 dqdh_prev_free;   /* Number of previous block with free entry */
-       __u16 dqdh_entries;     /* Number of valid entries in block */
-       __u16 dqdh_pad1;
-       __u32 dqdh_pad2;
+       __le32 dqdh_next_free;  /* Number of next block with free entry */
+       __le32 dqdh_prev_free;  /* Number of previous block with free entry */
+       __le16 dqdh_entries;    /* Number of valid entries in block */
+       __le16 dqdh_pad1;
+       __le32 dqdh_pad2;
 };
 
 #define V2_DQINFOOFF   sizeof(struct v2_disk_dqheader) /* Offset of info header in file */