mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-03 12:35:02 +00:00
Simplify some logic by merging an if test with a subsequent switch.
Specifically, in aio_queue_file() the code was doing this: if (opcode == LIO_SYNC) { ... } switch (opcode) { ... case LIO_SYNC: ... } This moves the body of the if statement into the LIO_SYNC case of the switch statement. MFC after: 2 weeks Sponsored by: Chelsio Communications
This commit is contained in:
parent
8091e52b42
commit
7e40918452
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327753
@ -1736,7 +1736,13 @@ aio_queue_file(struct file *fp, struct kaiocb *job)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
if (opcode == LIO_SYNC) {
|
||||
switch (job->uaiocb.aio_lio_opcode) {
|
||||
case LIO_READ:
|
||||
case LIO_WRITE:
|
||||
aio_schedule(job, aio_process_rw);
|
||||
error = 0;
|
||||
break;
|
||||
case LIO_SYNC:
|
||||
AIO_LOCK(ki);
|
||||
TAILQ_FOREACH(job2, &ki->kaio_jobqueue, plist) {
|
||||
if (job2->fd_file == job->fd_file &&
|
||||
@ -1758,15 +1764,6 @@ aio_queue_file(struct file *fp, struct kaiocb *job)
|
||||
return (0);
|
||||
}
|
||||
AIO_UNLOCK(ki);
|
||||
}
|
||||
|
||||
switch (opcode) {
|
||||
case LIO_READ:
|
||||
case LIO_WRITE:
|
||||
aio_schedule(job, aio_process_rw);
|
||||
error = 0;
|
||||
break;
|
||||
case LIO_SYNC:
|
||||
aio_schedule(job, aio_process_sync);
|
||||
error = 0;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user