| 1306 | ****************************************************************************/ |
| 1307 | |
| 1308 | static 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 |
nothing calls this directly
no test coverage detected