rpmsgblk: do not actually unlink blockdevice in rpmsgblk client

rpmsgblk client should not affect the server's use of blockdevice.

Signed-off-by: liaoao <liaoao@xiaomi.com>
This commit is contained in:
liaoao 2023-11-01 15:01:02 +08:00 committed by Xiang Xiao
parent 27f672d55a
commit 12d66da892
3 changed files with 3 additions and 39 deletions

View File

@ -143,7 +143,6 @@ static const rpmsg_ept_cb g_rpmsgblk_handler[] =
[RPMSGBLK_WRITE] = rpmsgblk_default_handler,
[RPMSGBLK_GEOMETRY] = rpmsgblk_geometry_handler,
[RPMSGBLK_IOCTL] = rpmsgblk_ioctl_handler,
[RPMSGBLK_UNLINK] = rpmsgblk_default_handler,
};
/****************************************************************************
@ -663,7 +662,8 @@ static int rpmsgblk_ioctl(FAR struct inode *inode, int cmd,
* Name: rpmsgblk_unlink
*
* Description:
* Rpmsg-blk ioctl operation
* Rpmsg-blk unlink operation. Client can not delete the actual block
* device in server's side, so return success directly.
*
* Parameters:
* inode - the blk device inode
@ -676,18 +676,7 @@ static int rpmsgblk_ioctl(FAR struct inode *inode, int cmd,
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
static int rpmsgblk_unlink(FAR struct inode *inode)
{
FAR struct rpmsgblk_s *priv = inode->i_private;
struct rpmsgblk_unlink_s msg;
int ret;
ret = rpmsgblk_send_recv(priv, RPMSGBLK_UNLINK, true, &msg.header,
sizeof(msg), NULL);
if (ret < 0)
{
ferr("unlink failed, ret=%d\n", ret);
}
return ret;
return OK;
}
#endif

View File

@ -42,7 +42,6 @@
#define RPMSGBLK_WRITE 4
#define RPMSGBLK_GEOMETRY 5
#define RPMSGBLK_IOCTL 6
#define RPMSGBLK_UNLINK 7
/****************************************************************************
* Public Types

View File

@ -73,9 +73,6 @@ static int rpmsgblk_geometry_handler(FAR struct rpmsg_endpoint *ept,
static int rpmsgblk_ioctl_handler(FAR struct rpmsg_endpoint *ept,
FAR void *data, size_t len,
uint32_t src, FAR void *priv);
static int rpmsgblk_unlink_handler(FAR struct rpmsg_endpoint *ept,
FAR void *data, size_t len,
uint32_t src, FAR void *priv);
/* Functions for creating communication with client cpu */
@ -102,7 +99,6 @@ static const rpmsg_ept_cb g_rpmsgblk_handler[] =
[RPMSGBLK_WRITE] = rpmsgblk_write_handler,
[RPMSGBLK_GEOMETRY] = rpmsgblk_geometry_handler,
[RPMSGBLK_IOCTL] = rpmsgblk_ioctl_handler,
[RPMSGBLK_UNLINK] = rpmsgblk_unlink_handler,
};
/****************************************************************************
@ -325,26 +321,6 @@ static int rpmsgblk_ioctl_handler(FAR struct rpmsg_endpoint *ept,
return rpmsg_send(ept, msg, len);
}
/****************************************************************************
* Name: rpmsgblk_unlink_handler
****************************************************************************/
static int rpmsgblk_unlink_handler(FAR struct rpmsg_endpoint *ept,
FAR void *data, size_t len,
uint32_t src, FAR void *priv)
{
FAR struct rpmsgblk_unlink_s *msg = data;
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
FAR struct rpmsgblk_server_s *server = ept->priv;
msg->header.result = server->bops->unlink(server->blknode);
#else
msg->header.result = -ENXIO;
#endif
return rpmsg_send(ept, msg, len);
}
/****************************************************************************
* Name: rpmsgblk_ns_match
****************************************************************************/