locks: trivial locks.c patches
Subsystems (2)
cover locks: trivial locks.c patches
A few reasonably trivial patches for locks.c. Al, can you apply these for 3.12?
Jeff Layton (3):
locks: clean up comment typo
locks: remove "inline" qualifier from fl_link manipulation functions
locks: add __acquires and __releases annotations to locks_start and
locks_stop
fs/locks.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/3 locks: clean up comment typo
Signed-off-by Jeff Layton <[email protected]>
--- fs/locks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/locks.c +1 -1
@@ -581,7 +581,7 @@ static void locks_delete_block(struct file_lock *waiter)* it seems like the reasonable thing to do. * * Must be called with both the i_lock and blocked_lock_lock held. The fl_block -* list itself is protected by the file_lock_list, but by ensuring that the +* list itself is protected by the blocked_lock_lock, but by ensuring that the * i_lock is also held on insertions we can avoid taking the blocked_lock_lock * in some cases when we see that the fl_block list is empty. */
Signature · 1 line
1.8.3.1
PATCH 2/3 locks: remove "inline" qualifier from fl_link manipulation functions
In reply to Jeff LaytonIt's best to let the compiler decide that.
Reported-by Stephen Rothwell <[email protected]>
Signed-off-by Jeff Layton <[email protected]>
--- fs/locks.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
fs/locks.c +4 -8
@@ -511,8 +511,7 @@ static int posix_same_owner(struct file_lock *fl1, struct file_lock *fl2) }/* Must be called with the i_lock held! */ -static inline void -locks_insert_global_locks (struct file_lock *fl) +static void locks_insert_global_locks (struct file_lock *fl) {lg_local_lock (&file_lock_lglock); fl->fl_link_cpu =smp_processor_id ();
@@ -521,8 +520,7 @@ locks_insert_global_locks(struct file_lock *fl) }/* Must be called with the i_lock held! */ -static inline void -locks_delete_global_locks (struct file_lock *fl) +static void locks_delete_global_locks (struct file_lock *fl) {/* * Avoid taking lock if already unhashed. This is safe since this check
@@ -544,14 +542,12 @@ posix_owner_key(struct file_lock *fl)return (unsigned long )fl->fl_owner; } -static inline void -locks_insert_global_blocked (struct file_lock *waiter) +static void locks_insert_global_blocked (struct file_lock *waiter) {hash_add (blocked_hash, &waiter->fl_link,posix_owner_key (waiter)); } -static inline void -locks_delete_global_blocked (struct file_lock *waiter) +static void locks_delete_global_blocked (struct file_lock *waiter) {hash_del (&waiter->fl_link); }
Signature · 1 line
1.8.3.1
PATCH 3/3 locks: add __acquires and __releases annotations to locks_start and locks_stop
In reply to Jeff Layton...to make sparse happy.
Signed-off-by Jeff Layton <[email protected]>
--- fs/locks.c | 2 ++ 1 file changed, 2 insertions(+)
fs/locks.c +2 -0
@@ -2390,6 +2390,7 @@ static int locks_show(struct seq_file *f, void *v) }static void *locks_start (struct seq_file *f,loff_t *pos) + __acquires(&blocked_lock_lock) {struct locks_iterator *iter = f->private;
@@ -2408,6 +2409,7 @@ static void *locks_next(struct seq_file *f, void *v, loff_t *pos) }static void locks_stop (struct seq_file *f,void *v) + __releases(&blocked_lock_lock) {spin_unlock (&blocked_lock_lock);lg_global_unlock (&file_lock_lglock);
Signature · 1 line
1.8.3.1