MCPcopy Create free account
hub / github.com/apache/nuttx / rpmsgfs_mkdir

Function rpmsgfs_mkdir

fs/rpmsgfs/rpmsgfs.c:1308–1347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1306 ****************************************************************************/
1307
1308static int rpmsgfs_mkdir(FAR struct inode *mountpt, FAR const char *relpath,
1309 mode_t mode)
1310{
1311 FAR struct rpmsgfs_mountpt_s *fs;
1312 FAR char *path;
1313 int ret;
1314
1315 /* Sanity checks */
1316
1317 DEBUGASSERT(mountpt && mountpt->i_private);
1318
1319 /* Get the mountpoint private data from the inode structure */
1320
1321 fs = mountpt->i_private;
1322
1323 path = lib_get_pathbuffer();
1324 if (path == NULL)
1325 {
1326 return -ENOMEM;
1327 }
1328
1329 ret = nxmutex_lock(&fs->fs_lock);
1330 if (ret < 0)
1331 {
1332 lib_put_pathbuffer(path);
1333 return ret;
1334 }
1335
1336 /* Append to the host's root directory */
1337
1338 rpmsgfs_mkpath(fs, relpath, path, PATH_MAX);
1339
1340 /* Call the host FS to do the mkdir */
1341
1342 ret = rpmsgfs_client_mkdir(fs->handle, path, mode);
1343
1344 nxmutex_unlock(&fs->fs_lock);
1345 lib_put_pathbuffer(path);
1346 return ret;
1347}
1348
1349/****************************************************************************
1350 * Name: rpmsgfs_rmdir

Callers

nothing calls this directly

Calls 4

nxmutex_lockFunction · 0.85
rpmsgfs_mkpathFunction · 0.85
rpmsgfs_client_mkdirFunction · 0.85
nxmutex_unlockFunction · 0.85

Tested by

no test coverage detected