提交 b7a57cca 编写于 作者: M Martin Brandenburg 提交者: Mike Marshall

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: NMartin Brandenburg <martin@omnibond.com>
Signed-off-by: NMike Marshall <hubcap@omnibond.com>
上级 9d286b0d
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册