Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit 4558be0

Browse files
committed
Move these down
1 parent ad0e9b7 commit 4558be0

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/sysctl.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ use error;
99
use types;
1010
use user_ptr::{UserSlicePtr, UserSlicePtrWriter};
1111

12-
pub struct Sysctl<T: SysctlStorage> {
13-
inner: Box<T>,
14-
table: Box<[bindings::ctl_table]>,
15-
header: *mut bindings::ctl_table_header,
16-
}
17-
18-
// This is safe because the only public method we have is get(), which returns
19-
// &T, and T: Sync. Any new methods must adhere to this requirement.
20-
unsafe impl<T: SysctlStorage> Sync for Sysctl<T> {}
21-
2212
pub trait SysctlStorage: Sync {
2313
fn store_value(&self, data: &[u8]) -> (usize, error::KernelResult<()>);
2414
fn read_value(&self, data: &mut UserSlicePtrWriter) -> (usize, error::KernelResult<()>);
@@ -64,6 +54,16 @@ impl SysctlStorage for atomic::AtomicBool {
6454
}
6555
}
6656

57+
pub struct Sysctl<T: SysctlStorage> {
58+
inner: Box<T>,
59+
table: Box<[bindings::ctl_table]>,
60+
header: *mut bindings::ctl_table_header,
61+
}
62+
63+
// This is safe because the only public method we have is get(), which returns
64+
// &T, and T: Sync. Any new methods must adhere to this requirement.
65+
unsafe impl<T: SysctlStorage> Sync for Sysctl<T> {}
66+
6767
unsafe extern "C" fn proc_handler<T: SysctlStorage>(
6868
ctl: *mut bindings::ctl_table,
6969
write: c_types::c_int,

0 commit comments

Comments
 (0)