4.115
Last change
on this file since 699ac7c was
699ac7c,
checked in by Sebastian Huber <sebastian.huber@…>, on 02/24/12 at 16:08:06
|
IMFS: Add and use node control
Add and use structure IMFS_node_control with support functions. This
helps to make high level functions independent of the node type and
reduces the number of branches in the code.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | /* |
---|
2 | * Device Operations Table for the IMFS |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989-1999. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * |
---|
7 | * The license and distribution terms for this file may be |
---|
8 | * found in the file LICENSE in this distribution or at |
---|
9 | * http://www.rtems.com/license/LICENSE. |
---|
10 | * |
---|
11 | * $Id$ |
---|
12 | */ |
---|
13 | |
---|
14 | #if HAVE_CONFIG_H |
---|
15 | #include "config.h" |
---|
16 | #endif |
---|
17 | |
---|
18 | #include "imfs.h" |
---|
19 | |
---|
20 | static const rtems_filesystem_file_handlers_r IMFS_device_handlers = { |
---|
21 | device_open, |
---|
22 | device_close, |
---|
23 | device_read, |
---|
24 | device_write, |
---|
25 | device_ioctl, |
---|
26 | device_lseek, |
---|
27 | IMFS_stat, |
---|
28 | device_ftruncate, |
---|
29 | rtems_filesystem_default_fsync_or_fdatasync, |
---|
30 | rtems_filesystem_default_fsync_or_fdatasync, |
---|
31 | rtems_filesystem_default_fcntl |
---|
32 | }; |
---|
33 | |
---|
34 | static IMFS_jnode_t *IMFS_node_initialize_device( |
---|
35 | IMFS_jnode_t *node, |
---|
36 | const IMFS_types_union *info |
---|
37 | ) |
---|
38 | { |
---|
39 | node->info.device.major = info->device.major; |
---|
40 | node->info.device.minor = info->device.minor; |
---|
41 | |
---|
42 | return node; |
---|
43 | } |
---|
44 | |
---|
45 | const IMFS_node_control IMFS_node_control_device = { |
---|
46 | .imfs_type = IMFS_DEVICE, |
---|
47 | .handlers = &IMFS_device_handlers, |
---|
48 | .node_initialize = IMFS_node_initialize_device, |
---|
49 | .node_remove = IMFS_node_remove_default, |
---|
50 | .node_destroy = IMFS_node_destroy_default |
---|
51 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.