mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 23:23:13 +00:00
2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_creat.c, libfs/src/imfs/imfs_initsupp.c, libfs/src/imfs/imfs_link.c, libfs/src/imfs/imfs_load_tar.c, libfs/src/imfs/imfs_mknod.c, libfs/src/imfs/imfs_symlink.c: Create special helper method for creating the j-node for the root directory. This lets us assume that every j-node created otherwise has a parent node.
This commit is contained in:
@@ -1,3 +1,12 @@
|
|||||||
|
2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
|
* libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_creat.c,
|
||||||
|
libfs/src/imfs/imfs_initsupp.c, libfs/src/imfs/imfs_link.c,
|
||||||
|
libfs/src/imfs/imfs_load_tar.c, libfs/src/imfs/imfs_mknod.c,
|
||||||
|
libfs/src/imfs/imfs_symlink.c: Create special helper method for
|
||||||
|
creating the j-node for the root directory. This lets us assume that
|
||||||
|
every j-node created otherwise has a parent node.
|
||||||
|
|
||||||
2010-01-18 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
2010-01-18 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
* libblock/include/rtems/bdbuf.h: Documentation. Renamed
|
* libblock/include/rtems/bdbuf.h: Documentation. Renamed
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Header file for the In-Memory File System
|
* Header file for the In-Memory File System
|
||||||
*
|
*
|
||||||
* COPYRIGHT (c) 1989-2007.
|
* COPYRIGHT (c) 1989-2010.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
@@ -322,7 +322,6 @@ extern int IMFS_eval_path(
|
|||||||
rtems_filesystem_location_info_t *pathloc /* IN/OUT */
|
rtems_filesystem_location_info_t *pathloc /* IN/OUT */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
extern int IMFS_link(
|
extern int IMFS_link(
|
||||||
rtems_filesystem_location_info_t *to_loc, /* IN */
|
rtems_filesystem_location_info_t *to_loc, /* IN */
|
||||||
rtems_filesystem_location_info_t *parent_loc, /* IN */
|
rtems_filesystem_location_info_t *parent_loc, /* IN */
|
||||||
@@ -351,6 +350,14 @@ extern int IMFS_mknod(
|
|||||||
rtems_filesystem_location_info_t *pathloc /* IN/OUT */
|
rtems_filesystem_location_info_t *pathloc /* IN/OUT */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
extern IMFS_jnode_t *IMFS_allocate_node(
|
||||||
|
IMFS_jnode_types_t type, /* IN */
|
||||||
|
const char *name, /* IN */
|
||||||
|
mode_t mode /* IN */
|
||||||
|
);
|
||||||
|
|
||||||
|
extern IMFS_jnode_t *IMFS_create_root_node(void);
|
||||||
|
|
||||||
extern IMFS_jnode_t *IMFS_create_node(
|
extern IMFS_jnode_t *IMFS_create_node(
|
||||||
rtems_filesystem_location_info_t *parent_loc, /* IN */
|
rtems_filesystem_location_info_t *parent_loc, /* IN */
|
||||||
IMFS_jnode_types_t type, /* IN */
|
IMFS_jnode_types_t type, /* IN */
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Routine to create a new in memory file system node.
|
* Routine to create a new in memory file system node.
|
||||||
*
|
*
|
||||||
* COPYRIGHT (c) 1989-1999.
|
* COPYRIGHT (c) 1989-2010.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
@@ -23,6 +23,10 @@
|
|||||||
#include "imfs.h"
|
#include "imfs.h"
|
||||||
#include <rtems/libio_.h>
|
#include <rtems/libio_.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create an IMFS filesystem node of an arbitrary type that is NOT
|
||||||
|
* the root directory node.
|
||||||
|
*/
|
||||||
IMFS_jnode_t *IMFS_create_node(
|
IMFS_jnode_t *IMFS_create_node(
|
||||||
rtems_filesystem_location_info_t *parent_loc,
|
rtems_filesystem_location_info_t *parent_loc,
|
||||||
IMFS_jnode_types_t type,
|
IMFS_jnode_types_t type,
|
||||||
@@ -32,57 +36,25 @@ IMFS_jnode_t *IMFS_create_node(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
IMFS_jnode_t *node;
|
IMFS_jnode_t *node;
|
||||||
struct timeval tv;
|
IMFS_jnode_t *parent;
|
||||||
IMFS_jnode_t *parent = NULL;
|
|
||||||
IMFS_fs_info_t *fs_info;
|
IMFS_fs_info_t *fs_info;
|
||||||
|
|
||||||
if ( parent_loc != NULL )
|
/*
|
||||||
parent = parent_loc->node_access;
|
* MUST have a parent node to call this routine.
|
||||||
|
*/
|
||||||
|
if ( parent_loc == NULL )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate an IMFS jnode
|
* Allocate filesystem node and fill in basic information
|
||||||
*/
|
*/
|
||||||
|
node = IMFS_allocate_node( type, name, mode & ~rtems_filesystem_umask );
|
||||||
node = calloc( 1, sizeof( IMFS_jnode_t ) );
|
|
||||||
if ( !node )
|
if ( !node )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/*
|
|
||||||
* Fill in the basic information
|
|
||||||
*/
|
|
||||||
|
|
||||||
node->st_nlink = 1;
|
|
||||||
node->type = type;
|
|
||||||
strncpy( node->name, name, IMFS_NAME_MAX );
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Fill in the mode and permission information for the jnode structure.
|
|
||||||
*/
|
|
||||||
|
|
||||||
node->st_mode = mode & ~rtems_filesystem_umask;
|
|
||||||
|
|
||||||
#if defined(RTEMS_POSIX_API)
|
|
||||||
node->st_uid = geteuid();
|
|
||||||
node->st_gid = getegid();
|
|
||||||
#else
|
|
||||||
node->st_uid = 0;
|
|
||||||
node->st_gid = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Now set all the times.
|
|
||||||
*/
|
|
||||||
|
|
||||||
gettimeofday( &tv, 0 );
|
|
||||||
|
|
||||||
node->stat_atime = (time_t) tv.tv_sec;
|
|
||||||
node->stat_mtime = (time_t) tv.tv_sec;
|
|
||||||
node->stat_ctime = (time_t) tv.tv_sec;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the type specific information
|
* Set the type specific information
|
||||||
*/
|
*/
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case IMFS_DIRECTORY:
|
case IMFS_DIRECTORY:
|
||||||
rtems_chain_initialize_empty(&node->info.directory.Entries);
|
rtems_chain_initialize_empty(&node->info.directory.Entries);
|
||||||
@@ -122,17 +94,86 @@ IMFS_jnode_t *IMFS_create_node(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this node has a parent, then put it in that directory list.
|
* This node MUST have a parent, so put it in that directory list.
|
||||||
*/
|
*/
|
||||||
|
parent = parent_loc->node_access;
|
||||||
if ( parent ) {
|
|
||||||
rtems_chain_append( &parent->info.directory.Entries, &node->Node );
|
|
||||||
node->Parent = parent;
|
|
||||||
|
|
||||||
fs_info = parent_loc->mt_entry->fs_info;
|
fs_info = parent_loc->mt_entry->fs_info;
|
||||||
node->st_ino = ++fs_info->ino_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
node->Parent = parent;
|
||||||
|
node->st_ino = ++fs_info->ino_count;
|
||||||
|
|
||||||
|
rtems_chain_append( &parent->info.directory.Entries, &node->Node );
|
||||||
|
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allocate filesystem node and fill in basic information
|
||||||
|
*/
|
||||||
|
IMFS_jnode_t *IMFS_allocate_node(
|
||||||
|
IMFS_jnode_types_t type,
|
||||||
|
const char *name,
|
||||||
|
mode_t mode
|
||||||
|
)
|
||||||
|
{
|
||||||
|
IMFS_jnode_t *node;
|
||||||
|
struct timeval tv;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allocate an IMFS jnode
|
||||||
|
*/
|
||||||
|
node = calloc( 1, sizeof( IMFS_jnode_t ) );
|
||||||
|
if ( !node )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Fill in the basic information
|
||||||
|
*/
|
||||||
|
node->st_nlink = 1;
|
||||||
|
node->type = type;
|
||||||
|
strncpy( node->name, name, IMFS_NAME_MAX );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Fill in the mode and permission information for the jnode structure.
|
||||||
|
*/
|
||||||
|
node->st_mode = mode;
|
||||||
|
#if defined(RTEMS_POSIX_API)
|
||||||
|
node->st_uid = geteuid();
|
||||||
|
node->st_gid = getegid();
|
||||||
|
#else
|
||||||
|
node->st_uid = 0;
|
||||||
|
node->st_gid = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Now set all the times.
|
||||||
|
*/
|
||||||
|
gettimeofday( &tv, 0 );
|
||||||
|
|
||||||
|
node->stat_atime = (time_t) tv.tv_sec;
|
||||||
|
node->stat_mtime = (time_t) tv.tv_sec;
|
||||||
|
node->stat_ctime = (time_t) tv.tv_sec;
|
||||||
|
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
IMFS_jnode_t *IMFS_create_root_node(void)
|
||||||
|
{
|
||||||
|
IMFS_jnode_t *node;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allocate filesystem node and fill in basic information
|
||||||
|
*/
|
||||||
|
node = IMFS_allocate_node( IMFS_DIRECTORY, "", (S_IFDIR | 0755) );
|
||||||
|
if ( !node )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set the type specific information
|
||||||
|
*
|
||||||
|
* NOTE: Root node is always a directory.
|
||||||
|
*/
|
||||||
|
rtems_chain_initialize_empty(&node->info.directory.Entries);
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* IMFS Initialization
|
* IMFS Initialization
|
||||||
*
|
*
|
||||||
* COPYRIGHT (c) 1989-1999.
|
* COPYRIGHT (c) 1989-2010.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
@@ -43,12 +43,11 @@ static int IMFS_determine_bytes_per_block(
|
|||||||
{
|
{
|
||||||
bool is_valid = false;
|
bool is_valid = false;
|
||||||
int bit_mask;
|
int bit_mask;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* check, whether requested bytes per block is valid
|
* check, whether requested bytes per block is valid
|
||||||
*/
|
*/
|
||||||
for (bit_mask = 16;
|
for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) {
|
||||||
!is_valid && (bit_mask <= 512);
|
|
||||||
bit_mask <<= 1) {
|
|
||||||
if (bit_mask == requested_bytes_per_block) {
|
if (bit_mask == requested_bytes_per_block) {
|
||||||
is_valid = true;
|
is_valid = true;
|
||||||
}
|
}
|
||||||
@@ -57,14 +56,12 @@ static int IMFS_determine_bytes_per_block(
|
|||||||
? requested_bytes_per_block
|
? requested_bytes_per_block
|
||||||
: default_bytes_per_block);
|
: default_bytes_per_block);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* IMFS_initialize
|
* IMFS_initialize
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int IMFS_initialize_support(
|
int IMFS_initialize_support(
|
||||||
rtems_filesystem_mount_table_entry_t *temp_mt_entry,
|
rtems_filesystem_mount_table_entry_t *temp_mt_entry,
|
||||||
const rtems_filesystem_operations_table *op_table,
|
const rtems_filesystem_operations_table *op_table,
|
||||||
@@ -87,15 +84,7 @@ int IMFS_initialize_support(
|
|||||||
*
|
*
|
||||||
* NOTE: UNIX root is 755 and owned by root/root (0/0).
|
* NOTE: UNIX root is 755 and owned by root/root (0/0).
|
||||||
*/
|
*/
|
||||||
|
temp_mt_entry->mt_fs_root.node_access = IMFS_create_root_node();
|
||||||
temp_mt_entry->mt_fs_root.node_access = IMFS_create_node(
|
|
||||||
NULL,
|
|
||||||
IMFS_DIRECTORY,
|
|
||||||
"",
|
|
||||||
( S_IFDIR | 0755 ),
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
temp_mt_entry->mt_fs_root.handlers = directory_handlers;
|
temp_mt_entry->mt_fs_root.handlers = directory_handlers;
|
||||||
temp_mt_entry->mt_fs_root.ops = op_table;
|
temp_mt_entry->mt_fs_root.ops = op_table;
|
||||||
temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS;
|
temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS;
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ int IMFS_link(
|
|||||||
/*
|
/*
|
||||||
* Verify this node can be linked to.
|
* Verify this node can be linked to.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
info.hard_link.link_node = to_loc->node_access;
|
info.hard_link.link_node = to_loc->node_access;
|
||||||
if ( info.hard_link.link_node->st_nlink >= LINK_MAX )
|
if ( info.hard_link.link_node->st_nlink >= LINK_MAX )
|
||||||
rtems_set_errno_and_return_minus_one( EMLINK );
|
rtems_set_errno_and_return_minus_one( EMLINK );
|
||||||
@@ -46,17 +45,18 @@ int IMFS_link(
|
|||||||
/*
|
/*
|
||||||
* Remove any separators at the end of the string.
|
* Remove any separators at the end of the string.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
IMFS_get_token( token, strlen( token ), new_name, &i );
|
IMFS_get_token( token, strlen( token ), new_name, &i );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a new link node.
|
* Create a new link node.
|
||||||
*
|
*
|
||||||
* NOTE: Coverity thinks this is a resource leak since a node
|
* NOTE: Coverity Id 19 reports this as a leak
|
||||||
* is created but never deleted. The scope of the allocation
|
* While technically not a leak, it indicated that IMFS_create_node
|
||||||
* is that of a file -- not this method. Coverity Id 19.
|
* was ONLY passed a NULL when we created the root node. We
|
||||||
|
* added a new IMFS_create_root_node() so this path no longer
|
||||||
|
* existed. The result was simpler code which should not have
|
||||||
|
* this path.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
new_node = IMFS_create_node(
|
new_node = IMFS_create_node(
|
||||||
parent_loc,
|
parent_loc,
|
||||||
IMFS_HARD_LINK,
|
IMFS_HARD_LINK,
|
||||||
@@ -71,7 +71,6 @@ int IMFS_link(
|
|||||||
/*
|
/*
|
||||||
* Increment the link count of the node being pointed to.
|
* Increment the link count of the node being pointed to.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
info.hard_link.link_node->st_nlink++;
|
info.hard_link.link_node->st_nlink++;
|
||||||
IMFS_update_ctime( info.hard_link.link_node );
|
IMFS_update_ctime( info.hard_link.link_node );
|
||||||
|
|
||||||
|
|||||||
@@ -98,10 +98,15 @@ int rtems_tarfs_load(
|
|||||||
IMFS_jnode_t *node;
|
IMFS_jnode_t *node;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
status = rtems_filesystem_evaluate_path(mountpoint, strlen(mountpoint),
|
status = rtems_filesystem_evaluate_path(
|
||||||
0, &root_loc, 0);
|
mountpoint,
|
||||||
|
strlen(mountpoint),
|
||||||
|
0,
|
||||||
|
&root_loc,
|
||||||
|
0
|
||||||
|
);
|
||||||
if (status != 0)
|
if (status != 0)
|
||||||
return(-1);
|
return -1;
|
||||||
|
|
||||||
if (root_loc.ops != &IMFS_ops)
|
if (root_loc.ops != &IMFS_ops)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -149,19 +154,24 @@ int rtems_tarfs_load(
|
|||||||
/*
|
/*
|
||||||
* Create a LINEAR_FILE node
|
* Create a LINEAR_FILE node
|
||||||
*
|
*
|
||||||
* NOTE: Coverity thinks this is a resource leak since a node
|
* NOTE: Coverity Id 20 reports this as a leak.
|
||||||
* is created but never deleted. The scope of the allocation
|
* While technically not a leak, it indicated that
|
||||||
* is that of a file -- not this method. Coverity Id 20.
|
* IMFS_create_node was ONLY passed a NULL when we created the
|
||||||
|
* root node. We added a new IMFS_create_root_node() so this
|
||||||
|
* path no longer existed. The result was simpler code which
|
||||||
|
* should not have this path.
|
||||||
*/
|
*/
|
||||||
else if (linkflag == REGTYPE) {
|
else if (linkflag == REGTYPE) {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
loc = root_loc;
|
loc = root_loc;
|
||||||
if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) {
|
if (IMFS_evaluate_for_make(filename, &loc, &name) == 0) {
|
||||||
node = IMFS_create_node(&loc,
|
node = IMFS_create_node(
|
||||||
|
&loc,
|
||||||
IMFS_LINEAR_FILE, (char *)name,
|
IMFS_LINEAR_FILE, (char *)name,
|
||||||
(file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG,
|
(file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG,
|
||||||
NULL);
|
NULL
|
||||||
|
);
|
||||||
node->info.linearfile.size = file_size;
|
node->info.linearfile.size = file_size;
|
||||||
node->info.linearfile.direct = &tar_image[offset];
|
node->info.linearfile.direct = &tar_image[offset];
|
||||||
}
|
}
|
||||||
@@ -170,7 +180,6 @@ int rtems_tarfs_load(
|
|||||||
offset += 512 * nblocks;
|
offset += 512 * nblocks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ int IMFS_mknod(
|
|||||||
/*
|
/*
|
||||||
* Figure out what type of IMFS node this is.
|
* Figure out what type of IMFS node this is.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( S_ISDIR(mode) )
|
if ( S_ISDIR(mode) )
|
||||||
type = IMFS_DIRECTORY;
|
type = IMFS_DIRECTORY;
|
||||||
else if ( S_ISREG(mode) )
|
else if ( S_ISREG(mode) )
|
||||||
@@ -64,9 +63,12 @@ int IMFS_mknod(
|
|||||||
/*
|
/*
|
||||||
* Allocate and fill in an IMFS jnode
|
* Allocate and fill in an IMFS jnode
|
||||||
*
|
*
|
||||||
* NOTE: Coverity thinks this is a resource leak since a node
|
* NOTE: Coverity Id 21 reports this as a leak.
|
||||||
* is created but never deleted. The scope of the allocation
|
* While technically not a leak, it indicated that IMFS_create_node
|
||||||
* is that of a file -- not this method. Coverity Id 21.
|
* was ONLY passed a NULL when we created the root node. We
|
||||||
|
* added a new IMFS_create_root_node() so this path no longer
|
||||||
|
* existed. The result was simpler code which should not have
|
||||||
|
* this path.
|
||||||
*/
|
*/
|
||||||
new_node = IMFS_create_node(
|
new_node = IMFS_create_node(
|
||||||
pathloc,
|
pathloc,
|
||||||
|
|||||||
@@ -40,13 +40,11 @@ int IMFS_symlink(
|
|||||||
/*
|
/*
|
||||||
* Remove any separators at the end of the string.
|
* Remove any separators at the end of the string.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
IMFS_get_token( node_name, strlen( node_name ), new_name, &i );
|
IMFS_get_token( node_name, strlen( node_name ), new_name, &i );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Duplicate link name
|
* Duplicate link name
|
||||||
*/
|
*/
|
||||||
|
|
||||||
info.sym_link.name = strdup(link_name);
|
info.sym_link.name = strdup(link_name);
|
||||||
if (info.sym_link.name == NULL) {
|
if (info.sym_link.name == NULL) {
|
||||||
rtems_set_errno_and_return_minus_one(ENOMEM);
|
rtems_set_errno_and_return_minus_one(ENOMEM);
|
||||||
@@ -55,13 +53,13 @@ int IMFS_symlink(
|
|||||||
/*
|
/*
|
||||||
* Create a new link node.
|
* Create a new link node.
|
||||||
*
|
*
|
||||||
* NOTE: Coverity CID 22 notes this as a resource leak. We are ignoring
|
* NOTE: Coverity CID 22 notes this as a resource leak.
|
||||||
* this analysis because in this particular case it is wrong. This
|
* While technically not a leak, it indicated that IMFS_create_node
|
||||||
* method creates a symbolic link node for the IMFS. The memory
|
* was ONLY passed a NULL when we created the root node. We
|
||||||
* allocated must persist for the life of the symbolic link not
|
* added a new IMFS_create_root_node() so this path no longer
|
||||||
* the life of the method.
|
* existed. The result was simpler code which should not have
|
||||||
|
* this path.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
new_node = IMFS_create_node(
|
new_node = IMFS_create_node(
|
||||||
parent_loc,
|
parent_loc,
|
||||||
IMFS_SYM_LINK,
|
IMFS_SYM_LINK,
|
||||||
|
|||||||
Reference in New Issue
Block a user