Lines Matching refs:nfsi
285 struct nfs_inode *nfsi = NFS_I(lo->plh_inode); in pnfs_detach_layout_hdr() local
287 nfsi->layout = NULL; in pnfs_detach_layout_hdr()
289 nfsi->write_io = 0; in pnfs_detach_layout_hdr()
290 nfsi->read_io = 0; in pnfs_detach_layout_hdr()
753 static struct pnfs_layout_hdr *__pnfs_destroy_layout(struct nfs_inode *nfsi) in __pnfs_destroy_layout() argument
758 spin_lock(&nfsi->vfs_inode.i_lock); in __pnfs_destroy_layout()
759 lo = nfsi->layout; in __pnfs_destroy_layout()
765 spin_unlock(&nfsi->vfs_inode.i_lock); in __pnfs_destroy_layout()
767 nfs_commit_inode(&nfsi->vfs_inode, 0); in __pnfs_destroy_layout()
770 spin_unlock(&nfsi->vfs_inode.i_lock); in __pnfs_destroy_layout()
774 void pnfs_destroy_layout(struct nfs_inode *nfsi) in pnfs_destroy_layout() argument
776 __pnfs_destroy_layout(nfsi); in pnfs_destroy_layout()
780 static bool pnfs_layout_removed(struct nfs_inode *nfsi, in pnfs_layout_removed() argument
785 spin_lock(&nfsi->vfs_inode.i_lock); in pnfs_layout_removed()
786 ret = nfsi->layout != lo; in pnfs_layout_removed()
787 spin_unlock(&nfsi->vfs_inode.i_lock); in pnfs_layout_removed()
791 void pnfs_destroy_layout_final(struct nfs_inode *nfsi) in pnfs_destroy_layout_final() argument
793 struct pnfs_layout_hdr *lo = __pnfs_destroy_layout(nfsi); in pnfs_destroy_layout_final()
796 wait_var_event(lo, pnfs_layout_removed(nfsi, lo)); in pnfs_destroy_layout_final()
1144 struct nfs_inode *nfsi = NFS_I(inode); in pnfs_clear_layoutcommit() local
1147 if (!test_and_clear_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags)) in pnfs_clear_layoutcommit()
1149 list_for_each_entry_safe(lseg, tmp, &nfsi->layout->plh_segs, pls_list) { in pnfs_clear_layoutcommit()
1323 struct nfs_inode *nfsi = NFS_I(ino); in _pnfs_return_layout() local
1338 lo = nfsi->layout; in _pnfs_return_layout()
1415 struct nfs_inode *nfsi = NFS_I(ino); in pnfs_roc() local
1431 lo = nfsi->layout; in pnfs_roc()
1454 list_for_each_entry_rcu(ctx, &nfsi->open_files, list) { in pnfs_roc()
1597 struct nfs_inode *nfsi = NFS_I(ino); in pnfs_wait_on_layoutreturn() local
1604 lo = nfsi->layout; in pnfs_wait_on_layoutreturn()
1741 struct nfs_inode *nfsi = NFS_I(ino); in pnfs_find_alloc_layout() local
1744 dprintk("%s Begin ino=%p layout=%p\n", __func__, ino, nfsi->layout); in pnfs_find_alloc_layout()
1746 if (nfsi->layout != NULL) in pnfs_find_alloc_layout()
1752 if (likely(nfsi->layout == NULL)) { /* Won the race? */ in pnfs_find_alloc_layout()
1753 nfsi->layout = new; in pnfs_find_alloc_layout()
1758 pnfs_get_layout_hdr(nfsi->layout); in pnfs_find_alloc_layout()
1759 return nfsi->layout; in pnfs_find_alloc_layout()
1844 struct nfs_inode *nfsi = NFS_I(ino); in pnfs_within_mdsthreshold() local
1864 nfsi->read_io); in pnfs_within_mdsthreshold()
1866 if (nfsi->read_io < t->rd_io_sz) in pnfs_within_mdsthreshold()
1879 nfsi->write_io); in pnfs_within_mdsthreshold()
1881 if (nfsi->write_io < t->wr_io_sz) in pnfs_within_mdsthreshold()
3117 struct nfs_inode *nfsi = NFS_I(inode); in pnfs_set_layoutcommit() local
3121 if (!test_and_set_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags)) { in pnfs_set_layoutcommit()
3122 nfsi->layout->plh_lwb = end_pos; in pnfs_set_layoutcommit()
3126 } else if (end_pos > nfsi->layout->plh_lwb) in pnfs_set_layoutcommit()
3127 nfsi->layout->plh_lwb = end_pos; in pnfs_set_layoutcommit()
3134 __func__, lseg, nfsi->layout->plh_lwb); in pnfs_set_layoutcommit()
3165 struct nfs_inode *nfsi = NFS_I(inode); in pnfs_layoutcommit_inode() local
3175 if (test_and_set_bit(NFS_INO_LAYOUTCOMMITTING, &nfsi->flags)) { in pnfs_layoutcommit_inode()
3178 status = wait_on_bit_lock_action(&nfsi->flags, in pnfs_layoutcommit_inode()
3194 if (!test_and_clear_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags)) in pnfs_layoutcommit_inode()
3200 end_pos = nfsi->layout->plh_lwb; in pnfs_layoutcommit_inode()
3202 nfs4_stateid_copy(&data->args.stateid, &nfsi->layout->plh_stateid); in pnfs_layoutcommit_inode()
3203 data->cred = get_cred(nfsi->layout->plh_lc_cred); in pnfs_layoutcommit_inode()
3221 set_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags); in pnfs_layoutcommit_inode()
3222 if (end_pos > nfsi->layout->plh_lwb) in pnfs_layoutcommit_inode()
3223 nfsi->layout->plh_lwb = end_pos; in pnfs_layoutcommit_inode()
3269 struct nfs_inode *nfsi = NFS_I(inode); in pnfs_report_layoutstat() local
3280 if (test_and_set_bit(NFS_INO_LAYOUTSTATS, &nfsi->flags)) in pnfs_report_layoutstat()
3316 clear_bit(NFS_INO_LAYOUTSTATS, &nfsi->flags); in pnfs_report_layoutstat()