Skip to content

Commit 3c25561

Browse files
committed
Fix some identifiers in comments
1 parent 036524f commit 3c25561

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

src/sys/aio.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use std::ptr::{null, null_mut};
1010
use sys::signal::*;
1111
use sys::time::TimeSpec;
1212

13-
/// Mode for `aio_fsync`. Controls whether only data or both data and metadata
14-
/// are synced.
13+
/// Mode for `AioCb::fsync`. Controls whether only data or both data and
14+
/// metadata are synced.
1515
#[repr(i32)]
1616
#[derive(Clone, Copy, Debug, PartialEq)]
1717
pub enum AioFsyncMode {
@@ -46,14 +46,14 @@ pub enum LioMode {
4646
LIO_NOWAIT = libc::LIO_NOWAIT,
4747
}
4848

49-
/// Return values for `aio_cancel`
49+
/// Return values for `AioCb::cancel and aio_cancel_all`
5050
#[repr(i32)]
5151
#[derive(Clone, Copy, Debug, PartialEq)]
5252
pub enum AioCancelStat {
5353
/// All outstanding requests were canceled
5454
AioCanceled = libc::AIO_CANCELED,
5555
/// Some requests were not canceled. Their status should be checked with
56-
/// `aio_error`
56+
/// `AioCb::error`
5757
AioNotCanceled = libc::AIO_NOTCANCELED,
5858
/// All of the requests have already finished
5959
AioAllDone = libc::AIO_ALLDONE,
@@ -73,7 +73,7 @@ pub struct AioCb<'a> {
7373
impl<'a> AioCb<'a> {
7474
/// Constructs a new `AioCb` with no associated buffer.
7575
///
76-
/// The resulting `AioCb` structure is suitable for use with `aio_fsync`.
76+
/// The resulting `AioCb` structure is suitable for use with `AioCb::fsync`.
7777
/// * `fd` File descriptor. Required for all aio functions.
7878
/// * `prio` If POSIX Prioritized IO is supported, then the operation will
7979
/// be prioritized at the process's priority level minus `prio`
@@ -122,15 +122,15 @@ impl<'a> AioCb<'a> {
122122
/// mutable slices.
123123
///
124124
/// An `AioCb` created this way cannot be used with `read`, and its
125-
/// `LioOpcode` cannot be set to `LIO_READ`. This method is useful when writing a
126-
/// const buffer with `aio_write`, since from_mut_slice can't work with const
127-
/// buffers.
125+
/// `LioOpcode` cannot be set to `LIO_READ`. This method is useful when
126+
/// writing a const buffer with `AioCb::write`, since from_mut_slice can't
127+
/// work with const buffers.
128128
// Note: another solution to the problem of writing const buffers would be
129-
// to genericize AioCb for both &mut [u8] and &[u8] buffers. aio_read could
130-
// take the former and aio_write could take the latter. However, then
131-
// lio_listio wouldn't work, because that function needs a slice of AioCb,
132-
// and they must all be the same type. We're basically stuck with using an
133-
// unsafe function, since aio (as designed in C) is an unsafe API.
129+
// to genericize AioCb for both &mut [u8] and &[u8] buffers. AioCb::read
130+
// could take the former and AioCb::write could take the latter. However,
131+
// then lio_listio wouldn't work, because that function needs a slice of
132+
// AioCb, and they must all be the same type. We're basically stuck with
133+
// using an unsafe function, since aio (as designed in C) is an unsafe API.
134134
pub fn from_slice(fd: RawFd, offs: off_t, buf: &'a [u8],
135135
prio: ::c_int, sigev_notify: SigevNotify,
136136
opcode: LioOpcode) -> AioCb {
@@ -175,9 +175,9 @@ impl<'a> AioCb<'a> {
175175
}
176176
}
177177

178-
/// Retrieve error status of an asynchronous operation. If the request has not
179-
/// yet completed, returns `EINPROGRESS`. Otherwise, returns `Ok` or any other
180-
/// error.
178+
/// Retrieve error status of an asynchronous operation. If the request has
179+
/// not yet completed, returns `EINPROGRESS`. Otherwise, returns `Ok` or
180+
/// any other error.
181181
pub fn error(&mut self) -> Result<()> {
182182
match unsafe { libc::aio_error(&mut self.aiocb as *mut libc::aiocb) } {
183183
0 => Ok(()),
@@ -202,9 +202,9 @@ impl<'a> AioCb<'a> {
202202
Errno::result(unsafe { libc::aio_read(p) }).map(drop)
203203
}
204204

205-
/// Retrieve return status of an asynchronous operation. Should only be called
206-
/// once for each `AioCb`, after `aio_error` indicates that it has completed.
207-
/// The result the same as for `read`, `write`, of `fsync`.
205+
/// Retrieve return status of an asynchronous operation. Should only be
206+
/// called once for each `AioCb`, after `AioCb::error` indicates that it has
207+
/// completed. The result is the same as for `read`, `write`, of `fsync`.
208208
// Note: this should be just `return`, but that's a reserved word
209209
pub fn aio_return(&mut self) -> Result<isize> {
210210
let p: *mut libc::aiocb = &mut self.aiocb;

0 commit comments

Comments
 (0)