Skip to content

Commit

Permalink
s/PageAlinedBuffer/PageAlignedBuffer/g
Browse files Browse the repository at this point in the history
  • Loading branch information
sk1p committed Aug 26, 2024
1 parent aae9782 commit 73ab4ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/storage/store/store_sync/filesystem_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ use std::{

/// For `O_DIRECT`, we need a buffer that is aligned to the page size and is a
/// multiple of the page size.
struct PageAlinedBuffer {
struct PageAlignedBuffer {
buf: *mut u8,
layout: Layout,
}

impl PageAlinedBuffer {
impl PageAlignedBuffer {
/// Allocate a new page-size aligned buffer of `size` bytes. The actual size
/// will be rounded up to the next largest multiple of the page size.
pub fn new(size: usize) -> Self {
Expand All @@ -78,7 +78,7 @@ impl PageAlinedBuffer {
}

Check warning on line 78 in src/storage/store/store_sync/filesystem_store.rs

View check run for this annotation

Codecov / codecov/patch

src/storage/store/store_sync/filesystem_store.rs#L68-L78

Added lines #L68 - L78 were not covered by tests
}

impl Deref for PageAlinedBuffer {
impl Deref for PageAlignedBuffer {
type Target = [u8];

fn deref(&self) -> &Self::Target {
Expand All @@ -99,7 +99,7 @@ impl Deref for PageAlinedBuffer {
}

Check warning on line 99 in src/storage/store/store_sync/filesystem_store.rs

View check run for this annotation

Codecov / codecov/patch

src/storage/store/store_sync/filesystem_store.rs#L84-L99

Added lines #L84 - L99 were not covered by tests
}

impl DerefMut for PageAlinedBuffer {
impl DerefMut for PageAlignedBuffer {
fn deref_mut(&mut self) -> &mut Self::Target {
// SAFETY: see `deref` with the following modification:
// "The memory referenced by the returned slice must not be accessed
Expand All @@ -110,7 +110,7 @@ impl DerefMut for PageAlinedBuffer {
}

Check warning on line 110 in src/storage/store/store_sync/filesystem_store.rs

View check run for this annotation

Codecov / codecov/patch

src/storage/store/store_sync/filesystem_store.rs#L103-L110

Added lines #L103 - L110 were not covered by tests
}

impl Drop for PageAlinedBuffer {
impl Drop for PageAlignedBuffer {
fn drop(&mut self) {
// SAFETY:
// * "ptr must denote a block of memory currently allocated via this allocator,"
Expand Down Expand Up @@ -313,7 +313,7 @@ impl FilesystemStore {

// Write
if enable_direct {
let mut buf = PageAlinedBuffer::new(value.len());
let mut buf = PageAlignedBuffer::new(value.len());
buf[0..value.len()].copy_from_slice(value);
file.write_all(&buf)?;
file.set_len(value.len() as u64)?;

Check warning on line 319 in src/storage/store/store_sync/filesystem_store.rs

View check run for this annotation

Codecov / codecov/patch

src/storage/store/store_sync/filesystem_store.rs#L316-L319

Added lines #L316 - L319 were not covered by tests
Expand Down

0 comments on commit 73ab4ee

Please sign in to comment.