Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115385
b: refs/heads/master
c: 691beb1
h: refs/heads/master
i:
  115383: 458bf65
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 7, 2008
1 parent afc3914 commit 17ad52f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 47 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: 2f28ea614ff497202d5a52af82da523ae4a20718
refs/heads/master: 691beb13cdc88358334ef0ba867c080a247a760f
43 changes: 2 additions & 41 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,37 +472,6 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr)
}
}

static int nfs_wait_schedule(void *word)
{
if (signal_pending(current))
return -ERESTARTSYS;
schedule();
return 0;
}

/*
* Wait for the inode to get unlocked.
*/
static int nfs_wait_on_inode(struct inode *inode)
{
struct nfs_inode *nfsi = NFS_I(inode);
int error;

error = wait_on_bit_lock(&nfsi->flags, NFS_INO_REVALIDATING,
nfs_wait_schedule, TASK_KILLABLE);

return error;
}

static void nfs_wake_up_inode(struct inode *inode)
{
struct nfs_inode *nfsi = NFS_I(inode);

clear_bit(NFS_INO_REVALIDATING, &nfsi->flags);
smp_mb__after_clear_bit();
wake_up_bit(&nfsi->flags, NFS_INO_REVALIDATING);
}

int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
{
struct inode *inode = dentry->d_inode;
Expand Down Expand Up @@ -697,20 +666,15 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
dfprintk(PAGECACHE, "NFS: revalidating (%s/%Ld)\n",
inode->i_sb->s_id, (long long)NFS_FILEID(inode));

nfs_inc_stats(inode, NFSIOS_INODEREVALIDATE);
if (is_bad_inode(inode))
goto out_nowait;
goto out;
if (NFS_STALE(inode))
goto out_nowait;

status = nfs_wait_on_inode(inode);
if (status < 0)
goto out;

status = -ESTALE;
if (NFS_STALE(inode))
goto out;

nfs_inc_stats(inode, NFSIOS_INODEREVALIDATE);
status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), &fattr);
if (status != 0) {
dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) getattr failed, error=%d\n",
Expand Down Expand Up @@ -740,9 +704,6 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
(long long)NFS_FILEID(inode));

out:
nfs_wake_up_inode(inode);

out_nowait:
return status;
}

Expand Down
9 changes: 4 additions & 5 deletions trunk/include/linux/nfs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,10 @@ struct nfs_inode {
/*
* Bit offsets in flags field
*/
#define NFS_INO_REVALIDATING (0) /* revalidating attrs */
#define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */
#define NFS_INO_STALE (2) /* possible stale inode */
#define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */
#define NFS_INO_MOUNTPOINT (4) /* inode is remote mountpoint */
#define NFS_INO_ADVISE_RDPLUS (0) /* advise readdirplus */
#define NFS_INO_STALE (1) /* possible stale inode */
#define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */
#define NFS_INO_MOUNTPOINT (3) /* inode is remote mountpoint */

static inline struct nfs_inode *NFS_I(const struct inode *inode)
{
Expand Down

0 comments on commit 17ad52f

Please sign in to comment.