summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/file.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/file.h')
-rw-r--r--src/vppinfra/file.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vppinfra/file.h b/src/vppinfra/file.h
index 6ebf5122567..4231a39b723 100644
--- a/src/vppinfra/file.h
+++ b/src/vppinfra/file.h
@@ -122,6 +122,13 @@ clib_file_set_data_available_to_write (clib_file_main_t * um,
return was_available != 0;
}
+always_inline clib_file_t *
+clib_file_get (clib_file_main_t * fm, u32 file_index)
+{
+ if (pool_is_free_index (fm->file_pool, file_index))
+ return 0;
+ return pool_elt_at_index (fm->file_pool, file_index);
+}
#endif /* included_clib_file_h */