On 12/10/2010 03:22 AM, Fred Isaman wrote: > --- a/fs/nfs/pnfs.c > +++ b/fs/nfs/pnfs.c > @@ -599,55 +599,6 @@ void nfs4_asynch_forget_layouts(struct pnfs_layout_hdr *lo, > } > } > > -/* Return true if there is layout based io in progress in the given range. > - * Assumes range has already been marked invalid, and layout marked to > - * prevent any new lseg from being inserted. > - */ > -bool > -pnfs_return_layout_barrier(struct nfs_inode *nfsi, > - struct pnfs_layout_range *range) > -{ > - struct pnfs_layout_segment *lseg; > - bool ret = false; > - > - spin_lock(&nfsi->vfs_inode.i_lock); > - list_for_each_entry(lseg, &nfsi->layout->segs, fi_list) > - if (should_free_lseg(&lseg->range, range)) { > - ret = true; > - break; > - } > - spin_unlock(&nfsi->vfs_inode.i_lock); > - dprintk("%s:Return %d\n", __func__, ret); > - return ret; > -} > - > -static int > -return_layout(struct inode *ino, struct pnfs_layout_range *range, bool wait) > -{ > - struct nfs4_layoutreturn *lrp; > - struct nfs_server *server = NFS_SERVER(ino); > - int status = -ENOMEM; > - > - dprintk("--> %s\n", __func__); > - > - lrp = kzalloc(sizeof(*lrp), GFP_KERNEL); > - if (lrp == NULL) { > - put_layout_hdr(ino); > - goto out; > - } > - lrp->args.reclaim = 0; > - lrp->args.layout_type = server->pnfs_curr_ld->id; > - lrp->args.return_type = RETURN_FILE; > - lrp->args.range = *range; > - lrp->args.inode = ino; > - lrp->clp = server->nfs_client; > - > - status = nfs4_proc_layoutreturn(lrp, wait); > -out: > - dprintk("<-- %s status: %d\n", __func__, status); > - return status; > -} > - > /* Initiates a LAYOUTRETURN(FILE) */ > int > _pnfs_return_layout(struct inode *ino, struct pnfs_layout_range *range, > @@ -673,21 +624,10 @@ _pnfs_return_layout(struct inode *ino, struct pnfs_layout_range *range, > goto out; > } > lo->plh_block_lgets++; > - /* Reference matched in nfs4_layoutreturn_release */ > - get_layout_hdr(lo); > spin_unlock(&ino->i_lock); > pnfs_free_lseg_list(&tmp_list); > > - if (layoutcommit_needed(nfsi)) { > - status = pnfs_layoutcommit_inode(ino, wait); > - if (status) { > - /* Return layout even if layoutcommit fails */ > - dprintk("%s: layoutcommit failed, status=%d. " > - "Returning layout anyway\n", > - __func__, status); > - } > - } > - status = return_layout(ino, &arg, wait); You are also removing the layoutcommit. 1. You have not stated it anywhere, and snacked it in silently 2. If you are removing layoutcommit please do that in a different patch with it's own comment and explanation. 3. How come? forgetful or not layoutcommits are a different issue and must be done correctly when writing !!!?! Boaz > + /* Don't need to wait since this is followed by call to end_writeback */ > out: > dprintk("<-- %s status: %d\n", __func__, status); > return status; > diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h > index d999e38..0ddab0d 100644 > --- a/fs/nfs/pnfs.h > +++ b/fs/nfs/pnfs.h > @@ -183,7 +183,6 @@ extern int nfs4_proc_getdeviceinfo(struct nfs_server *server, > extern int nfs4_proc_layoutget(struct nfs4_layoutget *lgp); > extern int nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, > int issync); > -extern int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp, bool wait); > > /* pnfs.c */ > void get_layout_hdr(struct pnfs_layout_hdr *lo); > @@ -193,7 +192,6 @@ bool should_free_lseg(struct pnfs_layout_range *lseg_range, > struct pnfs_layout_segment * > pnfs_update_layout(struct inode *ino, struct nfs_open_context *ctx, > enum pnfs_iomode access_type); > -bool pnfs_return_layout_barrier(struct nfs_inode *, struct pnfs_layout_range *); > int _pnfs_return_layout(struct inode *, struct pnfs_layout_range *, bool wait); > void set_pnfs_layoutdriver(struct nfs_server *, u32 id); > void unset_pnfs_layoutdriver(struct nfs_server *); -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html