diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-10-20 02:28:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-20 13:26:40 -0400 |
commit | 0dbb4c6799cf8fa8c5ba1926153a30960117477d (patch) | |
tree | 9d8f75f2f407a5758fa4ef3d8c03694f138c3304 | |
parent | 8687b63afbe42103730bff4d3f7bfff3463c303e (diff) |
[PATCH] xdr annotations: NFS readdir entries
on-the-wire data is big-endian
[in large part pulled from Alexey's patch]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Acked-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/nfs/dir.c | 6 | ||||
-rw-r--r-- | fs/nfs/internal.h | 6 | ||||
-rw-r--r-- | fs/nfs/nfs2xdr.c | 4 | ||||
-rw-r--r-- | fs/nfs/nfs3xdr.c | 4 | ||||
-rw-r--r-- | fs/nfs/nfs4_fs.h | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 4 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 2 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 2 |
8 files changed, 15 insertions, 15 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index c86a1ead4772..4133ef5264e5 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -142,12 +142,12 @@ nfs_opendir(struct inode *inode, struct file *filp) | |||
142 | return res; | 142 | return res; |
143 | } | 143 | } |
144 | 144 | ||
145 | typedef u32 * (*decode_dirent_t)(u32 *, struct nfs_entry *, int); | 145 | typedef __be32 * (*decode_dirent_t)(__be32 *, struct nfs_entry *, int); |
146 | typedef struct { | 146 | typedef struct { |
147 | struct file *file; | 147 | struct file *file; |
148 | struct page *page; | 148 | struct page *page; |
149 | unsigned long page_index; | 149 | unsigned long page_index; |
150 | u32 *ptr; | 150 | __be32 *ptr; |
151 | u64 *dir_cookie; | 151 | u64 *dir_cookie; |
152 | loff_t current_index; | 152 | loff_t current_index; |
153 | struct nfs_entry *entry; | 153 | struct nfs_entry *entry; |
@@ -220,7 +220,7 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page) | |||
220 | static inline | 220 | static inline |
221 | int dir_decode(nfs_readdir_descriptor_t *desc) | 221 | int dir_decode(nfs_readdir_descriptor_t *desc) |
222 | { | 222 | { |
223 | u32 *p = desc->ptr; | 223 | __be32 *p = desc->ptr; |
224 | p = desc->decode(p, desc->entry, desc->plus); | 224 | p = desc->decode(p, desc->entry, desc->plus); |
225 | if (IS_ERR(p)) | 225 | if (IS_ERR(p)) |
226 | return PTR_ERR(p); | 226 | return PTR_ERR(p); |
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index bea0b016bd70..d205466233f6 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -93,15 +93,15 @@ extern void nfs_destroy_directcache(void); | |||
93 | /* nfs2xdr.c */ | 93 | /* nfs2xdr.c */ |
94 | extern int nfs_stat_to_errno(int); | 94 | extern int nfs_stat_to_errno(int); |
95 | extern struct rpc_procinfo nfs_procedures[]; | 95 | extern struct rpc_procinfo nfs_procedures[]; |
96 | extern u32 * nfs_decode_dirent(u32 *, struct nfs_entry *, int); | 96 | extern __be32 * nfs_decode_dirent(__be32 *, struct nfs_entry *, int); |
97 | 97 | ||
98 | /* nfs3xdr.c */ | 98 | /* nfs3xdr.c */ |
99 | extern struct rpc_procinfo nfs3_procedures[]; | 99 | extern struct rpc_procinfo nfs3_procedures[]; |
100 | extern u32 *nfs3_decode_dirent(u32 *, struct nfs_entry *, int); | 100 | extern __be32 *nfs3_decode_dirent(__be32 *, struct nfs_entry *, int); |
101 | 101 | ||
102 | /* nfs4xdr.c */ | 102 | /* nfs4xdr.c */ |
103 | #ifdef CONFIG_NFS_V4 | 103 | #ifdef CONFIG_NFS_V4 |
104 | extern u32 *nfs4_decode_dirent(u32 *p, struct nfs_entry *entry, int plus); | 104 | extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus); |
105 | #endif | 105 | #endif |
106 | 106 | ||
107 | /* nfs4proc.c */ | 107 | /* nfs4proc.c */ |
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index 1d801e30c40e..3be4e72a0227 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c | |||
@@ -468,8 +468,8 @@ err_unmap: | |||
468 | goto out; | 468 | goto out; |
469 | } | 469 | } |
470 | 470 | ||
471 | u32 * | 471 | __be32 * |
472 | nfs_decode_dirent(u32 *p, struct nfs_entry *entry, int plus) | 472 | nfs_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus) |
473 | { | 473 | { |
474 | if (!*p++) { | 474 | if (!*p++) { |
475 | if (!*p) | 475 | if (!*p) |
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index b4e740e4494a..0ace092d126f 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c | |||
@@ -583,8 +583,8 @@ err_unmap: | |||
583 | goto out; | 583 | goto out; |
584 | } | 584 | } |
585 | 585 | ||
586 | u32 * | 586 | __be32 * |
587 | nfs3_decode_dirent(u32 *p, struct nfs_entry *entry, int plus) | 587 | nfs3_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus) |
588 | { | 588 | { |
589 | struct nfs_entry old = *entry; | 589 | struct nfs_entry old = *entry; |
590 | 590 | ||
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 61095fe4b5ca..6f346677332d 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -212,7 +212,7 @@ extern void nfs_free_seqid(struct nfs_seqid *seqid); | |||
212 | extern const nfs4_stateid zero_stateid; | 212 | extern const nfs4_stateid zero_stateid; |
213 | 213 | ||
214 | /* nfs4xdr.c */ | 214 | /* nfs4xdr.c */ |
215 | extern uint32_t *nfs4_decode_dirent(uint32_t *p, struct nfs_entry *entry, int plus); | 215 | extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus); |
216 | extern struct rpc_procinfo nfs4_procedures[]; | 216 | extern struct rpc_procinfo nfs4_procedures[]; |
217 | 217 | ||
218 | struct nfs4_mount_data; | 218 | struct nfs4_mount_data; |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 7421bcb3b728..8d09b47c91b9 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -141,7 +141,7 @@ const u32 nfs4_fs_locations_bitmap[2] = { | |||
141 | static void nfs4_setup_readdir(u64 cookie, u32 *verifier, struct dentry *dentry, | 141 | static void nfs4_setup_readdir(u64 cookie, u32 *verifier, struct dentry *dentry, |
142 | struct nfs4_readdir_arg *readdir) | 142 | struct nfs4_readdir_arg *readdir) |
143 | { | 143 | { |
144 | u32 *start, *p; | 144 | __be32 *start, *p; |
145 | 145 | ||
146 | BUG_ON(readdir->count < 80); | 146 | BUG_ON(readdir->count < 80); |
147 | if (cookie > 2) { | 147 | if (cookie > 2) { |
@@ -162,7 +162,7 @@ static void nfs4_setup_readdir(u64 cookie, u32 *verifier, struct dentry *dentry, | |||
162 | * when talking to the server, we always send cookie 0 | 162 | * when talking to the server, we always send cookie 0 |
163 | * instead of 1 or 2. | 163 | * instead of 1 or 2. |
164 | */ | 164 | */ |
165 | start = p = (u32 *)kmap_atomic(*readdir->pages, KM_USER0); | 165 | start = p = kmap_atomic(*readdir->pages, KM_USER0); |
166 | 166 | ||
167 | if (cookie == 0) { | 167 | if (cookie == 0) { |
168 | *p++ = xdr_one; /* next */ | 168 | *p++ = xdr_one; /* next */ |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index e284123b9774..0cf3fa312a33 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -4421,7 +4421,7 @@ out: | |||
4421 | return status; | 4421 | return status; |
4422 | } | 4422 | } |
4423 | 4423 | ||
4424 | uint32_t *nfs4_decode_dirent(uint32_t *p, struct nfs_entry *entry, int plus) | 4424 | __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus) |
4425 | { | 4425 | { |
4426 | uint32_t bitmap[2] = {0}; | 4426 | uint32_t bitmap[2] = {0}; |
4427 | uint32_t len; | 4427 | uint32_t len; |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index dc5397d9d23c..ac8058bc8f94 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -811,7 +811,7 @@ struct nfs_rpc_ops { | |||
811 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, | 811 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, |
812 | struct nfs_pathconf *); | 812 | struct nfs_pathconf *); |
813 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); | 813 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); |
814 | u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); | 814 | __be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus); |
815 | void (*read_setup) (struct nfs_read_data *); | 815 | void (*read_setup) (struct nfs_read_data *); |
816 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); | 816 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); |
817 | void (*write_setup) (struct nfs_write_data *, int how); | 817 | void (*write_setup) (struct nfs_write_data *, int how); |