aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-10-20 02:28:49 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-20 13:26:40 -0400
commit0dbb4c6799cf8fa8c5ba1926153a30960117477d (patch)
tree9d8f75f2f407a5758fa4ef3d8c03694f138c3304 /fs
parent8687b63afbe42103730bff4d3f7bfff3463c303e (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>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/dir.c6
-rw-r--r--fs/nfs/internal.h6
-rw-r--r--fs/nfs/nfs2xdr.c4
-rw-r--r--fs/nfs/nfs3xdr.c4
-rw-r--r--fs/nfs/nfs4_fs.h2
-rw-r--r--fs/nfs/nfs4proc.c4
-rw-r--r--fs/nfs/nfs4xdr.c2
7 files changed, 14 insertions, 14 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
145typedef u32 * (*decode_dirent_t)(u32 *, struct nfs_entry *, int); 145typedef __be32 * (*decode_dirent_t)(__be32 *, struct nfs_entry *, int);
146typedef struct { 146typedef 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)
220static inline 220static inline
221int dir_decode(nfs_readdir_descriptor_t *desc) 221int 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 */
94extern int nfs_stat_to_errno(int); 94extern int nfs_stat_to_errno(int);
95extern struct rpc_procinfo nfs_procedures[]; 95extern struct rpc_procinfo nfs_procedures[];
96extern u32 * nfs_decode_dirent(u32 *, struct nfs_entry *, int); 96extern __be32 * nfs_decode_dirent(__be32 *, struct nfs_entry *, int);
97 97
98/* nfs3xdr.c */ 98/* nfs3xdr.c */
99extern struct rpc_procinfo nfs3_procedures[]; 99extern struct rpc_procinfo nfs3_procedures[];
100extern u32 *nfs3_decode_dirent(u32 *, struct nfs_entry *, int); 100extern __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
104extern u32 *nfs4_decode_dirent(u32 *p, struct nfs_entry *entry, int plus); 104extern __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
471u32 * 471__be32 *
472nfs_decode_dirent(u32 *p, struct nfs_entry *entry, int plus) 472nfs_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
586u32 * 586__be32 *
587nfs3_decode_dirent(u32 *p, struct nfs_entry *entry, int plus) 587nfs3_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);
212extern const nfs4_stateid zero_stateid; 212extern const nfs4_stateid zero_stateid;
213 213
214/* nfs4xdr.c */ 214/* nfs4xdr.c */
215extern uint32_t *nfs4_decode_dirent(uint32_t *p, struct nfs_entry *entry, int plus); 215extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus);
216extern struct rpc_procinfo nfs4_procedures[]; 216extern struct rpc_procinfo nfs4_procedures[];
217 217
218struct nfs4_mount_data; 218struct 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] = {
141static void nfs4_setup_readdir(u64 cookie, u32 *verifier, struct dentry *dentry, 141static 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
4424uint32_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;