mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
orangefs: return from orangefs_devreq_read quickly if possible
It is not necessary to take the lock and search through the request list if the list is empty. Signed-off-by: Martin Brandenburg <[email protected]> Signed-off-by: Mike Marshall <[email protected]>
This commit is contained in:
parent
9d286b0d82
commit
b7a57ccab8
1 changed files with 4 additions and 0 deletions
|
|
@ -180,6 +180,10 @@ static ssize_t orangefs_devreq_read(struct file *file,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Check for an empty list before locking. */
|
||||
if (list_empty(&orangefs_request_list))
|
||||
return -EAGAIN;
|
||||
|
||||
restart:
|
||||
/* Get next op (if any) from top of list. */
|
||||
spin_lock(&orangefs_request_list_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue