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

Function tmpfs_mkdir

fs/tmpfs/fs_tmpfs.c:2460–2487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2458 ****************************************************************************/
2459
2460static int tmpfs_mkdir(FAR struct inode *mountpt, FAR const char *relpath,
2461 mode_t mode)
2462{
2463 FAR struct tmpfs_s *fs;
2464 int ret;
2465
2466 finfo("mountpt: %p relpath: %s mode: %04x\n", mountpt, relpath, mode);
2467 DEBUGASSERT(mountpt != NULL && relpath != NULL);
2468
2469 /* Get the file system structure from the inode reference. */
2470
2471 fs = mountpt->i_private;
2472 DEBUGASSERT(fs != NULL && fs->tfs_root.tde_object != NULL);
2473
2474 /* Get exclusive access to the file system */
2475
2476 ret = tmpfs_lock(fs);
2477 if (ret < 0)
2478 {
2479 return ret;
2480 }
2481
2482 /* Create the directory. */
2483
2484 ret = tmpfs_create_directory(fs, relpath, NULL);
2485 tmpfs_unlock(fs);
2486 return ret;
2487}
2488
2489/****************************************************************************
2490 * Name: tmpfs_rmdir

Callers

nothing calls this directly

Calls 1

tmpfs_create_directoryFunction · 0.85

Tested by

no test coverage detected