}
static u64 nfsd_foreach_client_lock(struct nfs4_client *clp, u64 max,
+ struct list_head *collect,
void (*func)(struct nfs4_ol_stateid *))
{
struct nfs4_openowner *oop;
&oop->oo_owner.so_stateids, st_perstateowner) {
list_for_each_entry_safe(lst, lst_next,
&stp->st_locks, st_locks) {
- if (func)
+ if (func) {
func(lst);
+ if (collect)
+ list_add(&lst->st_locks,
+ collect);
+ }
if (++count == max)
return count;
}
u64 nfsd_forget_client_locks(struct nfs4_client *clp, u64 max)
{
- return nfsd_foreach_client_lock(clp, max, release_lock_stateid);
+ return nfsd_foreach_client_lock(clp, max, NULL, release_lock_stateid);
}
u64 nfsd_print_client_locks(struct nfs4_client *clp, u64 max)
{
- u64 count = nfsd_foreach_client_lock(clp, max, NULL);
+ u64 count = nfsd_foreach_client_lock(clp, max, NULL, NULL);
nfsd_print_count(clp, count, "locked files");
return count;
}