aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/befs/befs.h6
-rw-r--r--fs/befs/befs_fs_types.h112
-rw-r--r--fs/befs/btree.c29
-rw-r--r--fs/befs/datastream.c11
-rw-r--r--fs/befs/debug.c12
-rw-r--r--fs/befs/endian.h57
-rw-r--r--fs/befs/inode.c1
-rw-r--r--fs/befs/linuxvfs.c1
-rw-r--r--fs/befs/super.c1
-rw-r--r--fs/buffer.c5
-rw-r--r--fs/compat.c2
-rw-r--r--fs/dlm/lowcomms.c6
-rw-r--r--fs/dlm/lowcomms.h2
-rw-r--r--fs/fat/inode.c2
-rw-r--r--fs/hpfs/inode.c11
-rw-r--r--fs/hppfs/hppfs_kern.c2
-rw-r--r--fs/inode.c2
-rw-r--r--fs/isofs/joliet.c10
-rw-r--r--fs/ncpfs/ioctl.c2
-rw-r--r--fs/nfs/client.c24
-rw-r--r--fs/nfsd/nfssvc.c2
-rw-r--r--fs/partitions/msdos.c6
-rw-r--r--fs/proc/proc_misc.c2
-rw-r--r--fs/reiserfs/bitmap.c4
-rw-r--r--fs/udf/super.c3
-rw-r--r--fs/ufs/util.c14
-rw-r--r--fs/xattr.c33
27 files changed, 195 insertions, 167 deletions
diff --git a/fs/befs/befs.h b/fs/befs/befs.h
index 057a2c3d73b7..d9a40abda6b7 100644
--- a/fs/befs/befs.h
+++ b/fs/befs/befs.h
@@ -94,7 +94,7 @@ void befs_debug(const struct super_block *sb, const char *fmt, ...);
94 94
95void befs_dump_super_block(const struct super_block *sb, befs_super_block *); 95void befs_dump_super_block(const struct super_block *sb, befs_super_block *);
96void befs_dump_inode(const struct super_block *sb, befs_inode *); 96void befs_dump_inode(const struct super_block *sb, befs_inode *);
97void befs_dump_index_entry(const struct super_block *sb, befs_btree_super *); 97void befs_dump_index_entry(const struct super_block *sb, befs_disk_btree_super *);
98void befs_dump_index_node(const struct super_block *sb, befs_btree_nodehead *); 98void befs_dump_index_node(const struct super_block *sb, befs_btree_nodehead *);
99/****************************/ 99/****************************/
100 100
@@ -136,7 +136,7 @@ blockno2iaddr(struct super_block *sb, befs_blocknr_t blockno)
136static inline unsigned int 136static inline unsigned int
137befs_iaddrs_per_block(struct super_block *sb) 137befs_iaddrs_per_block(struct super_block *sb)
138{ 138{
139 return BEFS_SB(sb)->block_size / sizeof (befs_inode_addr); 139 return BEFS_SB(sb)->block_size / sizeof (befs_disk_inode_addr);
140} 140}
141 141
142static inline int 142static inline int
@@ -151,4 +151,6 @@ befs_brun_size(struct super_block *sb, befs_block_run run)
151 return BEFS_SB(sb)->block_size * run.len; 151 return BEFS_SB(sb)->block_size * run.len;
152} 152}
153 153
154#include "endian.h"
155
154#endif /* _LINUX_BEFS_H */ 156#endif /* _LINUX_BEFS_H */
diff --git a/fs/befs/befs_fs_types.h b/fs/befs/befs_fs_types.h
index 63ef1e18fb84..e2595c2c403a 100644
--- a/fs/befs/befs_fs_types.h
+++ b/fs/befs/befs_fs_types.h
@@ -79,17 +79,27 @@ enum inode_flags {
79 * On-Disk datastructures of BeFS 79 * On-Disk datastructures of BeFS
80 */ 80 */
81 81
82typedef u64 __bitwise fs64;
83typedef u32 __bitwise fs32;
84typedef u16 __bitwise fs16;
85
82typedef u64 befs_off_t; 86typedef u64 befs_off_t;
83typedef u64 befs_time_t; 87typedef fs64 befs_time_t;
84typedef void befs_binode_etc;
85 88
86/* Block runs */ 89/* Block runs */
87typedef struct { 90typedef struct {
91 fs32 allocation_group;
92 fs16 start;
93 fs16 len;
94} PACKED befs_disk_block_run;
95
96typedef struct {
88 u32 allocation_group; 97 u32 allocation_group;
89 u16 start; 98 u16 start;
90 u16 len; 99 u16 len;
91} PACKED befs_block_run; 100} PACKED befs_block_run;
92 101
102typedef befs_disk_block_run befs_disk_inode_addr;
93typedef befs_block_run befs_inode_addr; 103typedef befs_block_run befs_inode_addr;
94 104
95/* 105/*
@@ -97,31 +107,31 @@ typedef befs_block_run befs_inode_addr;
97 */ 107 */
98typedef struct { 108typedef struct {
99 char name[B_OS_NAME_LENGTH]; 109 char name[B_OS_NAME_LENGTH];
100 u32 magic1; 110 fs32 magic1;
101 u32 fs_byte_order; 111 fs32 fs_byte_order;
102 112
103 u32 block_size; 113 fs32 block_size;
104 u32 block_shift; 114 fs32 block_shift;
105 115
106 befs_off_t num_blocks; 116 fs64 num_blocks;
107 befs_off_t used_blocks; 117 fs64 used_blocks;
108 118
109 u32 inode_size; 119 fs32 inode_size;
110 120
111 u32 magic2; 121 fs32 magic2;
112 u32 blocks_per_ag; 122 fs32 blocks_per_ag;
113 u32 ag_shift; 123 fs32 ag_shift;
114 u32 num_ags; 124 fs32 num_ags;
115 125
116 u32 flags; 126 fs32 flags;
117 127
118 befs_block_run log_blocks; 128 befs_disk_block_run log_blocks;
119 befs_off_t log_start; 129 fs64 log_start;
120 befs_off_t log_end; 130 fs64 log_end;
121 131
122 u32 magic3; 132 fs32 magic3;
123 befs_inode_addr root_dir; 133 befs_disk_inode_addr root_dir;
124 befs_inode_addr indices; 134 befs_disk_inode_addr indices;
125 135
126} PACKED befs_super_block; 136} PACKED befs_super_block;
127 137
@@ -130,6 +140,16 @@ typedef struct {
130 * be longer than one block! 140 * be longer than one block!
131 */ 141 */
132typedef struct { 142typedef struct {
143 befs_disk_block_run direct[BEFS_NUM_DIRECT_BLOCKS];
144 fs64 max_direct_range;
145 befs_disk_block_run indirect;
146 fs64 max_indirect_range;
147 befs_disk_block_run double_indirect;
148 fs64 max_double_indirect_range;
149 fs64 size;
150} PACKED befs_disk_data_stream;
151
152typedef struct {
133 befs_block_run direct[BEFS_NUM_DIRECT_BLOCKS]; 153 befs_block_run direct[BEFS_NUM_DIRECT_BLOCKS];
134 befs_off_t max_direct_range; 154 befs_off_t max_direct_range;
135 befs_block_run indirect; 155 befs_block_run indirect;
@@ -141,35 +161,35 @@ typedef struct {
141 161
142/* Attribute */ 162/* Attribute */
143typedef struct { 163typedef struct {
144 u32 type; 164 fs32 type;
145 u16 name_size; 165 fs16 name_size;
146 u16 data_size; 166 fs16 data_size;
147 char name[1]; 167 char name[1];
148} PACKED befs_small_data; 168} PACKED befs_small_data;
149 169
150/* Inode structure */ 170/* Inode structure */
151typedef struct { 171typedef struct {
152 u32 magic1; 172 fs32 magic1;
153 befs_inode_addr inode_num; 173 befs_disk_inode_addr inode_num;
154 u32 uid; 174 fs32 uid;
155 u32 gid; 175 fs32 gid;
156 u32 mode; 176 fs32 mode;
157 u32 flags; 177 fs32 flags;
158 befs_time_t create_time; 178 befs_time_t create_time;
159 befs_time_t last_modified_time; 179 befs_time_t last_modified_time;
160 befs_inode_addr parent; 180 befs_disk_inode_addr parent;
161 befs_inode_addr attributes; 181 befs_disk_inode_addr attributes;
162 u32 type; 182 fs32 type;
163 183
164 u32 inode_size; 184 fs32 inode_size;
165 u32 etc; /* not use */ 185 fs32 etc; /* not use */
166 186
167 union { 187 union {
168 befs_data_stream datastream; 188 befs_disk_data_stream datastream;
169 char symlink[BEFS_SYMLINK_LEN]; 189 char symlink[BEFS_SYMLINK_LEN];
170 } data; 190 } data;
171 191
172 u32 pad[4]; /* not use */ 192 fs32 pad[4]; /* not use */
173 befs_small_data small_data[1]; 193 befs_small_data small_data[1];
174} PACKED befs_inode; 194} PACKED befs_inode;
175 195
@@ -190,6 +210,16 @@ enum btree_types {
190}; 210};
191 211
192typedef struct { 212typedef struct {
213 fs32 magic;
214 fs32 node_size;
215 fs32 max_depth;
216 fs32 data_type;
217 fs64 root_node_ptr;
218 fs64 free_node_ptr;
219 fs64 max_size;
220} PACKED befs_disk_btree_super;
221
222typedef struct {
193 u32 magic; 223 u32 magic;
194 u32 node_size; 224 u32 node_size;
195 u32 max_depth; 225 u32 max_depth;
@@ -203,11 +233,19 @@ typedef struct {
203 * Header stucture of each btree node 233 * Header stucture of each btree node
204 */ 234 */
205typedef struct { 235typedef struct {
236 fs64 left;
237 fs64 right;
238 fs64 overflow;
239 fs16 all_key_count;
240 fs16 all_key_length;
241} PACKED befs_btree_nodehead;
242
243typedef struct {
206 befs_off_t left; 244 befs_off_t left;
207 befs_off_t right; 245 befs_off_t right;
208 befs_off_t overflow; 246 befs_off_t overflow;
209 u16 all_key_count; 247 u16 all_key_count;
210 u16 all_key_length; 248 u16 all_key_length;
211} PACKED befs_btree_nodehead; 249} PACKED befs_host_btree_nodehead;
212 250
213#endif /* _LINUX_BEFS_FS_TYPES */ 251#endif /* _LINUX_BEFS_FS_TYPES */
diff --git a/fs/befs/btree.c b/fs/befs/btree.c
index 76e219799409..81b042ee24e6 100644
--- a/fs/befs/btree.c
+++ b/fs/befs/btree.c
@@ -30,7 +30,6 @@
30#include "befs.h" 30#include "befs.h"
31#include "btree.h" 31#include "btree.h"
32#include "datastream.h" 32#include "datastream.h"
33#include "endian.h"
34 33
35/* 34/*
36 * The btree functions in this file are built on top of the 35 * The btree functions in this file are built on top of the
@@ -80,7 +79,7 @@
80 * In memory structure of each btree node 79 * In memory structure of each btree node
81 */ 80 */
82typedef struct { 81typedef struct {
83 befs_btree_nodehead head; /* head of node converted to cpu byteorder */ 82 befs_host_btree_nodehead head; /* head of node converted to cpu byteorder */
84 struct buffer_head *bh; 83 struct buffer_head *bh;
85 befs_btree_nodehead *od_node; /* on disk node */ 84 befs_btree_nodehead *od_node; /* on disk node */
86} befs_btree_node; 85} befs_btree_node;
@@ -102,9 +101,9 @@ static int befs_bt_read_node(struct super_block *sb, befs_data_stream * ds,
102 101
103static int befs_leafnode(befs_btree_node * node); 102static int befs_leafnode(befs_btree_node * node);
104 103
105static u16 *befs_bt_keylen_index(befs_btree_node * node); 104static fs16 *befs_bt_keylen_index(befs_btree_node * node);
106 105
107static befs_off_t *befs_bt_valarray(befs_btree_node * node); 106static fs64 *befs_bt_valarray(befs_btree_node * node);
108 107
109static char *befs_bt_keydata(befs_btree_node * node); 108static char *befs_bt_keydata(befs_btree_node * node);
110 109
@@ -136,7 +135,7 @@ befs_bt_read_super(struct super_block *sb, befs_data_stream * ds,
136 befs_btree_super * sup) 135 befs_btree_super * sup)
137{ 136{
138 struct buffer_head *bh = NULL; 137 struct buffer_head *bh = NULL;
139 befs_btree_super *od_sup = NULL; 138 befs_disk_btree_super *od_sup = NULL;
140 139
141 befs_debug(sb, "---> befs_btree_read_super()"); 140 befs_debug(sb, "---> befs_btree_read_super()");
142 141
@@ -146,7 +145,7 @@ befs_bt_read_super(struct super_block *sb, befs_data_stream * ds,
146 befs_error(sb, "Couldn't read index header."); 145 befs_error(sb, "Couldn't read index header.");
147 goto error; 146 goto error;
148 } 147 }
149 od_sup = (befs_btree_super *) bh->b_data; 148 od_sup = (befs_disk_btree_super *) bh->b_data;
150 befs_dump_index_entry(sb, od_sup); 149 befs_dump_index_entry(sb, od_sup);
151 150
152 sup->magic = fs32_to_cpu(sb, od_sup->magic); 151 sup->magic = fs32_to_cpu(sb, od_sup->magic);
@@ -342,7 +341,7 @@ befs_find_key(struct super_block *sb, befs_btree_node * node,
342 u16 keylen; 341 u16 keylen;
343 int findkey_len; 342 int findkey_len;
344 char *thiskey; 343 char *thiskey;
345 befs_off_t *valarray; 344 fs64 *valarray;
346 345
347 befs_debug(sb, "---> befs_find_key() %s", findkey); 346 befs_debug(sb, "---> befs_find_key() %s", findkey);
348 347
@@ -422,7 +421,7 @@ befs_btree_read(struct super_block *sb, befs_data_stream * ds,
422 befs_btree_super bt_super; 421 befs_btree_super bt_super;
423 befs_off_t node_off = 0; 422 befs_off_t node_off = 0;
424 int cur_key; 423 int cur_key;
425 befs_off_t *valarray; 424 fs64 *valarray;
426 char *keystart; 425 char *keystart;
427 u16 keylen; 426 u16 keylen;
428 int res; 427 int res;
@@ -572,7 +571,7 @@ befs_btree_seekleaf(struct super_block *sb, befs_data_stream * ds,
572 this_node->head.overflow); 571 this_node->head.overflow);
573 *node_off = this_node->head.overflow; 572 *node_off = this_node->head.overflow;
574 } else { 573 } else {
575 befs_off_t *valarray = befs_bt_valarray(this_node); 574 fs64 *valarray = befs_bt_valarray(this_node);
576 *node_off = fs64_to_cpu(sb, valarray[0]); 575 *node_off = fs64_to_cpu(sb, valarray[0]);
577 } 576 }
578 if (befs_bt_read_node(sb, ds, this_node, *node_off) != BEFS_OK) { 577 if (befs_bt_read_node(sb, ds, this_node, *node_off) != BEFS_OK) {
@@ -622,7 +621,7 @@ befs_leafnode(befs_btree_node * node)
622 * 621 *
623 * Except that rounding up to 8 works, and rounding up to 4 doesn't. 622 * Except that rounding up to 8 works, and rounding up to 4 doesn't.
624 */ 623 */
625static u16 * 624static fs16 *
626befs_bt_keylen_index(befs_btree_node * node) 625befs_bt_keylen_index(befs_btree_node * node)
627{ 626{
628 const int keylen_align = 8; 627 const int keylen_align = 8;
@@ -633,7 +632,7 @@ befs_bt_keylen_index(befs_btree_node * node)
633 if (tmp) 632 if (tmp)
634 off += keylen_align - tmp; 633 off += keylen_align - tmp;
635 634
636 return (u16 *) ((void *) node->od_node + off); 635 return (fs16 *) ((void *) node->od_node + off);
637} 636}
638 637
639/** 638/**
@@ -643,13 +642,13 @@ befs_bt_keylen_index(befs_btree_node * node)
643 * Returns a pointer to the start of the value array 642 * Returns a pointer to the start of the value array
644 * of the node pointed to by the node header 643 * of the node pointed to by the node header
645 */ 644 */
646static befs_off_t * 645static fs64 *
647befs_bt_valarray(befs_btree_node * node) 646befs_bt_valarray(befs_btree_node * node)
648{ 647{
649 void *keylen_index_start = (void *) befs_bt_keylen_index(node); 648 void *keylen_index_start = (void *) befs_bt_keylen_index(node);
650 size_t keylen_index_size = node->head.all_key_count * sizeof (u16); 649 size_t keylen_index_size = node->head.all_key_count * sizeof (fs16);
651 650
652 return (befs_off_t *) (keylen_index_start + keylen_index_size); 651 return (fs64 *) (keylen_index_start + keylen_index_size);
653} 652}
654 653
655/** 654/**
@@ -681,7 +680,7 @@ befs_bt_get_key(struct super_block *sb, befs_btree_node * node,
681{ 680{
682 int prev_key_end; 681 int prev_key_end;
683 char *keystart; 682 char *keystart;
684 u16 *keylen_index; 683 fs16 *keylen_index;
685 684
686 if (index < 0 || index > node->head.all_key_count) { 685 if (index < 0 || index > node->head.all_key_count) {
687 *keylen = 0; 686 *keylen = 0;
diff --git a/fs/befs/datastream.c b/fs/befs/datastream.c
index b7d6b920f65f..aacb4da6298a 100644
--- a/fs/befs/datastream.c
+++ b/fs/befs/datastream.c
@@ -18,7 +18,6 @@
18#include "befs.h" 18#include "befs.h"
19#include "datastream.h" 19#include "datastream.h"
20#include "io.h" 20#include "io.h"
21#include "endian.h"
22 21
23const befs_inode_addr BAD_IADDR = { 0, 0, 0 }; 22const befs_inode_addr BAD_IADDR = { 0, 0, 0 };
24 23
@@ -312,7 +311,7 @@ befs_find_brun_indirect(struct super_block *sb,
312 befs_blocknr_t indir_start_blk; 311 befs_blocknr_t indir_start_blk;
313 befs_blocknr_t search_blk; 312 befs_blocknr_t search_blk;
314 struct buffer_head *indirblock; 313 struct buffer_head *indirblock;
315 befs_block_run *array; 314 befs_disk_block_run *array;
316 315
317 befs_block_run indirect = data->indirect; 316 befs_block_run indirect = data->indirect;
318 befs_blocknr_t indirblockno = iaddr2blockno(sb, &indirect); 317 befs_blocknr_t indirblockno = iaddr2blockno(sb, &indirect);
@@ -334,7 +333,7 @@ befs_find_brun_indirect(struct super_block *sb,
334 return BEFS_ERR; 333 return BEFS_ERR;
335 } 334 }
336 335
337 array = (befs_block_run *) indirblock->b_data; 336 array = (befs_disk_block_run *) indirblock->b_data;
338 337
339 for (j = 0; j < arraylen; ++j) { 338 for (j = 0; j < arraylen; ++j) {
340 int len = fs16_to_cpu(sb, array[j].len); 339 int len = fs16_to_cpu(sb, array[j].len);
@@ -427,7 +426,7 @@ befs_find_brun_dblindirect(struct super_block *sb,
427 struct buffer_head *dbl_indir_block; 426 struct buffer_head *dbl_indir_block;
428 struct buffer_head *indir_block; 427 struct buffer_head *indir_block;
429 befs_block_run indir_run; 428 befs_block_run indir_run;
430 befs_inode_addr *iaddr_array = NULL; 429 befs_disk_inode_addr *iaddr_array = NULL;
431 befs_sb_info *befs_sb = BEFS_SB(sb); 430 befs_sb_info *befs_sb = BEFS_SB(sb);
432 431
433 befs_blocknr_t indir_start_blk = 432 befs_blocknr_t indir_start_blk =
@@ -482,7 +481,7 @@ befs_find_brun_dblindirect(struct super_block *sb,
482 481
483 dbl_block_indx = 482 dbl_block_indx =
484 dblindir_indx - (dbl_which_block * befs_iaddrs_per_block(sb)); 483 dblindir_indx - (dbl_which_block * befs_iaddrs_per_block(sb));
485 iaddr_array = (befs_inode_addr *) dbl_indir_block->b_data; 484 iaddr_array = (befs_disk_inode_addr *) dbl_indir_block->b_data;
486 indir_run = fsrun_to_cpu(sb, iaddr_array[dbl_block_indx]); 485 indir_run = fsrun_to_cpu(sb, iaddr_array[dbl_block_indx]);
487 brelse(dbl_indir_block); 486 brelse(dbl_indir_block);
488 iaddr_array = NULL; 487 iaddr_array = NULL;
@@ -507,7 +506,7 @@ befs_find_brun_dblindirect(struct super_block *sb,
507 } 506 }
508 507
509 block_indx = indir_indx - (which_block * befs_iaddrs_per_block(sb)); 508 block_indx = indir_indx - (which_block * befs_iaddrs_per_block(sb));
510 iaddr_array = (befs_inode_addr *) indir_block->b_data; 509 iaddr_array = (befs_disk_inode_addr *) indir_block->b_data;
511 *run = fsrun_to_cpu(sb, iaddr_array[block_indx]); 510 *run = fsrun_to_cpu(sb, iaddr_array[block_indx]);
512 brelse(indir_block); 511 brelse(indir_block);
513 iaddr_array = NULL; 512 iaddr_array = NULL;
diff --git a/fs/befs/debug.c b/fs/befs/debug.c
index 875cc0aa318c..e831a8f30849 100644
--- a/fs/befs/debug.c
+++ b/fs/befs/debug.c
@@ -21,7 +21,6 @@
21#endif /* __KERNEL__ */ 21#endif /* __KERNEL__ */
22 22
23#include "befs.h" 23#include "befs.h"
24#include "endian.h"
25 24
26#define ERRBUFSIZE 1024 25#define ERRBUFSIZE 1024
27 26
@@ -125,7 +124,7 @@ befs_dump_inode(const struct super_block *sb, befs_inode * inode)
125 befs_debug(sb, " type %08x", fs32_to_cpu(sb, inode->type)); 124 befs_debug(sb, " type %08x", fs32_to_cpu(sb, inode->type));
126 befs_debug(sb, " inode_size %u", fs32_to_cpu(sb, inode->inode_size)); 125 befs_debug(sb, " inode_size %u", fs32_to_cpu(sb, inode->inode_size));
127 126
128 if (S_ISLNK(inode->mode)) { 127 if (S_ISLNK(fs32_to_cpu(sb, inode->mode))) {
129 befs_debug(sb, " Symbolic link [%s]", inode->data.symlink); 128 befs_debug(sb, " Symbolic link [%s]", inode->data.symlink);
130 } else { 129 } else {
131 int i; 130 int i;
@@ -231,21 +230,20 @@ befs_dump_small_data(const struct super_block *sb, befs_small_data * sd)
231 230
232/* unused */ 231/* unused */
233void 232void
234befs_dump_run(const struct super_block *sb, befs_block_run run) 233befs_dump_run(const struct super_block *sb, befs_disk_block_run run)
235{ 234{
236#ifdef CONFIG_BEFS_DEBUG 235#ifdef CONFIG_BEFS_DEBUG
237 236
238 run = fsrun_to_cpu(sb, run); 237 befs_block_run n = fsrun_to_cpu(sb, run);
239 238
240 befs_debug(sb, "[%u, %hu, %hu]", 239 befs_debug(sb, "[%u, %hu, %hu]", n.allocation_group, n.start, n.len);
241 run.allocation_group, run.start, run.len);
242 240
243#endif //CONFIG_BEFS_DEBUG 241#endif //CONFIG_BEFS_DEBUG
244} 242}
245#endif /* 0 */ 243#endif /* 0 */
246 244
247void 245void
248befs_dump_index_entry(const struct super_block *sb, befs_btree_super * super) 246befs_dump_index_entry(const struct super_block *sb, befs_disk_btree_super * super)
249{ 247{
250#ifdef CONFIG_BEFS_DEBUG 248#ifdef CONFIG_BEFS_DEBUG
251 249
diff --git a/fs/befs/endian.h b/fs/befs/endian.h
index 9ecaea4e3325..e254a20869f4 100644
--- a/fs/befs/endian.h
+++ b/fs/befs/endian.h
@@ -10,85 +10,84 @@
10#define LINUX_BEFS_ENDIAN 10#define LINUX_BEFS_ENDIAN
11 11
12#include <linux/byteorder/generic.h> 12#include <linux/byteorder/generic.h>
13#include "befs.h"
14 13
15static inline u64 14static inline u64
16fs64_to_cpu(const struct super_block *sb, u64 n) 15fs64_to_cpu(const struct super_block *sb, fs64 n)
17{ 16{
18 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) 17 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
19 return le64_to_cpu(n); 18 return le64_to_cpu((__force __le64)n);
20 else 19 else
21 return be64_to_cpu(n); 20 return be64_to_cpu((__force __be64)n);
22} 21}
23 22
24static inline u64 23static inline fs64
25cpu_to_fs64(const struct super_block *sb, u64 n) 24cpu_to_fs64(const struct super_block *sb, u64 n)
26{ 25{
27 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) 26 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
28 return cpu_to_le64(n); 27 return (__force fs64)cpu_to_le64(n);
29 else 28 else
30 return cpu_to_be64(n); 29 return (__force fs64)cpu_to_be64(n);
31} 30}
32 31
33static inline u32 32static inline u32
34fs32_to_cpu(const struct super_block *sb, u32 n) 33fs32_to_cpu(const struct super_block *sb, fs32 n)
35{ 34{
36 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) 35 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
37 return le32_to_cpu(n); 36 return le32_to_cpu((__force __le32)n);
38 else 37 else
39 return be32_to_cpu(n); 38 return be32_to_cpu((__force __be32)n);
40} 39}
41 40
42static inline u32 41static inline fs32
43cpu_to_fs32(const struct super_block *sb, u32 n) 42cpu_to_fs32(const struct super_block *sb, u32 n)
44{ 43{
45 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) 44 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
46 return cpu_to_le32(n); 45 return (__force fs32)cpu_to_le32(n);
47 else 46 else
48 return cpu_to_be32(n); 47 return (__force fs32)cpu_to_be32(n);
49} 48}
50 49
51static inline u16 50static inline u16
52fs16_to_cpu(const struct super_block *sb, u16 n) 51fs16_to_cpu(const struct super_block *sb, fs16 n)
53{ 52{
54 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) 53 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
55 return le16_to_cpu(n); 54 return le16_to_cpu((__force __le16)n);
56 else 55 else
57 return be16_to_cpu(n); 56 return be16_to_cpu((__force __be16)n);
58} 57}
59 58
60static inline u16 59static inline fs16
61cpu_to_fs16(const struct super_block *sb, u16 n) 60cpu_to_fs16(const struct super_block *sb, u16 n)
62{ 61{
63 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) 62 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
64 return cpu_to_le16(n); 63 return (__force fs16)cpu_to_le16(n);
65 else 64 else
66 return cpu_to_be16(n); 65 return (__force fs16)cpu_to_be16(n);
67} 66}
68 67
69/* Composite types below here */ 68/* Composite types below here */
70 69
71static inline befs_block_run 70static inline befs_block_run
72fsrun_to_cpu(const struct super_block *sb, befs_block_run n) 71fsrun_to_cpu(const struct super_block *sb, befs_disk_block_run n)
73{ 72{
74 befs_block_run run; 73 befs_block_run run;
75 74
76 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) { 75 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) {
77 run.allocation_group = le32_to_cpu(n.allocation_group); 76 run.allocation_group = le32_to_cpu((__force __le32)n.allocation_group);
78 run.start = le16_to_cpu(n.start); 77 run.start = le16_to_cpu((__force __le16)n.start);
79 run.len = le16_to_cpu(n.len); 78 run.len = le16_to_cpu((__force __le16)n.len);
80 } else { 79 } else {
81 run.allocation_group = be32_to_cpu(n.allocation_group); 80 run.allocation_group = be32_to_cpu((__force __be32)n.allocation_group);
82 run.start = be16_to_cpu(n.start); 81 run.start = be16_to_cpu((__force __be16)n.start);
83 run.len = be16_to_cpu(n.len); 82 run.len = be16_to_cpu((__force __be16)n.len);
84 } 83 }
85 return run; 84 return run;
86} 85}
87 86
88static inline befs_block_run 87static inline befs_disk_block_run
89cpu_to_fsrun(const struct super_block *sb, befs_block_run n) 88cpu_to_fsrun(const struct super_block *sb, befs_block_run n)
90{ 89{
91 befs_block_run run; 90 befs_disk_block_run run;
92 91
93 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) { 92 if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) {
94 run.allocation_group = cpu_to_le32(n.allocation_group); 93 run.allocation_group = cpu_to_le32(n.allocation_group);
@@ -103,7 +102,7 @@ cpu_to_fsrun(const struct super_block *sb, befs_block_run n)
103} 102}
104 103
105static inline befs_data_stream 104static inline befs_data_stream
106fsds_to_cpu(const struct super_block *sb, befs_data_stream n) 105fsds_to_cpu(const struct super_block *sb, befs_disk_data_stream n)
107{ 106{
108 befs_data_stream data; 107 befs_data_stream data;
109 int i; 108 int i;
diff --git a/fs/befs/inode.c b/fs/befs/inode.c
index d41c9247ae8a..94c17f9a9576 100644
--- a/fs/befs/inode.c
+++ b/fs/befs/inode.c
@@ -8,7 +8,6 @@
8 8
9#include "befs.h" 9#include "befs.h"
10#include "inode.h" 10#include "inode.h"
11#include "endian.h"
12 11
13/* 12/*
14 Validates the correctness of the befs inode 13 Validates the correctness of the befs inode
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 57020c7a7e65..07f7144f0e2e 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -22,7 +22,6 @@
22#include "datastream.h" 22#include "datastream.h"
23#include "super.h" 23#include "super.h"
24#include "io.h" 24#include "io.h"
25#include "endian.h"
26 25
27MODULE_DESCRIPTION("BeOS File System (BeFS) driver"); 26MODULE_DESCRIPTION("BeOS File System (BeFS) driver");
28MODULE_AUTHOR("Will Dyson"); 27MODULE_AUTHOR("Will Dyson");
diff --git a/fs/befs/super.c b/fs/befs/super.c
index 4557acbac528..8c3401ff6d6a 100644
--- a/fs/befs/super.c
+++ b/fs/befs/super.c
@@ -11,7 +11,6 @@
11 11
12#include "befs.h" 12#include "befs.h"
13#include "super.h" 13#include "super.h"
14#include "endian.h"
15 14
16/** 15/**
17 * load_befs_sb -- Read from disk and properly byteswap all the fields 16 * load_befs_sb -- Read from disk and properly byteswap all the fields
diff --git a/fs/buffer.c b/fs/buffer.c
index 16cfbcd254f1..eeb8ac1aa856 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -701,7 +701,10 @@ EXPORT_SYMBOL(mark_buffer_dirty_inode);
701 */ 701 */
702int __set_page_dirty_buffers(struct page *page) 702int __set_page_dirty_buffers(struct page *page)
703{ 703{
704 struct address_space * const mapping = page->mapping; 704 struct address_space * const mapping = page_mapping(page);
705
706 if (unlikely(!mapping))
707 return !TestSetPageDirty(page);
705 708
706 spin_lock(&mapping->private_lock); 709 spin_lock(&mapping->private_lock);
707 if (page_has_buffers(page)) { 710 if (page_has_buffers(page)) {
diff --git a/fs/compat.c b/fs/compat.c
index 4d3fbcb2ddb1..50624d4a70c6 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1316,7 +1316,7 @@ compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32,
1316 unsigned int nr_segs, unsigned int flags) 1316 unsigned int nr_segs, unsigned int flags)
1317{ 1317{
1318 unsigned i; 1318 unsigned i;
1319 struct iovec *iov; 1319 struct iovec __user *iov;
1320 if (nr_segs > UIO_MAXIOV) 1320 if (nr_segs > UIO_MAXIOV)
1321 return -EINVAL; 1321 return -EINVAL;
1322 iov = compat_alloc_user_space(nr_segs * sizeof(struct iovec)); 1322 iov = compat_alloc_user_space(nr_segs * sizeof(struct iovec));
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 23f5ce12080b..7bcea7c5addb 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -174,7 +174,7 @@ static int nodeid_to_addr(int nodeid, struct sockaddr *retaddr)
174 return 0; 174 return 0;
175} 175}
176 176
177static struct nodeinfo *nodeid2nodeinfo(int nodeid, int alloc) 177static struct nodeinfo *nodeid2nodeinfo(int nodeid, gfp_t alloc)
178{ 178{
179 struct nodeinfo *ni; 179 struct nodeinfo *ni;
180 int r; 180 int r;
@@ -726,7 +726,7 @@ static int init_sock(void)
726} 726}
727 727
728 728
729static struct writequeue_entry *new_writequeue_entry(int allocation) 729static struct writequeue_entry *new_writequeue_entry(gfp_t allocation)
730{ 730{
731 struct writequeue_entry *entry; 731 struct writequeue_entry *entry;
732 732
@@ -748,7 +748,7 @@ static struct writequeue_entry *new_writequeue_entry(int allocation)
748 return entry; 748 return entry;
749} 749}
750 750
751void *dlm_lowcomms_get_buffer(int nodeid, int len, int allocation, char **ppc) 751void *dlm_lowcomms_get_buffer(int nodeid, int len, gfp_t allocation, char **ppc)
752{ 752{
753 struct writequeue_entry *e; 753 struct writequeue_entry *e;
754 int offset = 0; 754 int offset = 0;
diff --git a/fs/dlm/lowcomms.h b/fs/dlm/lowcomms.h
index 6c04bb09cfa8..2d045e0daae1 100644
--- a/fs/dlm/lowcomms.h
+++ b/fs/dlm/lowcomms.h
@@ -19,7 +19,7 @@ void dlm_lowcomms_exit(void);
19int dlm_lowcomms_start(void); 19int dlm_lowcomms_start(void);
20void dlm_lowcomms_stop(void); 20void dlm_lowcomms_stop(void);
21int dlm_lowcomms_close(int nodeid); 21int dlm_lowcomms_close(int nodeid);
22void *dlm_lowcomms_get_buffer(int nodeid, int len, int allocation, char **ppc); 22void *dlm_lowcomms_get_buffer(int nodeid, int len, gfp_t allocation, char **ppc);
23void dlm_lowcomms_commit_buffer(void *mh); 23void dlm_lowcomms_commit_buffer(void *mh);
24 24
25#endif /* __LOWCOMMS_DOT_H__ */ 25#endif /* __LOWCOMMS_DOT_H__ */
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 045738032a83..4613cb202170 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -384,7 +384,7 @@ static int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de)
384 le16_to_cpu(de->cdate)) + secs; 384 le16_to_cpu(de->cdate)) + secs;
385 inode->i_ctime.tv_nsec = csecs * 10000000; 385 inode->i_ctime.tv_nsec = csecs * 10000000;
386 inode->i_atime.tv_sec = 386 inode->i_atime.tv_sec =
387 date_dos2unix(le16_to_cpu(0), le16_to_cpu(de->adate)); 387 date_dos2unix(0, le16_to_cpu(de->adate));
388 inode->i_atime.tv_nsec = 0; 388 inode->i_atime.tv_nsec = 0;
389 } else 389 } else
390 inode->i_ctime = inode->i_atime = inode->i_mtime; 390 inode->i_ctime = inode->i_atime = inode->i_mtime;
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c
index bcf6ee36e065..7faef8544f32 100644
--- a/fs/hpfs/inode.c
+++ b/fs/hpfs/inode.c
@@ -60,14 +60,14 @@ void hpfs_read_inode(struct inode *i)
60 if (hpfs_sb(i->i_sb)->sb_eas) { 60 if (hpfs_sb(i->i_sb)->sb_eas) {
61 if ((ea = hpfs_get_ea(i->i_sb, fnode, "UID", &ea_size))) { 61 if ((ea = hpfs_get_ea(i->i_sb, fnode, "UID", &ea_size))) {
62 if (ea_size == 2) { 62 if (ea_size == 2) {
63 i->i_uid = le16_to_cpu(*(u16*)ea); 63 i->i_uid = le16_to_cpu(*(__le16*)ea);
64 hpfs_inode->i_ea_uid = 1; 64 hpfs_inode->i_ea_uid = 1;
65 } 65 }
66 kfree(ea); 66 kfree(ea);
67 } 67 }
68 if ((ea = hpfs_get_ea(i->i_sb, fnode, "GID", &ea_size))) { 68 if ((ea = hpfs_get_ea(i->i_sb, fnode, "GID", &ea_size))) {
69 if (ea_size == 2) { 69 if (ea_size == 2) {
70 i->i_gid = le16_to_cpu(*(u16*)ea); 70 i->i_gid = le16_to_cpu(*(__le16*)ea);
71 hpfs_inode->i_ea_gid = 1; 71 hpfs_inode->i_ea_gid = 1;
72 } 72 }
73 kfree(ea); 73 kfree(ea);
@@ -87,7 +87,7 @@ void hpfs_read_inode(struct inode *i)
87 int rdev = 0; 87 int rdev = 0;
88 umode_t mode = hpfs_sb(sb)->sb_mode; 88 umode_t mode = hpfs_sb(sb)->sb_mode;
89 if (ea_size == 2) { 89 if (ea_size == 2) {
90 mode = le16_to_cpu(*(u16*)ea); 90 mode = le16_to_cpu(*(__le16*)ea);
91 hpfs_inode->i_ea_mode = 1; 91 hpfs_inode->i_ea_mode = 1;
92 } 92 }
93 kfree(ea); 93 kfree(ea);
@@ -95,7 +95,7 @@ void hpfs_read_inode(struct inode *i)
95 if (S_ISBLK(mode) || S_ISCHR(mode)) { 95 if (S_ISBLK(mode) || S_ISCHR(mode)) {
96 if ((ea = hpfs_get_ea(i->i_sb, fnode, "DEV", &ea_size))) { 96 if ((ea = hpfs_get_ea(i->i_sb, fnode, "DEV", &ea_size))) {
97 if (ea_size == 4) 97 if (ea_size == 4)
98 rdev = le32_to_cpu(*(u32*)ea); 98 rdev = le32_to_cpu(*(__le32*)ea);
99 kfree(ea); 99 kfree(ea);
100 } 100 }
101 } 101 }
@@ -148,7 +148,7 @@ static void hpfs_write_inode_ea(struct inode *i, struct fnode *fnode)
148 we'd better not overwrite them 148 we'd better not overwrite them
149 hpfs_error(i->i_sb, "fnode %08x has some unknown HPFS386 stuctures", i->i_ino); 149 hpfs_error(i->i_sb, "fnode %08x has some unknown HPFS386 stuctures", i->i_ino);
150 } else*/ if (hpfs_sb(i->i_sb)->sb_eas >= 2) { 150 } else*/ if (hpfs_sb(i->i_sb)->sb_eas >= 2) {
151 u32 ea; 151 __le32 ea;
152 if ((i->i_uid != hpfs_sb(i->i_sb)->sb_uid) || hpfs_inode->i_ea_uid) { 152 if ((i->i_uid != hpfs_sb(i->i_sb)->sb_uid) || hpfs_inode->i_ea_uid) {
153 ea = cpu_to_le32(i->i_uid); 153 ea = cpu_to_le32(i->i_uid);
154 hpfs_set_ea(i, fnode, "UID", (char*)&ea, 2); 154 hpfs_set_ea(i, fnode, "UID", (char*)&ea, 2);
@@ -165,6 +165,7 @@ static void hpfs_write_inode_ea(struct inode *i, struct fnode *fnode)
165 && i->i_mode != ((hpfs_sb(i->i_sb)->sb_mode & ~(S_ISDIR(i->i_mode) ? 0222 : 0333)) 165 && i->i_mode != ((hpfs_sb(i->i_sb)->sb_mode & ~(S_ISDIR(i->i_mode) ? 0222 : 0333))
166 | (S_ISDIR(i->i_mode) ? S_IFDIR : S_IFREG))) || hpfs_inode->i_ea_mode) { 166 | (S_ISDIR(i->i_mode) ? S_IFDIR : S_IFREG))) || hpfs_inode->i_ea_mode) {
167 ea = cpu_to_le32(i->i_mode); 167 ea = cpu_to_le32(i->i_mode);
168 /* sick, but legal */
168 hpfs_set_ea(i, fnode, "MODE", (char *)&ea, 2); 169 hpfs_set_ea(i, fnode, "MODE", (char *)&ea, 2);
169 hpfs_inode->i_ea_mode = 1; 170 hpfs_inode->i_ea_mode = 1;
170 } 171 }
diff --git a/fs/hppfs/hppfs_kern.c b/fs/hppfs/hppfs_kern.c
index dcb6d2e988b8..642675fc394a 100644
--- a/fs/hppfs/hppfs_kern.c
+++ b/fs/hppfs/hppfs_kern.c
@@ -572,7 +572,7 @@ struct hppfs_dirent {
572}; 572};
573 573
574static int hppfs_filldir(void *d, const char *name, int size, 574static int hppfs_filldir(void *d, const char *name, int size,
575 loff_t offset, ino_t inode, unsigned int type) 575 loff_t offset, u64 inode, unsigned int type)
576{ 576{
577 struct hppfs_dirent *dirent = d; 577 struct hppfs_dirent *dirent = d;
578 578
diff --git a/fs/inode.c b/fs/inode.c
index bf6bec4e54ff..d9a21d122926 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -162,7 +162,7 @@ static struct inode *alloc_inode(struct super_block *sb)
162 bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info; 162 bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info;
163 mapping->backing_dev_info = bdi; 163 mapping->backing_dev_info = bdi;
164 } 164 }
165 inode->i_private = 0; 165 inode->i_private = NULL;
166 inode->i_mapping = mapping; 166 inode->i_mapping = mapping;
167 } 167 }
168 return inode; 168 return inode;
diff --git a/fs/isofs/joliet.c b/fs/isofs/joliet.c
index 81a90e170ac3..fb8fe7a9ddc6 100644
--- a/fs/isofs/joliet.c
+++ b/fs/isofs/joliet.c
@@ -14,9 +14,9 @@
14 * Convert Unicode 16 to UTF-8 or ASCII. 14 * Convert Unicode 16 to UTF-8 or ASCII.
15 */ 15 */
16static int 16static int
17uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls) 17uni16_to_x8(unsigned char *ascii, __be16 *uni, int len, struct nls_table *nls)
18{ 18{
19 wchar_t *ip, ch; 19 __be16 *ip, ch;
20 unsigned char *op; 20 unsigned char *op;
21 21
22 ip = uni; 22 ip = uni;
@@ -24,8 +24,8 @@ uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls)
24 24
25 while ((ch = get_unaligned(ip)) && len) { 25 while ((ch = get_unaligned(ip)) && len) {
26 int llen; 26 int llen;
27 ch = be16_to_cpu(ch); 27 llen = nls->uni2char(be16_to_cpu(ch), op, NLS_MAX_CHARSET_SIZE);
28 if ((llen = nls->uni2char(ch, op, NLS_MAX_CHARSET_SIZE)) > 0) 28 if (llen > 0)
29 op += llen; 29 op += llen;
30 else 30 else
31 *op++ = '?'; 31 *op++ = '?';
@@ -82,7 +82,7 @@ get_joliet_filename(struct iso_directory_record * de, unsigned char *outname, st
82 len = wcsntombs_be(outname, de->name, 82 len = wcsntombs_be(outname, de->name,
83 de->name_len[0] >> 1, PAGE_SIZE); 83 de->name_len[0] >> 1, PAGE_SIZE);
84 } else { 84 } else {
85 len = uni16_to_x8(outname, (u16 *) de->name, 85 len = uni16_to_x8(outname, (__be16 *) de->name,
86 de->name_len[0] >> 1, nls); 86 de->name_len[0] >> 1, nls);
87 } 87 }
88 if ((len > 2) && (outname[len-2] == ';') && (outname[len-1] == '1')) { 88 if ((len > 2) && (outname[len-2] == ';') && (outname[len-1] == '1')) {
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c
index a89ac84a8241..589d1eac55c1 100644
--- a/fs/ncpfs/ioctl.c
+++ b/fs/ncpfs/ioctl.c
@@ -726,7 +726,7 @@ outrel:
726 struct compat_ncp_privatedata_ioctl user32; 726 struct compat_ncp_privatedata_ioctl user32;
727 user32.len = user.len; 727 user32.len = user.len;
728 user32.data = (unsigned long) user.data; 728 user32.data = (unsigned long) user.data;
729 if (copy_to_user(&user32, argp, sizeof(user32))) 729 if (copy_to_user(argp, &user32, sizeof(user32)))
730 return -EFAULT; 730 return -EFAULT;
731 } else 731 } else
732#endif 732#endif
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 6e4e48c5092a..34c3996bd0f5 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -322,25 +322,11 @@ found_client:
322 if (new) 322 if (new)
323 nfs_free_client(new); 323 nfs_free_client(new);
324 324
325 if (clp->cl_cons_state == NFS_CS_INITING) { 325 error = wait_event_interruptible(nfs_client_active_wq,
326 DECLARE_WAITQUEUE(myself, current); 326 clp->cl_cons_state != NFS_CS_INITING);
327 327 if (error < 0) {
328 add_wait_queue(&nfs_client_active_wq, &myself); 328 nfs_put_client(clp);
329 329 return ERR_PTR(-ERESTARTSYS);
330 for (;;) {
331 set_current_state(TASK_INTERRUPTIBLE);
332 if (signal_pending(current) ||
333 clp->cl_cons_state > NFS_CS_READY)
334 break;
335 schedule();
336 }
337
338 remove_wait_queue(&nfs_client_active_wq, &myself);
339
340 if (signal_pending(current)) {
341 nfs_put_client(clp);
342 return ERR_PTR(-ERESTARTSYS);
343 }
344 } 330 }
345 331
346 if (clp->cl_cons_state < NFS_CS_READY) { 332 if (clp->cl_cons_state < NFS_CS_READY) {
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 6fa6340a5fb8..013b38996e64 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -217,7 +217,7 @@ int nfsd_create_serv(void)
217 217
218 atomic_set(&nfsd_busy, 0); 218 atomic_set(&nfsd_busy, 0);
219 nfsd_serv = svc_create_pooled(&nfsd_program, 219 nfsd_serv = svc_create_pooled(&nfsd_program,
220 NFSD_BUFSIZE - NFSSVC_MAXBLKSIZE + nfsd_max_blksize, 220 nfsd_max_blksize,
221 nfsd_last_thread, 221 nfsd_last_thread,
222 nfsd, SIG_NOCLEAN, THIS_MODULE); 222 nfsd, SIG_NOCLEAN, THIS_MODULE);
223 if (nfsd_serv == NULL) 223 if (nfsd_serv == NULL)
diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c
index 4f8df71e49d3..8c7af1777819 100644
--- a/fs/partitions/msdos.c
+++ b/fs/partitions/msdos.c
@@ -32,13 +32,11 @@
32#include <asm/unaligned.h> 32#include <asm/unaligned.h>
33 33
34#define SYS_IND(p) (get_unaligned(&p->sys_ind)) 34#define SYS_IND(p) (get_unaligned(&p->sys_ind))
35#define NR_SECTS(p) ({ __typeof__(p->nr_sects) __a = \ 35#define NR_SECTS(p) ({ __le32 __a = get_unaligned(&p->nr_sects); \
36 get_unaligned(&p->nr_sects); \
37 le32_to_cpu(__a); \ 36 le32_to_cpu(__a); \
38 }) 37 })
39 38
40#define START_SECT(p) ({ __typeof__(p->start_sect) __a = \ 39#define START_SECT(p) ({ __le32 __a = get_unaligned(&p->start_sect); \
41 get_unaligned(&p->start_sect); \
42 le32_to_cpu(__a); \ 40 le32_to_cpu(__a); \
43 }) 41 })
44 42
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 8d88e58ed5cc..93c43b676e59 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -647,7 +647,7 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,
647 647
648 if (get_user(c, buf)) 648 if (get_user(c, buf))
649 return -EFAULT; 649 return -EFAULT;
650 __handle_sysrq(c, NULL, NULL, 0); 650 __handle_sysrq(c, NULL, 0);
651 } 651 }
652 return count; 652 return count;
653} 653}
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index 1bfae42117ca..e3d466a228d4 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -1304,8 +1304,8 @@ struct buffer_head *reiserfs_read_bitmap_block(struct super_block *sb,
1304 1304
1305 bh = sb_bread(sb, block); 1305 bh = sb_bread(sb, block);
1306 if (bh == NULL) 1306 if (bh == NULL)
1307 reiserfs_warning(sb, "sh-2029: %s: bitmap block (#%lu) " 1307 reiserfs_warning(sb, "sh-2029: %s: bitmap block (#%u) "
1308 "reading failed", __FUNCTION__, bh->b_blocknr); 1308 "reading failed", __FUNCTION__, block);
1309 else { 1309 else {
1310 if (buffer_locked(bh)) { 1310 if (buffer_locked(bh)) {
1311 PROC_INFO_INC(sb, scan_bitmap.wait); 1311 PROC_INFO_INC(sb, scan_bitmap.wait);
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 1d3b5d2070e5..1aea6a4f9a4a 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1621,9 +1621,10 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
1621 goto error_out; 1621 goto error_out;
1622 } 1622 }
1623 1623
1624 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_READ_ONLY) 1624 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_READ_ONLY) {
1625 printk("UDF-fs: Partition marked readonly; forcing readonly mount\n"); 1625 printk("UDF-fs: Partition marked readonly; forcing readonly mount\n");
1626 sb->s_flags |= MS_RDONLY; 1626 sb->s_flags |= MS_RDONLY;
1627 }
1627 1628
1628 if ( udf_find_fileset(sb, &fileset, &rootdir) ) 1629 if ( udf_find_fileset(sb, &fileset, &rootdir) )
1629 { 1630 {
diff --git a/fs/ufs/util.c b/fs/ufs/util.c
index 22f820a9b15c..17437574f79c 100644
--- a/fs/ufs/util.c
+++ b/fs/ufs/util.c
@@ -184,14 +184,13 @@ void _ubh_memcpyubh_(struct ufs_sb_private_info * uspi,
184dev_t 184dev_t
185ufs_get_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi) 185ufs_get_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi)
186{ 186{
187 __fs32 fs32; 187 __u32 fs32;
188 dev_t dev; 188 dev_t dev;
189 189
190 if ((UFS_SB(sb)->s_flags & UFS_ST_MASK) == UFS_ST_SUNx86) 190 if ((UFS_SB(sb)->s_flags & UFS_ST_MASK) == UFS_ST_SUNx86)
191 fs32 = ufsi->i_u1.i_data[1]; 191 fs32 = fs32_to_cpu(sb, ufsi->i_u1.i_data[1]);
192 else 192 else
193 fs32 = ufsi->i_u1.i_data[0]; 193 fs32 = fs32_to_cpu(sb, ufsi->i_u1.i_data[0]);
194 fs32 = fs32_to_cpu(sb, fs32);
195 switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { 194 switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
196 case UFS_ST_SUNx86: 195 case UFS_ST_SUNx86:
197 case UFS_ST_SUN: 196 case UFS_ST_SUN:
@@ -212,7 +211,7 @@ ufs_get_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi)
212void 211void
213ufs_set_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi, dev_t dev) 212ufs_set_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi, dev_t dev)
214{ 213{
215 __fs32 fs32; 214 __u32 fs32;
216 215
217 switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { 216 switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
218 case UFS_ST_SUNx86: 217 case UFS_ST_SUNx86:
@@ -227,11 +226,10 @@ ufs_set_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi, dev_t dev
227 fs32 = old_encode_dev(dev); 226 fs32 = old_encode_dev(dev);
228 break; 227 break;
229 } 228 }
230 fs32 = cpu_to_fs32(sb, fs32);
231 if ((UFS_SB(sb)->s_flags & UFS_ST_MASK) == UFS_ST_SUNx86) 229 if ((UFS_SB(sb)->s_flags & UFS_ST_MASK) == UFS_ST_SUNx86)
232 ufsi->i_u1.i_data[1] = fs32; 230 ufsi->i_u1.i_data[1] = cpu_to_fs32(sb, fs32);
233 else 231 else
234 ufsi->i_u1.i_data[0] = fs32; 232 ufsi->i_u1.i_data[0] = cpu_to_fs32(sb, fs32);
235} 233}
236 234
237/** 235/**
diff --git a/fs/xattr.c b/fs/xattr.c
index c32f15b5f60f..395635100f77 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -135,6 +135,26 @@ vfs_getxattr(struct dentry *dentry, char *name, void *value, size_t size)
135} 135}
136EXPORT_SYMBOL_GPL(vfs_getxattr); 136EXPORT_SYMBOL_GPL(vfs_getxattr);
137 137
138ssize_t
139vfs_listxattr(struct dentry *d, char *list, size_t size)
140{
141 ssize_t error;
142
143 error = security_inode_listxattr(d);
144 if (error)
145 return error;
146 error = -EOPNOTSUPP;
147 if (d->d_inode->i_op && d->d_inode->i_op->listxattr) {
148 error = d->d_inode->i_op->listxattr(d, list, size);
149 } else {
150 error = security_inode_listsecurity(d->d_inode, list, size);
151 if (size && error > size)
152 error = -ERANGE;
153 }
154 return error;
155}
156EXPORT_SYMBOL_GPL(vfs_listxattr);
157
138int 158int
139vfs_removexattr(struct dentry *dentry, char *name) 159vfs_removexattr(struct dentry *dentry, char *name)
140{ 160{
@@ -346,17 +366,7 @@ listxattr(struct dentry *d, char __user *list, size_t size)
346 return -ENOMEM; 366 return -ENOMEM;
347 } 367 }
348 368
349 error = security_inode_listxattr(d); 369 error = vfs_listxattr(d, klist, size);
350 if (error)
351 goto out;
352 error = -EOPNOTSUPP;
353 if (d->d_inode->i_op && d->d_inode->i_op->listxattr) {
354 error = d->d_inode->i_op->listxattr(d, klist, size);
355 } else {
356 error = security_inode_listsecurity(d->d_inode, klist, size);
357 if (size && error > size)
358 error = -ERANGE;
359 }
360 if (error > 0) { 370 if (error > 0) {
361 if (size && copy_to_user(list, klist, error)) 371 if (size && copy_to_user(list, klist, error))
362 error = -EFAULT; 372 error = -EFAULT;
@@ -365,7 +375,6 @@ listxattr(struct dentry *d, char __user *list, size_t size)
365 than XATTR_LIST_MAX bytes. Not possible. */ 375 than XATTR_LIST_MAX bytes. Not possible. */
366 error = -E2BIG; 376 error = -E2BIG;
367 } 377 }
368out:
369 kfree(klist); 378 kfree(klist);
370 return error; 379 return error;
371} 380}