History

lockd: rip out deferred lock handling from testlock codepath

As Kinglong points out, the nlm_block->b_fl field is no longer used at all. Also, vfs_test_lock in the generic locking code will only return FILE_LOCK_DEFERRED if FL_SLEEP is set, and it isn't here. The only other place that returns that value is the DLM lock code, but it only does that in dlm_posix_lock, never in dlm_posix_get. Remove all of the deferred locking code from the testlock codepath since it doesn't appear to ever be used anyway. I do have a small concern that this might cause a behavior change in the case where you have a block already sitting on the list when the testlock request comes in, but that looks like it doesn't really work properly anyway. I think it's best to just pass that down to vfs_test_lock and let the filesystem report that instead of trying to infer what's going on with the lock by looking at an existing block.

Jeff Layton committed 12 years ago

Commit 09802fd1 parent aef95832 files · +6 −50Browse files

Showing the changes to include/linux/lockd (1 of 2 files). Show all

Unified · Split

include/linux/lockd/lockd.h+0−1
@@ -178,7 +178,6 @@ struct nlm_block { · 177 unmodified lines
178 unsigned char b_granted; /* VFS granted lock */178 unsigned char b_granted; /* VFS granted lock */
179 struct nlm_file * b_file; /* file in question */179 struct nlm_file * b_file; /* file in question */
180 struct cache_req * b_cache_req; /* deferred request handling */180 struct cache_req * b_cache_req; /* deferred request handling */
181 struct file_lock * b_fl; /* set for GETLK */
182 struct cache_deferred_req * b_deferred_req;181 struct cache_deferred_req * b_deferred_req;
183 unsigned int b_flags; /* block flags */182 unsigned int b_flags; /* block flags */
184#define B_QUEUED 1 /* lock queued */183#define B_QUEUED 1 /* lock queued */