NFSv4.1/pNFS: Add a helper to mark the layout as returned
This ensures that we don't reuse the stateid if a layout return or implied layout return means that we've returned all layout segments Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
@@ -556,6 +556,19 @@ pnfs_calc_offset_length(u64 offset, u64 end)
|
||||
return 1 + end - offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* pnfs_mark_layout_returned_if_empty - marks the layout as returned
|
||||
* @lo: layout header
|
||||
*
|
||||
* Note: Caller must hold inode->i_lock
|
||||
*/
|
||||
static inline void
|
||||
pnfs_mark_layout_returned_if_empty(struct pnfs_layout_hdr *lo)
|
||||
{
|
||||
if (list_empty(&lo->plh_segs))
|
||||
set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags);
|
||||
}
|
||||
|
||||
extern unsigned int layoutstats_timer;
|
||||
|
||||
#ifdef NFS_DEBUG
|
||||
|
Reference in New Issue
Block a user