Merge ../bleed-2.6
[powerpc.git] / fs / nfs / read.c
index 6f866b8..43b03b1 100644 (file)
@@ -140,7 +140,9 @@ static int nfs_readpage_sync(struct nfs_open_context *ctx, struct inode *inode,
                if (rdata->res.eof != 0 || result == 0)
                        break;
        } while (count);
-       NFS_FLAGS(inode) |= NFS_INO_INVALID_ATIME;
+       spin_lock(&inode->i_lock);
+       NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME;
+       spin_unlock(&inode->i_lock);
 
        if (count)
                memclear_highpage_flush(page, rdata->args.pgbase, count);
@@ -182,14 +184,13 @@ static void nfs_readpage_release(struct nfs_page *req)
 {
        unlock_page(req->wb_page);
 
-       nfs_clear_request(req);
-       nfs_release_request(req);
-
        dprintk("NFS: read done (%s/%Ld %d@%Ld)\n",
                        req->wb_context->dentry->d_inode->i_sb->s_id,
                        (long long)NFS_FILEID(req->wb_context->dentry->d_inode),
                        req->wb_bytes,
                        (long long)req_offset(req));
+       nfs_clear_request(req);
+       nfs_release_request(req);
 }
 
 /*
@@ -214,6 +215,7 @@ static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data,
        data->res.fattr   = &data->fattr;
        data->res.count   = count;
        data->res.eof     = 0;
+       nfs_fattr_init(&data->fattr);
 
        NFS_PROTO(inode)->read_setup(data);
 
@@ -473,7 +475,9 @@ void nfs_readpage_result(struct rpc_task *task)
                }
                task->tk_status = -EIO;
        }
-       NFS_FLAGS(data->inode) |= NFS_INO_INVALID_ATIME;
+       spin_lock(&data->inode->i_lock);
+       NFS_I(data->inode)->cache_validity |= NFS_INO_INVALID_ATIME;
+       spin_unlock(&data->inode->i_lock);
        data->complete(data, status);
 }