Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7a57cca authored by Martin Brandenburg's avatar Martin Brandenburg Committed by Mike Marshall
Browse files

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: default avatarMartin Brandenburg <martin@omnibond.com>
Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
parent 9d286b0d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);