aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorPeter Staubach <staubach@redhat.com>2007-08-03 15:07:10 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 17:15:29 -0400
commit4e769b934e7638038e232c05b64f644e7269a90f (patch)
tree6508c1d273f22d3704eb849fb90404bade7cb4a7 /fs/nfs/dir.c
parent50e437d522a6cc34a882b2f740297f1b6b4c3af3 (diff)
64 bit ino support for NFS client
Hi. Attached is a patch to modify the NFS client code to support 64 bit ino's, as appropriate for the system and the NFS protocol version. The code basically just expand the NFS interfaces for routines which handle ino's from using ino_t to u64 and then uses the fileid in the nfs_inode instead of i_ino in the inode. The code paths that were updated are in the getattr method and the readdir methods. This should be no real change on 64 bit platforms. Since the ino_t is an unsigned long, it would already be 64 bits wide. Thanx... ps Signed-off-by: Peter Staubach <staubach@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index e4a04d16b8b0..dd02db43cbe6 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -407,7 +407,7 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc, void *dirent,
407 struct file *file = desc->file; 407 struct file *file = desc->file;
408 struct nfs_entry *entry = desc->entry; 408 struct nfs_entry *entry = desc->entry;
409 struct dentry *dentry = NULL; 409 struct dentry *dentry = NULL;
410 unsigned long fileid; 410 u64 fileid;
411 int loop_count = 0, 411 int loop_count = 0,
412 res; 412 res;
413 413
@@ -418,7 +418,7 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc, void *dirent,
418 unsigned d_type = DT_UNKNOWN; 418 unsigned d_type = DT_UNKNOWN;
419 /* Note: entry->prev_cookie contains the cookie for 419 /* Note: entry->prev_cookie contains the cookie for
420 * retrieving the current dirent on the server */ 420 * retrieving the current dirent on the server */
421 fileid = nfs_fileid_to_ino_t(entry->ino); 421 fileid = entry->ino;
422 422
423 /* Get a dentry if we have one */ 423 /* Get a dentry if we have one */
424 if (dentry != NULL) 424 if (dentry != NULL)
@@ -428,7 +428,7 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc, void *dirent,
428 /* Use readdirplus info */ 428 /* Use readdirplus info */
429 if (dentry != NULL && dentry->d_inode != NULL) { 429 if (dentry != NULL && dentry->d_inode != NULL) {
430 d_type = dt_type(dentry->d_inode); 430 d_type = dt_type(dentry->d_inode);
431 fileid = dentry->d_inode->i_ino; 431 fileid = NFS_FILEID(dentry->d_inode);
432 } 432 }
433 433
434 res = filldir(dirent, entry->name, entry->len, 434 res = filldir(dirent, entry->name, entry->len,
@@ -1350,9 +1350,9 @@ static int nfs_rmdir(struct inode *dir, struct dentry *dentry)
1350static int nfs_sillyrename(struct inode *dir, struct dentry *dentry) 1350static int nfs_sillyrename(struct inode *dir, struct dentry *dentry)
1351{ 1351{
1352 static unsigned int sillycounter; 1352 static unsigned int sillycounter;
1353 const int i_inosize = sizeof(dir->i_ino)*2; 1353 const int fileidsize = sizeof(NFS_FILEID(dentry->d_inode))*2;
1354 const int countersize = sizeof(sillycounter)*2; 1354 const int countersize = sizeof(sillycounter)*2;
1355 const int slen = sizeof(".nfs") + i_inosize + countersize - 1; 1355 const int slen = sizeof(".nfs")+fileidsize+countersize-1;
1356 char silly[slen+1]; 1356 char silly[slen+1];
1357 struct qstr qsilly; 1357 struct qstr qsilly;
1358 struct dentry *sdentry; 1358 struct dentry *sdentry;
@@ -1370,8 +1370,9 @@ static int nfs_sillyrename(struct inode *dir, struct dentry *dentry)
1370 if (dentry->d_flags & DCACHE_NFSFS_RENAMED) 1370 if (dentry->d_flags & DCACHE_NFSFS_RENAMED)
1371 goto out; 1371 goto out;
1372 1372
1373 sprintf(silly, ".nfs%*.*lx", 1373 sprintf(silly, ".nfs%*.*Lx",
1374 i_inosize, i_inosize, dentry->d_inode->i_ino); 1374 fileidsize, fileidsize,
1375 (unsigned long long)NFS_FILEID(dentry->d_inode));
1375 1376
1376 /* Return delegation in anticipation of the rename */ 1377 /* Return delegation in anticipation of the rename */
1377 nfs_inode_return_delegation(dentry->d_inode); 1378 nfs_inode_return_delegation(dentry->d_inode);