Replace idr_for_each_entry_ul() with a while loop over
idr_get_next_ul() for consistency with find_one_export_stid(),
added in a subsequent commit.
No change in behavior.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
struct super_block *sb,
unsigned int sc_types)
{
- unsigned long id, tmp;
+ unsigned long id = 0;
struct nfs4_stid *stid;
spin_lock(&clp->cl_lock);
- idr_for_each_entry_ul(&clp->cl_stateids, stid, tmp, id)
+ while ((stid = idr_get_next_ul(&clp->cl_stateids, &id)) != NULL) {
if ((stid->sc_type & sc_types) &&
stid->sc_status == 0 &&
stid->sc_file->fi_inode->i_sb == sb) {
refcount_inc(&stid->sc_count);
break;
}
+ id++;
+ }
spin_unlock(&clp->cl_lock);
return stid;
}