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

Function rpmsgfs_unlink

fs/rpmsgfs/rpmsgfs.c:1261–1299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1259 ****************************************************************************/
1260
1261static int rpmsgfs_unlink(FAR struct inode *mountpt, FAR const char *relpath)
1262{
1263 FAR struct rpmsgfs_mountpt_s *fs;
1264 FAR char *path;
1265 int ret;
1266
1267 /* Sanity checks */
1268
1269 DEBUGASSERT(mountpt && mountpt->i_private);
1270
1271 /* Get the mountpoint private data from the inode structure */
1272
1273 fs = mountpt->i_private;
1274
1275 path = lib_get_pathbuffer();
1276 if (path == NULL)
1277 {
1278 return -ENOMEM;
1279 }
1280
1281 ret = nxmutex_lock(&fs->fs_lock);
1282 if (ret < 0)
1283 {
1284 lib_put_pathbuffer(path);
1285 return ret;
1286 }
1287
1288 /* Append to the host's root directory */
1289
1290 rpmsgfs_mkpath(fs, relpath, path, PATH_MAX);
1291
1292 /* Call the host fs to perform the unlink */
1293
1294 ret = rpmsgfs_client_unlink(fs->handle, path);
1295
1296 nxmutex_unlock(&fs->fs_lock);
1297 lib_put_pathbuffer(path);
1298 return ret;
1299}
1300
1301/****************************************************************************
1302 * Name: rpmsgfs_mkdir

Callers

nothing calls this directly

Calls 4

nxmutex_lockFunction · 0.85
rpmsgfs_mkpathFunction · 0.85
rpmsgfs_client_unlinkFunction · 0.85
nxmutex_unlockFunction · 0.85

Tested by

no test coverage detected