locks: don't allocate a lock context for an F_UNLCK request
authorJeff Layton <jeff.layton@primarydata.com>
Fri, 3 Apr 2015 13:04:03 +0000 (09:04 -0400)
committerJeff Layton <jeff.layton@primarydata.com>
Fri, 3 Apr 2015 13:04:03 +0000 (09:04 -0400)
In the event that we get an F_UNLCK request on an inode that has no lock
context, there is no reason to allocate one. Change
locks_get_lock_context to take a "type" pointer and avoid allocating a
new context if it's F_UNLCK.

Then, fix the callers to return appropriately if that function returns
NULL.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
fs/locks.c

diff --cc fs/locks.c
Simple merge