pnfs: recoalesce when ld read pagelist fails
[linux-2.6.git] / fs / nfs / pnfs.c
index a205c8e..ee73d9a 100644 (file)
@@ -1262,23 +1262,17 @@ EXPORT_SYMBOL_GPL(pnfs_generic_pg_writepages);
 /*
  * Called by non rpc-based layout drivers
  */
-int
-pnfs_ld_read_done(struct nfs_read_data *data)
+void pnfs_ld_read_done(struct nfs_read_data *data)
 {
-       int status;
-
-       if (!data->pnfs_error) {
+       if (likely(!data->pnfs_error)) {
                __nfs4_read_done_cb(data);
                data->mds_ops->rpc_call_done(&data->task, data);
-               data->mds_ops->rpc_release(data);
-               return 0;
+       } else {
+               put_lseg(data->lseg);
+               data->lseg = NULL;
+               dprintk("pnfs write error = %d\n", data->pnfs_error);
        }
-
-       dprintk("%s: pnfs_error=%d, retry via MDS\n", __func__,
-               data->pnfs_error);
-       status = nfs_initiate_read(data, NFS_CLIENT(data->inode),
-                                  data->mds_ops);
-       return status ? : -EAGAIN;
+       data->mds_ops->rpc_release(data);
 }
 EXPORT_SYMBOL_GPL(pnfs_ld_read_done);