aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-11 04:59:46 -0400
committerJeff Garzik <jeff@garzik.org>2006-10-11 04:59:46 -0400
commit701328a7b58d50d8640c21ba5fdf3170b1ddac16 (patch)
tree99a3fe44310a97e92ad1cb3a01f2ee3f6ed0d59a /fs
parent53e36ada37cb8b01cfbf674580a79edc0bb764c7 (diff)
parent53a5fbdc2dff55161a206ed1a1385a8fa8055c34 (diff)
Merge branch 'master' into upstream-fixes
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/reiserfs/bitmap.c4
-rw-r--r--fs/ufs/util.c14
-rw-r--r--fs/xattr.c33
25 files changed, 192 insertions, 165 deletions
diff --git a/fs/befs/befs.h b/fs/befs/befs.h
index 057a2c3d73b..d9a40abda6b 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, ...);
void befs_dump_super_block(const struct super_block *sb, befs_super_block *);
void befs_dump_inode(const struct super_block *sb, befs_inode *);
-void befs_dump_index_entry(const struct super_block *sb, befs_btree_super *);
+void befs_dump_index_entry(const struct super_block *sb, befs_disk_btree_super *);
void befs_dump_index_node(const struct super_block *sb, befs_btree_nodehead *);
/****************************/
@@ -136,7 +136,7 @@ blockno2iaddr(struct super_block *sb, befs_blocknr_t blockno)
static inline unsigned int
befs_iaddrs_per_block(struct super_block *sb)
{
- return BEFS_SB(sb)->block_size / sizeof (befs_inode_addr);
+ return BEFS_SB(sb)->block_size / sizeof (befs_disk_inode_addr);
}
static inline int
@@ -151,4 +151,6 @@ befs_brun_size(struct super_block *sb, befs_block_run run)
return BEFS_SB(sb)->block_size * run.len;
}
+#include "endian.h"
+
#endif /* _LINUX_BEFS_H */
diff --git a/fs/befs/befs_fs_types.h b/fs/befs/befs_fs_types.h
index 63ef1e18fb8..e2595c2c403 100644
--- a/fs/befs/befs_fs_types.h
+++ b/fs/befs/befs_fs_types.h
@@ -79,17 +79,27 @@ enum inode_flags {
* On-Disk datastructures of BeFS
*/
+typedef u64 __bitwise fs64;
+typedef u32 __bitwise fs32;
+typedef u16 __bitwise fs16;
+
typedef u64 befs_off_t;
-typedef u64 befs_time_t;
-typedef void befs_binode_etc;
+typedef fs64 befs_time_t;
/* Block runs */
typedef struct {
+ fs32 allocation_group;
+ fs16 start;
+ fs16 len;
+} PACKED befs_disk_block_run;
+
+typedef struct {
u32 allocation_group;
u16 start;
u16 len;
} PACKED befs_block_run;
+typedef befs_disk_block_run befs_disk_inode_addr;
typedef befs_block_run befs_inode_addr;
/*
@@ -97,31 +107,31 @@ typedef befs_block_run befs_inode_addr;
*/
typedef struct {
char name[B_OS_NAME_LENGTH];
- u32 magic1;
- u32 fs_byte_order;
+ fs32 magic1;
+ fs32 fs_byte_order;
- u32 block_size;
- u32 block_shift;
+ fs32 block_size;
+ fs32 block_shift;
- befs_off_t num_blocks;
- befs_off_t used_blocks;
+ fs64 num_blocks;
+ fs64 used_blocks;
- u32 inode_size;
+ fs32 inode_size;
- u32 magic2;
- u32 blocks_per_ag;
- u32 ag_shift;
- u32 num_ags;
+ fs32 magic2;
+ fs32 blocks_per_ag;
+ fs32 ag_shift;
+ fs32 num_ags;
- u32 flags;
+ fs32 flags;
- befs_block_run log_blocks;
- befs_off_t log_start;
- befs_off_t log_end;
+ befs_disk_block_run log_blocks;
+ fs64 log_start;
+ fs64 log_end;
- u32 magic3;
- befs_inode_addr root_dir;
- befs_inode_addr indices;
+ fs32 magic3;
+ befs_disk_inode_addr root_dir;
+ befs_disk_inode_addr indices;
} PACKED befs_super_block;
@@ -130,6 +140,16 @@ typedef struct {
* be longer than one block!
*/
typedef struct {
+ befs_disk_block_run direct[BEFS_NUM_DIRECT_BLOCKS];
+ fs64 max_direct_range;
+ befs_disk_block_run indirect;
+ fs64 max_indirect_range;
+ befs_disk_block_run double_indirect;
+ fs64 max_double_indirect_range;
+ fs64 size;
+} PACKED befs_disk_data_stream;
+
+typedef struct {
befs_block_run direct[BEFS_NUM_DIRECT_BLOCKS];
befs_off_t max_direct_range;
befs_block_run indirect;
@@ -141,35 +161,35 @@ typedef struct {
/* Attribute */
typedef struct {
- u32 type;
- u16 name_size;
- u16 data_size;
+ fs32 type;
+ fs16 name_size;
+ fs16 data_size;
char name[1];
} PACKED befs_small_data;
/* Inode structure */
typedef struct {
- u32 magic1;
- befs_inode_addr inode_num;
- u32 uid;
- u32 gid;
- u32 mode;
- u32 flags;
+ fs32 magic1;
+ befs_disk_inode_addr inode_num;
+ fs32 uid;
+ fs32 gid;
+ fs32 mode;
+ fs32 flags;
befs_time_t create_time;
befs_time_t last_modified_time;
- befs_inode_addr parent;
- befs_inode_addr attributes;
- u32 type;
+ befs_disk_inode_addr parent;
+ befs_disk_inode_addr attributes;
+ fs32 type;
- u32 inode_size;
- u32 etc; /* not use */
+ fs32 inode_size;
+ fs32 etc; /* not use */
union {
- befs_data_stream datastream;
+ befs_disk_data_stream datastream;
char symlink[BEFS_SYMLINK_LEN];
} data;
- u32 pad[4]; /* not use */
+ fs32 pad[4]; /* not use */
befs_small_data small_data[1];
} PACKED befs_inode;
@@ -190,6 +210,16 @@ enum btree_types {
};
typedef struct {
+ fs32 magic;
+ fs32 node_size;
+ fs32 max_depth;
+ fs32 data_type;
+ fs64 root_node_ptr;
+ fs64 free_node_ptr;
+ fs64 max_size;
+} PACKED befs_disk_btree_super;
+
+typedef struct {
u32 magic;
u32 node_size;
u32 max_depth;
@@ -203,11 +233,19 @@ typedef struct {
* Header stucture of each btree node
*/
typedef struct {
+ fs64 left;
+ fs64 right;
+ fs64 overflow;
+ fs16 all_key_count;
+ fs16 all_key_length;
+} PACKED befs_btree_nodehead;
+
+typedef struct {
befs_off_t left;
befs_off_t right;
befs_off_t overflow;
u16 all_key_count;
u16 all_key_length;
-} PACKED befs_btree_nodehead;
+} PACKED befs_host_btree_nodehead;
#endif /* _LINUX_BEFS_FS_TYPES */
diff --git a/fs/befs/btree.c b/fs/befs/btree.c
index 76e21979940..81b042ee24e 100644
--- a/fs/befs/btree.c
+++ b/fs/befs/btree.c
@@ -30,7 +30,6 @@
#include "befs.h"
#include "btree.h"
#include "datastream.h"
-#include "endian.h"
/*
* The btree functions in this file are built on top of the
@@ -80,7 +79,7 @@
* In memory structure of each btree node
*/
typedef struct {
- befs_btree_nodehead head; /* head of node converted to cpu byteorder */
+ befs_host_btree_nodehead head; /* head of node converted to cpu byteorder */
struct buffer_head *bh;
befs_btree_nodehead *od_node; /* on disk node */
} befs_btree_node;
@@ -102,9 +101,9 @@ static int befs_bt_read_node(struct super_block *sb, befs_data_stream * ds,
static int befs_leafnode(befs_btree_node * node);
-static u16 *befs_bt_keylen_index(befs_btree_node * node);
+static fs16 *befs_bt_keylen_index(befs_btree_node * node);
-static befs_off_t *befs_bt_valarray(befs_btree_node * node);
+static fs64 *befs_bt_valarray(befs_btree_node * node);
static char *befs_bt_keydata(befs_btree_node * node);
@@ -136,7 +135,7 @@ befs_bt_read_super(struct super_block *sb, befs_data_stream * ds,
befs_btree_super * sup)
{
struct buffer_head *bh = NULL;
- befs_btree_super *od_sup = NULL;
+ befs_disk_btree_super *od_sup = NULL;
befs_debug(sb, "---> befs_btree_read_super()");
@@ -146,7 +145,7 @@ befs_bt_read_super(struct super_block *sb, befs_data_stream * ds,
befs_error(sb, "Couldn't read index header.");
goto error;
}
- od_sup = (befs_btree_super *) bh->b_data;
+ od_sup = (befs_disk_btree_super *) bh->b_data;
befs_dump_index_entry(sb, od_sup);
sup->magic = fs32_to_cpu(sb, od_sup->magic);
@@ -342,7 +341,7 @@ befs_find_key(struct super_block *sb, befs_btree_node * node,
u16 keylen;
int findkey_len;
char *thiskey;
- befs_off_t *valarray;
+ fs64 *valarray;
befs_debug(sb, "---> befs_find_key() %s", findkey);
@@ -422,7 +421,7 @@ befs_btree_read(struct super_block *sb, befs_data_stream * ds,
befs_btree_super bt_super;
befs_off_t node_off = 0;
int cur_key;
- befs_off_t *valarray;
+ fs64 *valarray;
char *keystart;
u16 keylen;
int res;
@@ -572,7 +571,7 @@ befs_btree_seekleaf(struct super_block *sb, befs_data_stream * ds,
this_node->head.overflow);
*node_off = this_node->head.overflow;
} else {
- befs_off_t *valarray = befs_bt_valarray(this_node);
+ fs64 *valarray = befs_bt_valarray(this_node);
*node_off = fs64_to_cpu(sb, valarray[0]);
}
if (befs_bt_read_node(sb, ds, this_node, *node_off) != BEFS_OK) {
@@ -622,7 +621,7 @@ befs_leafnode(befs_btree_node * node)
*
* Except that rounding up to 8 works, and rounding up to 4 doesn't.
*/
-static u16 *
+static fs16 *
befs_bt_keylen_index(befs_btree_node * node)
{
const int keylen_align = 8;
@@ -633,7 +632,7 @@ befs_bt_keylen_index(befs_btree_node * node)
if (tmp)
off += keylen_align - tmp;
- return (u16 *) ((void *) node->od_node + off);
+ return (fs16 *) ((void *) node->od_node + off);
}
/**
@@ -643,13 +642,13 @@ befs_bt_keylen_index(befs_btree_node * node)
* Returns a pointer to the start of the value array
* of the node pointed to by the node header
*/
-static befs_off_t *
+static fs64 *
befs_bt_valarray(befs_btree_node * node)
{
void *keylen_index_start = (void *) befs_bt_keylen_index(node);
- size_t keylen_index_size = node->head.all_key_count * sizeof (u16);
+ size_t keylen_index_size = node->head.all_key_count * sizeof (fs16);
- return (befs_off_t *) (keylen_index_start + keylen_index_size);
+ return (fs64 *) (keylen_index_start + keylen_index_size);
}
/**
@@ -681,7 +680,7 @@ befs_bt_get_key(struct super_block *sb, befs_btree_node * node,
{
int prev_key_end;
char *keystart;
- u16 *keylen_index;
+ fs16 *keylen_index;
if (index < 0 || index > node->head.all_key_count) {
*keylen = 0;
diff --git a/fs/befs/datastream.c b/fs/befs/datastream.c
index b7d6b920f65..aacb4da6298 100644
--- a/fs/befs/datastream.c
+++ b/fs/befs/datastream.c
@@ -18,7 +18,6 @@
#include "befs.h"
#include "datastream.h"
#include "io.h"
-#include "endian.h"
const befs_inode_addr BAD_IADDR = { 0, 0, 0 };
@@ -312,7 +311,7 @@ befs_find_brun_indirect(struct super_block *sb,
befs_blocknr_t indir_start_blk;
befs_blocknr_t search_blk;
struct buffer_head *indirblock;
- befs_block_run *array;
+ befs_disk_block_run *array;
befs_block_run indirect = data->indirect;
befs_blocknr_t indirblockno = iaddr2blockno(sb, &indirect);
@@ -334,7 +333,7 @@ befs_find_brun_indirect(struct super_block *sb,
return BEFS_ERR;
}
- array = (befs_block_run *) indirblock->b_data;
+ array = (befs_disk_block_run *) indirblock->b_data;
for (j = 0; j < arraylen; ++j) {
int len = fs16_to_cpu(sb, array[j].len);
@@ -427,7 +426,7 @@ befs_find_brun_dblindirect(struct super_block *sb,
struct buffer_head *dbl_indir_block;
struct buffer_head *indir_block;
befs_block_run indir_run;
- befs_inode_addr *iaddr_array = NULL;
+ befs_disk_inode_addr *iaddr_array = NULL;
befs_sb_info *befs_sb = BEFS_SB(sb);
befs_blocknr_t indir_start_blk =
@@ -482,7 +481,7 @@ befs_find_brun_dblindirect(struct super_block *sb,
dbl_block_indx =
dblindir_indx - (dbl_which_block * befs_iaddrs_per_block(sb));
- iaddr_array = (befs_inode_addr *) dbl_indir_block->b_data;
+ iaddr_array = (befs_disk_inode_addr *) dbl_indir_block->b_data;
indir_run = fsrun_to_cpu(sb, iaddr_array[dbl_block_indx]);
brelse(dbl_indir_block);
iaddr_array = NULL;
@@ -507,7 +506,7 @@ befs_find_brun_dblindirect(struct super_block *sb,
}
block_indx = indir_indx - (which_block * befs_iaddrs_per_block(sb));
- iaddr_array = (befs_inode_addr *) indir_block->b_data;
+ iaddr_array = (befs_disk_inode_addr *) indir_block->b_data;
*run = fsrun_to_cpu(sb, iaddr_array[block_indx]);
brelse(indir_block);
iaddr_array = NULL;
diff --git a/fs/befs/debug.c b/fs/befs/debug.c
index 875cc0aa318..e831a8f3084 100644
--- a/fs/befs/debug.c
+++ b/fs/befs/debug.c
@@ -21,7 +21,6 @@
#endif /* __KERNEL__ */
#include "befs.h"
-#include "endian.h"
#define ERRBUFSIZE 1024
@@ -125,7 +124,7 @@ befs_dump_inode(const struct super_block *sb, befs_inode * inode)
befs_debug(sb, " type %08x", fs32_to_cpu(sb, inode->type));
befs_debug(sb, " inode_size %u", fs32_to_cpu(sb, inode->inode_size));
- if (S_ISLNK(inode->mode)) {
+ if (S_ISLNK(fs32_to_cpu(sb, inode->mode))) {
befs_debug(sb, " Symbolic link [%s]", inode->data.symlink);
} else {
int i;
@@ -231,21 +230,20 @@ befs_dump_small_data(const struct super_block *sb, befs_small_data * sd)
/* unused */
void
-befs_dump_run(const struct super_block *sb, befs_block_run run)
+befs_dump_run(const struct super_block *sb, befs_disk_block_run run)
{
#ifdef CONFIG_BEFS_DEBUG
- run = fsrun_to_cpu(sb, run);
+ befs_block_run n = fsrun_to_cpu(sb, run);
- befs_debug(sb, "[%u, %hu, %hu]",
- run.allocation_group, run.start, run.len);
+ befs_debug(sb, "[%u, %hu, %hu]", n.allocation_group, n.start, n.len);
#endif //CONFIG_BEFS_DEBUG
}
#endif /* 0 */
void
-befs_dump_index_entry(const struct super_block *sb, befs_btree_super * super)
+befs_dump_index_entry(const struct super_block *sb, befs_disk_btree_super * super)
{
#ifdef CONFIG_BEFS_DEBUG
diff --git a/fs/befs/endian.h b/fs/befs/endian.h
index 9ecaea4e332..e254a20869f 100644
--- a/fs/befs/endian.h
+++ b/fs/befs/endian.h
@@ -10,85 +10,84 @@
#define LINUX_BEFS_ENDIAN
#include <linux/byteorder/generic.h>
-#include "befs.h"
static inline u64
-fs64_to_cpu(const struct super_block *sb, u64 n)
+fs64_to_cpu(const struct super_block *sb, fs64 n)
{
if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
- return le64_to_cpu(n);
+ return le64_to_cpu((__force __le64)n);
else
- return be64_to_cpu(n);
+ return be64_to_cpu((__force __be64)n);
}
-static inline u64
+static inline fs64
cpu_to_fs64(const struct super_block *sb, u64 n)
{
if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
- return cpu_to_le64(n);
+ return (__force fs64)cpu_to_le64(n);
else
- return cpu_to_be64(n);
+ return (__force fs64)cpu_to_be64(n);
}
static inline u32
-fs32_to_cpu(const struct super_block *sb, u32 n)
+fs32_to_cpu(const struct super_block *sb, fs32 n)
{
if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
- return le32_to_cpu(n);
+ return le32_to_cpu((__force __le32)n);
else
- return be32_to_cpu(n);
+ return be32_to_cpu((__force __be32)n);
}
-static inline u32
+static inline fs32
cpu_to_fs32(const struct super_block *sb, u32 n)
{
if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
- return cpu_to_le32(n);
+ return (__force fs32)cpu_to_le32(n);
else
- return cpu_to_be32(n);
+ return (__force fs32)cpu_to_be32(n);
}
static inline u16
-fs16_to_cpu(const struct super_block *sb, u16 n)
+fs16_to_cpu(const struct super_block *sb, fs16 n)
{
if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
- return le16_to_cpu(n);
+ return le16_to_cpu((__force __le16)n);
else
- return be16_to_cpu(n);
+ return be16_to_cpu((__force __be16)n);
}
-static inline u16
+static inline fs16
cpu_to_fs16(const struct super_block *sb, u16 n)
{
if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
- return cpu_to_le16(n);
+ return (__force fs16)cpu_to_le16(n);
else
- return cpu_to_be16(n);
+ return (__force fs16)cpu_to_be16(n);
}
/* Composite types below here */
static inline befs_block_run
-fsrun_to_cpu(const struct super_block *sb, befs_block_run n)
+fsrun_to_cpu(const struct super_block *sb, befs_disk_block_run n)
{
befs_block_run run;
if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) {
- run.allocation_group = le32_to_cpu(n.allocation_group);
- run.start = le16_to_cpu(n.start);
- run.len = le16_to_cpu(n.len);
+ run.allocation_group = le32_to_cpu((__force __le32)n.allocation_group);
+ run.start = le16_to_cpu((__force __le16)n.start);
+ run.len = le16_to_cpu((__force __le16)n.len);
} else {
- run.allocation_group = be32_to_cpu(n.allocation_group);
- run.start = be16_to_cpu(n.start);
- run.len = be16_to_cpu(n.len);
+ run.allocation_group = be32_to_cpu((__force __be32)n.allocation_group);
+ run.start = be16_to_cpu((__force __be16)n.start);
+ run.len = be16_to_cpu((__force __be16)n.len);
}
return run;
}
-static inline befs_block_run
+static inline befs_disk_block_run
cpu_to_fsrun(const struct super_block *sb, befs_block_run n)
{
- befs_block_run run;
+ befs_disk_block_run run;
if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE) {
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)
}
static inline befs_data_stream
-fsds_to_cpu(const struct super_block *sb, befs_data_stream n)
+fsds_to_cpu(const struct super_block *sb, befs_disk_data_stream n)
{
befs_data_stream data;
int i;
diff --git a/fs/befs/inode.c b/fs/befs/inode.c
index d41c9247ae8..94c17f9a957 100644
--- a/fs/befs/inode.c
+++ b/fs/befs/inode.c
@@ -8,7 +8,6 @@
#include "befs.h"
#include "inode.h"
-#include "endian.h"
/*
Validates the correctness of the befs inode
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 57020c7a7e6..07f7144f0e2 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -22,7 +22,6 @@
#include "datastream.h"
#include "super.h"
#include "io.h"
-#include "endian.h"
MODULE_DESCRIPTION("BeOS File System (BeFS) driver");
MODULE_AUTHOR("Will Dyson");
diff --git a/fs/befs/super.c b/fs/befs/super.c
index 4557acbac52..8c3401ff6d6 100644
--- a/fs/befs/super.c
+++ b/fs/befs/super.c
@@ -11,7 +11,6 @@
#include "befs.h"
#include "super.h"
-#include "endian.h"
/**
* load_befs_sb -- Read from disk and properly byteswap all the fields
diff --git a/fs/buffer.c b/fs/buffer.c
index 16cfbcd254f..eeb8ac1aa85 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -701,7 +701,10 @@ EXPORT_SYMBOL(mark_buffer_dirty_inode);
*/
int __set_page_dirty_buffers(struct page *page)
{
- struct address_space * const mapping = page->mapping;
+ struct address_space * const mapping = page_mapping(page);
+
+ if (unlikely(!mapping))
+ return !TestSetPageDirty(page);
spin_lock(&mapping->private_lock);
if (page_has_buffers(page)) {
diff --git a/fs/compat.c b/fs/compat.c
index 4d3fbcb2ddb..50624d4a70c 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1316,7 +1316,7 @@ compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32,
unsigned int nr_segs, unsigned int flags)
{
unsigned i;
- struct iovec *iov;
+ struct iovec __user *iov;
if (nr_segs > UIO_MAXIOV)
return -EINVAL;
iov = compat_alloc_user_space(nr_segs * sizeof(struct iovec));
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 23f5ce12080..7bcea7c5add 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)
return 0;
}
-static struct nodeinfo *nodeid2nodeinfo(int nodeid, int alloc)
+static struct nodeinfo *nodeid2nodeinfo(int nodeid, gfp_t alloc)
{
struct nodeinfo *ni;
int r;
@@ -726,7 +726,7 @@ static int init_sock(void)
}
-static struct writequeue_entry *new_writequeue_entry(int allocation)
+static struct writequeue_entry *new_writequeue_entry(gfp_t allocation)
{
struct writequeue_entry *entry;
@@ -748,7 +748,7 @@ static struct writequeue_entry *new_writequeue_entry(int allocation)
return entry;
}
-void *dlm_lowcomms_get_buffer(int nodeid, int len, int allocation, char **ppc)
+void *dlm_lowcomms_get_buffer(int nodeid, int len, gfp_t allocation, char **ppc)
{
struct writequeue_entry *e;
int offset = 0;
diff --git a/fs/dlm/lowcomms.h b/fs/dlm/lowcomms.h
index 6c04bb09cfa..2d045e0daae 100644
--- a/fs/dlm/lowcomms.h
+++ b/fs/dlm/lowcomms.h
@@ -19,7 +19,7 @@ void dlm_lowcomms_exit(void);
int dlm_lowcomms_start(void);
void dlm_lowcomms_stop(void);
int dlm_lowcomms_close(int nodeid);
-void *dlm_lowcomms_get_buffer(int nodeid, int len, int allocation, char **ppc);
+void *dlm_lowcomms_get_buffer(int nodeid, int len, gfp_t allocation, char **ppc);
void dlm_lowcomms_commit_buffer(void *mh);
#endif /* __LOWCOMMS_DOT_H__ */
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 045738032a8..4613cb20217 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)
le16_to_cpu(de->cdate)) + secs;
inode->i_ctime.tv_nsec = csecs * 10000000;
inode->i_atime.tv_sec =
- date_dos2unix(le16_to_cpu(0), le16_to_cpu(de->adate));
+ date_dos2unix(0, le16_to_cpu(de->adate));
inode->i_atime.tv_nsec = 0;
} else
inode->i_ctime = inode->i_atime = inode->i_mtime;
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c
index bcf6ee36e06..7faef8544f3 100644
--- a/fs/hpfs/inode.c
+++ b/fs/hpfs/inode.c
@@ -60,14 +60,14 @@ void hpfs_read_inode(struct inode *i)
if (hpfs_sb(i->i_sb)->sb_eas) {
if ((ea = hpfs_get_ea(i->i_sb, fnode, "UID", &ea_size))) {
if (ea_size == 2) {
- i->i_uid = le16_to_cpu(*(u16*)ea);
+ i->i_uid = le16_to_cpu(*(__le16*)ea);
hpfs_inode->i_ea_uid = 1;
}
kfree(ea);
}
if ((ea = hpfs_get_ea(i->i_sb, fnode, "GID", &ea_size))) {
if (ea_size == 2) {
- i->i_gid = le16_to_cpu(*(u16*)ea);
+ i->i_gid = le16_to_cpu(*(__le16*)ea);
hpfs_inode->i_ea_gid = 1;
}
kfree(ea);
@@ -87,7 +87,7 @@ void hpfs_read_inode(struct inode *i)
int rdev = 0;
umode_t mode = hpfs_sb(sb)->sb_mode;
if (ea_size == 2) {
- mode = le16_to_cpu(*(u16*)ea);
+ mode = le16_to_cpu(*(__le16*)ea);
hpfs_inode->i_ea_mode = 1;
}
kfree(ea);
@@ -95,7 +95,7 @@ void hpfs_read_inode(struct inode *i)
if (S_ISBLK(mode) || S_ISCHR(mode)) {
if ((ea = hpfs_get_ea(i->i_sb, fnode, "DEV", &ea_size))) {
if (ea_size == 4)
- rdev = le32_to_cpu(*(u32*)ea);
+ rdev = le32_to_cpu(*(__le32*)ea);
kfree(ea);
}
}
@@ -148,7 +148,7 @@ static void hpfs_write_inode_ea(struct inode *i, struct fnode *fnode)
we'd better not overwrite them
hpfs_error(i->i_sb, "fnode %08x has some unknown HPFS386 stuctures", i->i_ino);
} else*/ if (hpfs_sb(i->i_sb)->sb_eas >= 2) {
- u32 ea;
+ __le32 ea;
if ((i->i_uid != hpfs_sb(i->i_sb)->sb_uid) || hpfs_inode->i_ea_uid) {
ea = cpu_to_le32(i->i_uid);
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)
&& i->i_mode != ((hpfs_sb(i->i_sb)->sb_mode & ~(S_ISDIR(i->i_mode) ? 0222 : 0333))
| (S_ISDIR(i->i_mode) ? S_IFDIR : S_IFREG))) || hpfs_inode->i_ea_mode) {
ea = cpu_to_le32(i->i_mode);
+ /* sick, but legal */
hpfs_set_ea(i, fnode, "MODE", (char *)&ea, 2);
hpfs_inode->i_ea_mode = 1;
}
diff --git a/fs/hppfs/hppfs_kern.c b/fs/hppfs/hppfs_kern.c
index dcb6d2e988b..642675fc394 100644
--- a/fs/hppfs/hppfs_kern.c
+++ b/fs/hppfs/hppfs_kern.c
@@ -572,7 +572,7 @@ struct hppfs_dirent {
};
static int hppfs_filldir(void *d, const char *name, int size,
- loff_t offset, ino_t inode, unsigned int type)
+ loff_t offset, u64 inode, unsigned int type)
{
struct hppfs_dirent *dirent = d;
diff --git a/fs/inode.c b/fs/inode.c
index bf6bec4e54f..d9a21d12292 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -162,7 +162,7 @@ static struct inode *alloc_inode(struct super_block *sb)
bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info;
mapping->backing_dev_info = bdi;
}
- inode->i_private = 0;
+ inode->i_private = NULL;
inode->i_mapping = mapping;
}
return inode;
diff --git a/fs/isofs/joliet.c b/fs/isofs/joliet.c
index 81a90e170ac..fb8fe7a9ddc 100644
--- a/fs/isofs/joliet.c
+++ b/fs/isofs/joliet.c
@@ -14,9 +14,9 @@
* Convert Unicode 16 to UTF-8 or ASCII.
*/
static int
-uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls)
+uni16_to_x8(unsigned char *ascii, __be16 *uni, int len, struct nls_table *nls)
{
- wchar_t *ip, ch;
+ __be16 *ip, ch;
unsigned char *op;
ip = uni;
@@ -24,8 +24,8 @@ uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls)
while ((ch = get_unaligned(ip)) && len) {
int llen;
- ch = be16_to_cpu(ch);
- if ((llen = nls->uni2char(ch, op, NLS_MAX_CHARSET_SIZE)) > 0)
+ llen = nls->uni2char(be16_to_cpu(ch), op, NLS_MAX_CHARSET_SIZE);
+ if (llen > 0)
op += llen;
else
*op++ = '?';
@@ -82,7 +82,7 @@ get_joliet_filename(struct iso_directory_record * de, unsigned char *outname, st
len = wcsntombs_be(outname, de->name,
de->name_len[0] >> 1, PAGE_SIZE);
} else {
- len = uni16_to_x8(outname, (u16 *) de->name,
+ len = uni16_to_x8(outname, (__be16 *) de->name,
de->name_len[0] >> 1, nls);
}
if ((len > 2) && (outname[len-2] == ';') && (outname[len-1] == '1')) {
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c
index a89ac84a824..589d1eac55c 100644
--- a/fs/ncpfs/ioctl.c
+++ b/fs/ncpfs/ioctl.c
@@ -726,7 +726,7 @@ outrel:
struct compat_ncp_privatedata_ioctl user32;
user32.len = user.len;
user32.data = (unsigned long) user.data;
- if (copy_to_user(&user32, argp, sizeof(user32)))
+ if (copy_to_user(argp, &user32, sizeof(user32)))
return -EFAULT;
} else
#endif
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 6e4e48c5092..34c3996bd0f 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -322,25 +322,11 @@ found_client:
if (new)
nfs_free_client(new);
- if (clp->cl_cons_state == NFS_CS_INITING) {
- DECLARE_WAITQUEUE(myself, current);
-
- add_wait_queue(&nfs_client_active_wq, &myself);
-
- for (;;) {
- set_current_state(TASK_INTERRUPTIBLE);
- if (signal_pending(current) ||
- clp->cl_cons_state > NFS_CS_READY)
- break;
- schedule();
- }
-
- remove_wait_queue(&nfs_client_active_wq, &myself);
-
- if (signal_pending(current)) {
- nfs_put_client(clp);
- return ERR_PTR(-ERESTARTSYS);
- }
+ error = wait_event_interruptible(nfs_client_active_wq,
+ clp->cl_cons_state != NFS_CS_INITING);
+ if (error < 0) {
+ nfs_put_client(clp);
+ return ERR_PTR(-ERESTARTSYS);
}
if (clp->cl_cons_state < NFS_CS_READY) {
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 6fa6340a5fb..013b38996e6 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -217,7 +217,7 @@ int nfsd_create_serv(void)
atomic_set(&nfsd_busy, 0);
nfsd_serv = svc_create_pooled(&nfsd_program,
- NFSD_BUFSIZE - NFSSVC_MAXBLKSIZE + nfsd_max_blksize,
+ nfsd_max_blksize,
nfsd_last_thread,
nfsd, SIG_NOCLEAN, THIS_MODULE);
if (nfsd_serv == NULL)
diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c
index 4f8df71e49d..8c7af177781 100644
--- a/fs/partitions/msdos.c
+++ b/fs/partitions/msdos.c
@@ -32,13 +32,11 @@
#include <asm/unaligned.h>
#define SYS_IND(p) (get_unaligned(&p->sys_ind))
-#define NR_SECTS(p) ({ __typeof__(p->nr_sects) __a = \
- get_unaligned(&p->nr_sects); \
+#define NR_SECTS(p) ({ __le32 __a = get_unaligned(&p->nr_sects); \
le32_to_cpu(__a); \
})
-#define START_SECT(p) ({ __typeof__(p->start_sect) __a = \
- get_unaligned(&p->start_sect); \
+#define START_SECT(p) ({ __le32 __a = get_unaligned(&p->start_sect); \
le32_to_cpu(__a); \
})
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index 1bfae42117c..e3d466a228d 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,
bh = sb_bread(sb, block);
if (bh == NULL)
- reiserfs_warning(sb, "sh-2029: %s: bitmap block (#%lu) "
- "reading failed", __FUNCTION__, bh->b_blocknr);
+ reiserfs_warning(sb, "sh-2029: %s: bitmap block (#%u) "
+ "reading failed", __FUNCTION__, block);
else {
if (buffer_locked(bh)) {
PROC_INFO_INC(sb, scan_bitmap.wait);
diff --git a/fs/ufs/util.c b/fs/ufs/util.c
index 22f820a9b15..17437574f79 100644
--- a/fs/ufs/util.c
+++ b/fs/ufs/util.c
@@ -184,14 +184,13 @@ void _ubh_memcpyubh_(struct ufs_sb_private_info * uspi,
dev_t
ufs_get_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi)
{
- __fs32 fs32;
+ __u32 fs32;
dev_t dev;
if ((UFS_SB(sb)->s_flags & UFS_ST_MASK) == UFS_ST_SUNx86)
- fs32 = ufsi->i_u1.i_data[1];
+ fs32 = fs32_to_cpu(sb, ufsi->i_u1.i_data[1]);
else
- fs32 = ufsi->i_u1.i_data[0];
- fs32 = fs32_to_cpu(sb, fs32);
+ fs32 = fs32_to_cpu(sb, ufsi->i_u1.i_data[0]);
switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
case UFS_ST_SUNx86:
case UFS_ST_SUN:
@@ -212,7 +211,7 @@ ufs_get_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi)
void
ufs_set_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi, dev_t dev)
{
- __fs32 fs32;
+ __u32 fs32;
switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
case UFS_ST_SUNx86:
@@ -227,11 +226,10 @@ ufs_set_inode_dev(struct super_block *sb, struct ufs_inode_info *ufsi, dev_t dev
fs32 = old_encode_dev(dev);
break;
}
- fs32 = cpu_to_fs32(sb, fs32);
if ((UFS_SB(sb)->s_flags & UFS_ST_MASK) == UFS_ST_SUNx86)
- ufsi->i_u1.i_data[1] = fs32;
+ ufsi->i_u1.i_data[1] = cpu_to_fs32(sb, fs32);
else
- ufsi->i_u1.i_data[0] = fs32;
+ ufsi->i_u1.i_data[0] = cpu_to_fs32(sb, fs32);
}
/**
diff --git a/fs/xattr.c b/fs/xattr.c
index c32f15b5f60..395635100f7 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)
}
EXPORT_SYMBOL_GPL(vfs_getxattr);
+ssize_t
+vfs_listxattr(struct dentry *d, char *list, size_t size)
+{
+ ssize_t error;
+
+ error = security_inode_listxattr(d);
+ if (error)
+ return error;
+ error = -EOPNOTSUPP;
+ if (d->d_inode->i_op && d->d_inode->i_op->listxattr) {
+ error = d->d_inode->i_op->listxattr(d, list, size);
+ } else {
+ error = security_inode_listsecurity(d->d_inode, list, size);
+ if (size && error > size)
+ error = -ERANGE;
+ }
+ return error;
+}
+EXPORT_SYMBOL_GPL(vfs_listxattr);
+
int
vfs_removexattr(struct dentry *dentry, char *name)
{
@@ -346,17 +366,7 @@ listxattr(struct dentry *d, char __user *list, size_t size)
return -ENOMEM;
}
- error = security_inode_listxattr(d);
- if (error)
- goto out;
- error = -EOPNOTSUPP;
- if (d->d_inode->i_op && d->d_inode->i_op->listxattr) {
- error = d->d_inode->i_op->listxattr(d, klist, size);
- } else {
- error = security_inode_listsecurity(d->d_inode, klist, size);
- if (size && error > size)
- error = -ERANGE;
- }
+ error = vfs_listxattr(d, klist, size);
if (error > 0) {
if (size && copy_to_user(list, klist, error))
error = -EFAULT;
@@ -365,7 +375,6 @@ listxattr(struct dentry *d, char __user *list, size_t size)
than XATTR_LIST_MAX bytes. Not possible. */
error = -E2BIG;
}
-out:
kfree(klist);
return error;
}