summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-10-16 15:15:03 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-10-16 15:15:03 +0200
commit21021feb60435dc213ba3723f0b347164909499d (patch)
tree31fcd418ab2abe030992b04462f7258021b737fb /cpukit
parentbsp/qoriq: Fix warnings (diff)
downloadrtems-21021feb60435dc213ba3723f0b347164909499d.tar.bz2
shell: Print null mount table entry via LSOF
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libmisc/shell/main_lsof.c48
1 files changed, 32 insertions, 16 deletions
diff --git a/cpukit/libmisc/shell/main_lsof.c b/cpukit/libmisc/shell/main_lsof.c
index 0584302f13..43bf8b18a0 100644
--- a/cpukit/libmisc/shell/main_lsof.c
+++ b/cpukit/libmisc/shell/main_lsof.c
@@ -36,20 +36,45 @@ static void print_location( const rtems_filesystem_location_info_t *loc )
);
}
+static void print_mt_entry_locations(
+ const rtems_filesystem_mount_table_entry_t *mt_entry
+)
+{
+ const rtems_chain_control *mt_entry_chain = &mt_entry->location_chain;
+ const rtems_chain_node *mt_entry_node;
+
+ for (
+ mt_entry_node = rtems_chain_immutable_first( mt_entry_chain );
+ !rtems_chain_is_tail( mt_entry_chain, mt_entry_node );
+ mt_entry_node = rtems_chain_immutable_next( mt_entry_node )
+ ) {
+ const rtems_filesystem_location_info_t *loc =
+ (const rtems_filesystem_location_info_t *) mt_entry_node;
+
+ print_location( loc );
+ }
+}
+
static void lsof(void)
{
- rtems_chain_control *mt_chain = &rtems_filesystem_mount_table;
- rtems_chain_node *mt_node = NULL;
+ const rtems_chain_control *mt_chain = &rtems_filesystem_mount_table;
+ const rtems_chain_node *mt_node;
+
+ fprintf(
+ stdout,
+ "type = null, root loc = 0x%08" PRIxPTR "\n",
+ (uintptr_t) rtems_filesystem_null_mt_entry.mt_fs_root
+ );
+
+ print_mt_entry_locations( &rtems_filesystem_null_mt_entry );
for (
- mt_node = rtems_chain_first( mt_chain );
+ mt_node = rtems_chain_immutable_first( mt_chain );
!rtems_chain_is_tail( mt_chain, mt_node );
- mt_node = rtems_chain_next( mt_node )
+ mt_node = rtems_chain_immutable_next( mt_node )
) {
rtems_filesystem_mount_table_entry_t *mt_entry =
(rtems_filesystem_mount_table_entry_t *) mt_node;
- rtems_chain_control *mt_entry_chain = &mt_entry->location_chain;
- rtems_chain_node *mt_entry_node = NULL;
fprintf(
stdout,
@@ -62,16 +87,7 @@ static void lsof(void)
(uintptr_t) mt_entry->mt_fs_root
);
- for (
- mt_entry_node = rtems_chain_first( mt_entry_chain );
- !rtems_chain_is_tail( mt_entry_chain, mt_entry_node );
- mt_entry_node = rtems_chain_next( mt_entry_node )
- ) {
- const rtems_filesystem_location_info_t *loc =
- (const rtems_filesystem_location_info_t *) mt_entry_node;
-
- print_location( loc );
- }
+ print_mt_entry_locations( mt_entry );
}
}