fs/vfs: Rename files_allocate to file_allocate
align with the intention better Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
126ce6428e
commit
4af98af376
@ -155,16 +155,20 @@ void files_releaselist(FAR struct filelist *list)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: files_allocate
|
||||
* Name: file_allocate
|
||||
*
|
||||
* Description:
|
||||
* Allocate a struct files instance and associate it with an inode
|
||||
* instance. Returns the file descriptor == index into the files array.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success; a negated errno value is returned on
|
||||
* any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int files_allocate(FAR struct inode *inode, int oflags, off_t pos,
|
||||
FAR void *priv, int minfd)
|
||||
int file_allocate(FAR struct inode *inode, int oflags, off_t pos,
|
||||
FAR void *priv, int minfd)
|
||||
{
|
||||
FAR struct filelist *list;
|
||||
int ret;
|
||||
|
@ -408,16 +408,20 @@ void inode_release(FAR struct inode *inode);
|
||||
int foreach_inode(foreach_inode_t handler, FAR void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: files_allocate
|
||||
* Name: file_allocate
|
||||
*
|
||||
* Description:
|
||||
* Allocate a struct files instance and associate it with an inode
|
||||
* instance. Returns the file descriptor == index into the files array.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success; a negated errno value is returned on
|
||||
* any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int files_allocate(FAR struct inode *inode, int oflags, off_t pos,
|
||||
FAR void *priv, int minfd);
|
||||
int file_allocate(FAR struct inode *inode, int oflags, off_t pos,
|
||||
FAR void *priv, int minfd);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: dir_allocate
|
||||
|
@ -349,7 +349,7 @@ static mqd_t nxmq_vopen(FAR const char *mq_name, int oflags, va_list ap)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = files_allocate(mq.f_inode, mq.f_oflags, mq.f_pos, mq.f_priv, 0);
|
||||
ret = file_allocate(mq.f_inode, mq.f_oflags, mq.f_pos, mq.f_priv, 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
file_mq_close(&mq);
|
||||
|
@ -165,7 +165,7 @@ int sockfd_allocate(FAR struct socket *psock, int oflags)
|
||||
{
|
||||
int sockfd;
|
||||
|
||||
sockfd = files_allocate(&g_sock_inode, oflags, 0, psock, 0);
|
||||
sockfd = file_allocate(&g_sock_inode, oflags, 0, psock, 0);
|
||||
if (sockfd >= 0)
|
||||
{
|
||||
inode_addref(&g_sock_inode);
|
||||
|
@ -66,8 +66,8 @@ int file_dup(FAR struct file *filep, int minfd)
|
||||
|
||||
/* Then allocate a new file descriptor for the inode */
|
||||
|
||||
fd2 = files_allocate(filep2.f_inode, filep2.f_oflags,
|
||||
filep2.f_pos, filep2.f_priv, minfd);
|
||||
fd2 = file_allocate(filep2.f_inode, filep2.f_oflags,
|
||||
filep2.f_pos, filep2.f_priv, minfd);
|
||||
if (fd2 < 0)
|
||||
{
|
||||
file_close(&filep2);
|
||||
|
@ -198,7 +198,7 @@ static int epoll_do_create(int size, int flags)
|
||||
|
||||
/* Alloc the file descriptor */
|
||||
|
||||
fd = files_allocate(&g_epoll_inode, flags, 0, eph, 0);
|
||||
fd = file_allocate(&g_epoll_inode, flags, 0, eph, 0);
|
||||
if (fd < 0)
|
||||
{
|
||||
nxsem_destroy(&eph->sem);
|
||||
|
@ -245,8 +245,8 @@ static int nx_vopen(FAR const char *path, int oflags, va_list ap)
|
||||
|
||||
/* Allocate a new file descriptor for the inode */
|
||||
|
||||
fd = files_allocate(filep.f_inode, filep.f_oflags,
|
||||
filep.f_pos, filep.f_priv, 0);
|
||||
fd = file_allocate(filep.f_inode, filep.f_oflags,
|
||||
filep.f_pos, filep.f_priv, 0);
|
||||
if (fd < 0)
|
||||
{
|
||||
file_close(&filep);
|
||||
|
Loading…
Reference in New Issue
Block a user