|
@@ -565,16 +565,17 @@ static void nfs_init_lock_context(struct nfs_lock_context *l_ctx)
|
|
|
|
|
|
static struct nfs_lock_context *__nfs_find_lock_context(struct nfs_open_context *ctx)
|
|
|
{
|
|
|
- struct nfs_lock_context *pos;
|
|
|
+ struct nfs_lock_context *head = &ctx->lock_context;
|
|
|
+ struct nfs_lock_context *pos = head;
|
|
|
|
|
|
- list_for_each_entry(pos, &ctx->lock_context.list, list) {
|
|
|
+ do {
|
|
|
if (pos->lockowner.l_owner != current->files)
|
|
|
continue;
|
|
|
if (pos->lockowner.l_pid != current->tgid)
|
|
|
continue;
|
|
|
atomic_inc(&pos->count);
|
|
|
return pos;
|
|
|
- }
|
|
|
+ } while ((pos = list_entry(pos->list.next, typeof(*pos), list)) != head);
|
|
|
return NULL;
|
|
|
}
|
|
|
|