Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69180
b: refs/heads/master
c: 4e769b9
h: refs/heads/master
v: v3
  • Loading branch information
Peter Staubach authored and Trond Myklebust committed Oct 9, 2007
1 parent e209996 commit e66441e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 50e437d522a6cc34a882b2f740297f1b6b4c3af3
refs/heads/master: 4e769b934e7638038e232c05b64f644e7269a90f
15 changes: 8 additions & 7 deletions trunk/fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc, void *dirent,
struct file *file = desc->file;
struct nfs_entry *entry = desc->entry;
struct dentry *dentry = NULL;
unsigned long fileid;
u64 fileid;
int loop_count = 0,
res;

Expand All @@ -418,7 +418,7 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc, void *dirent,
unsigned d_type = DT_UNKNOWN;
/* Note: entry->prev_cookie contains the cookie for
* retrieving the current dirent on the server */
fileid = nfs_fileid_to_ino_t(entry->ino);
fileid = entry->ino;

/* Get a dentry if we have one */
if (dentry != NULL)
Expand All @@ -428,7 +428,7 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc, void *dirent,
/* Use readdirplus info */
if (dentry != NULL && dentry->d_inode != NULL) {
d_type = dt_type(dentry->d_inode);
fileid = dentry->d_inode->i_ino;
fileid = NFS_FILEID(dentry->d_inode);
}

res = filldir(dirent, entry->name, entry->len,
Expand Down Expand Up @@ -1350,9 +1350,9 @@ static int nfs_rmdir(struct inode *dir, struct dentry *dentry)
static int nfs_sillyrename(struct inode *dir, struct dentry *dentry)
{
static unsigned int sillycounter;
const int i_inosize = sizeof(dir->i_ino)*2;
const int fileidsize = sizeof(NFS_FILEID(dentry->d_inode))*2;
const int countersize = sizeof(sillycounter)*2;
const int slen = sizeof(".nfs") + i_inosize + countersize - 1;
const int slen = sizeof(".nfs")+fileidsize+countersize-1;
char silly[slen+1];
struct qstr qsilly;
struct dentry *sdentry;
Expand All @@ -1370,8 +1370,9 @@ static int nfs_sillyrename(struct inode *dir, struct dentry *dentry)
if (dentry->d_flags & DCACHE_NFSFS_RENAMED)
goto out;

sprintf(silly, ".nfs%*.*lx",
i_inosize, i_inosize, dentry->d_inode->i_ino);
sprintf(silly, ".nfs%*.*Lx",
fileidsize, fileidsize,
(unsigned long long)NFS_FILEID(dentry->d_inode));

/* Return delegation in anticipation of the rename */
nfs_inode_return_delegation(dentry->d_inode);
Expand Down
4 changes: 3 additions & 1 deletion trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,10 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
err = __nfs_revalidate_inode(NFS_SERVER(inode), inode);
else
err = nfs_revalidate_inode(NFS_SERVER(inode), inode);
if (!err)
if (!err) {
generic_fillattr(inode, stat);
stat->ino = NFS_FILEID(inode);
}
return err;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static void nfs4_setup_readdir(u64 cookie, __be32 *verifier, struct dentry *dent
*p++ = xdr_one; /* bitmap length */
*p++ = htonl(FATTR4_WORD0_FILEID); /* bitmap */
*p++ = htonl(8); /* attribute buffer length */
p = xdr_encode_hyper(p, dentry->d_inode->i_ino);
p = xdr_encode_hyper(p, NFS_FILEID(dentry->d_inode));
}

*p++ = xdr_one; /* next */
Expand All @@ -189,7 +189,7 @@ static void nfs4_setup_readdir(u64 cookie, __be32 *verifier, struct dentry *dent
*p++ = xdr_one; /* bitmap length */
*p++ = htonl(FATTR4_WORD0_FILEID); /* bitmap */
*p++ = htonl(8); /* attribute buffer length */
p = xdr_encode_hyper(p, dentry->d_parent->d_inode->i_ino);
p = xdr_encode_hyper(p, NFS_FILEID(dentry->d_parent->d_inode));

readdir->pgbase = (char *)p - (char *)start;
readdir->count -= readdir->pgbase;
Expand Down

0 comments on commit e66441e

Please sign in to comment.