kernels/linux-2.4.0/fs/nfs/inode.c
/*
 * This function is called whenever some part of NFS notices that
 * the cached attributes have to be refreshed.
 */
This function is called whenever some part of NFS notices that
the cached attributes have to be refreshed.
This function is called whenever some part of NFS notices that the cached attributes have to be refreshed .
int
__nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
{
	int		 status = 0;
	struct nfs_fattr fattr;
	dfprintk(PAGECACHE, "NFS: revalidating (%x/%Ld)\n",
		inode->i_dev, (long long)NFS_FILEID(inode));
	lock_kernel();
	if (!inode || is_bad_inode(inode) || NFS_STALE(inode)) {
		unlock_kernel();
		return -ESTALE;
	}
	while (NFS_REVALIDATING(inode)) {
		status = nfs_wait_on_inode(inode, NFS_INO_REVALIDATING);
		if (status < 0) {
			unlock_kernel();
			return status;
		}
		if (time_before(jiffies,NFS_READTIME(inode)+NFS_ATTRTIMEO(inode))) {
			status = NFS_STALE(inode) ? -ESTALE : 0;
			goto out_nowait;
		}
	}
	NFS_FLAGS(inode) |= NFS_INO_REVALIDATING;
	status = NFS_PROTO(inode)->getattr(inode, &fattr);
	if (status) {
		dfprintk(PAGECACHE, "nfs_revalidate_inode: (%x/%Ld) getattr failed, error=%d\n",
			 inode->i_dev, (long long)NFS_FILEID(inode), status);
		if (status == -ESTALE) {
			NFS_FLAGS(inode) |= NFS_INO_STALE;
			remove_inode_hash(inode);
		}
		goto out;
	}
	status = nfs_refresh_inode(inode, &fattr);
	if (status) {
		dfprintk(PAGECACHE, "nfs_revalidate_inode: (%x/%Ld) refresh failed, error=%d\n",
			 inode->i_dev, (long long)NFS_FILEID(inode), status);
		goto out;
	}
	dfprintk(PAGECACHE, "NFS: (%x/%Ld) revalidation complete\n",
		inode->i_dev, (long long)NFS_FILEID(inode));
out:
	NFS_FLAGS(inode) &= ~NFS_INO_REVALIDATING;
	wake_up(&inode->i_wait);
 out_nowait:
	unlock_kernel();
	return status;
}
int __nfs_revalidate_inode ( struct nfs_server * server , struct inode * inode ) { int status = 0 ; struct nfs_fattr fattr ; dfprintk ( PAGECACHE , " \n " , inode -> i_dev , ( long long ) NFS_FILEID ( inode ) ) ; lock_kernel ( ) ; if ( ! inode || is_bad_inode ( inode ) || NFS_STALE ( inode ) ) { unlock_kernel ( ) ; return - ESTALE ; } while ( NFS_REVALIDATING ( inode ) ) { status = nfs_wait_on_inode ( inode , NFS_INO_REVALIDATING ) ; if ( status < 0 ) { unlock_kernel ( ) ; return status ; } if ( time_before ( jiffies , NFS_READTIME ( inode ) + NFS_ATTRTIMEO ( inode ) ) ) { status = NFS_STALE ( inode ) ? - ESTALE : 0 ; goto out_nowait ; } } NFS_FLAGS ( inode ) |= NFS_INO_REVALIDATING ; status = NFS_PROTO ( inode ) -> getattr ( inode , & fattr ) ; if ( status ) { dfprintk ( PAGECACHE , " \n " , inode -> i_dev , ( long long ) NFS_FILEID ( inode ) , status ) ; if ( status == - ESTALE ) { NFS_FLAGS ( inode ) |= NFS_INO_STALE ; remove_inode_hash ( inode ) ; } goto out ; } status = nfs_refresh_inode ( inode , & fattr ) ; if ( status ) { dfprintk ( PAGECACHE , " \n " , inode -> i_dev , ( long long ) NFS_FILEID ( inode ) , status ) ; goto out ; } dfprintk ( PAGECACHE , " \n " , inode -> i_dev , ( long long ) NFS_FILEID ( inode ) ) ; out : NFS_FLAGS ( inode ) &= ~ NFS_INO_REVALIDATING ; wake_up ( & inode -> i_wait ) ; out_nowait : unlock_kernel ( ) ; return status ; }
This function is called whenever some part of NFS notices that
 the cached attributes have to be refreshed.
This function is called whenever some part of NFS notices that the cached attributes have to be refreshed .