[PATCH] locks: don't do unnecessary allocations
commit39005d022ad221b76dc2de0ac62ef475a796433b
authorMiklos Szeredi <miklos@szeredi.hu>
Fri, 23 Jun 2006 09:05:10 +0000 (23 02:05 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 23 Jun 2006 14:43:02 +0000 (23 07:43 -0700)
treee0a36fec7076d48764f0588b9ce09ce8e9f067ff
parent0d9a490abe1f69fda220f7866f6f23af41daa128
[PATCH] locks: don't do unnecessary allocations

posix_lock_file() always allocates new locks in advance, even if it's easy to
determine that no allocations will be needed.

Optimize these cases:

 - FL_ACCESS flag is set

 - Unlocking the whole range

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/locks.c