mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 09:23:25 +00:00
Rename Inode::read_to_end
to Inode::read_all
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
12d338dd9b
commit
eb4161a56e
@ -75,9 +75,9 @@ impl InodeHandle_ {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let len = if self.status_flags().contains(StatusFlags::O_DIRECT) {
|
let len = if self.status_flags().contains(StatusFlags::O_DIRECT) {
|
||||||
self.dentry.inode().read_direct_to_end(buf)?
|
self.dentry.inode().read_direct_all(buf)?
|
||||||
} else {
|
} else {
|
||||||
self.dentry.inode().read_to_end(buf)?
|
self.dentry.inode().read_all(buf)?
|
||||||
};
|
};
|
||||||
Ok(len)
|
Ok(len)
|
||||||
}
|
}
|
||||||
|
@ -355,7 +355,7 @@ impl dyn Inode {
|
|||||||
(self as &dyn Any).downcast_ref::<T>()
|
(self as &dyn Any).downcast_ref::<T>()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn read_to_end(&self, buf: &mut Vec<u8>) -> Result<usize> {
|
pub fn read_all(&self, buf: &mut Vec<u8>) -> Result<usize> {
|
||||||
if !self.type_().support_read() {
|
if !self.type_().support_read() {
|
||||||
return_errno!(Errno::EISDIR);
|
return_errno!(Errno::EISDIR);
|
||||||
}
|
}
|
||||||
@ -367,7 +367,7 @@ impl dyn Inode {
|
|||||||
self.read_at(0, &mut buf[..file_size])
|
self.read_at(0, &mut buf[..file_size])
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn read_direct_to_end(&self, buf: &mut Vec<u8>) -> Result<usize> {
|
pub fn read_direct_all(&self, buf: &mut Vec<u8>) -> Result<usize> {
|
||||||
if !self.type_().support_read() {
|
if !self.type_().support_read() {
|
||||||
return_errno!(Errno::EISDIR);
|
return_errno!(Errno::EISDIR);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user