diff --git a/fs/inode/fs_files.c b/fs/inode/fs_files.c index 87fe3639394..225fbc424f0 100644 --- a/fs/inode/fs_files.c +++ b/fs/inode/fs_files.c @@ -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; diff --git a/fs/inode/inode.h b/fs/inode/inode.h index 83d48bdf408..a7635ecea26 100644 --- a/fs/inode/inode.h +++ b/fs/inode/inode.h @@ -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 diff --git a/fs/mqueue/mq_open.c b/fs/mqueue/mq_open.c index 35fe10e2984..ab4f9765137 100644 --- a/fs/mqueue/mq_open.c +++ b/fs/mqueue/mq_open.c @@ -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); diff --git a/fs/socket/socket.c b/fs/socket/socket.c index 4ca9f2a9a1f..318b97f4284 100644 --- a/fs/socket/socket.c +++ b/fs/socket/socket.c @@ -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); diff --git a/fs/vfs/fs_dup.c b/fs/vfs/fs_dup.c index 0662ab22f53..d7a3ce6eadb 100644 --- a/fs/vfs/fs_dup.c +++ b/fs/vfs/fs_dup.c @@ -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); diff --git a/fs/vfs/fs_epoll.c b/fs/vfs/fs_epoll.c index dce48964aff..19f0c5ba286 100644 --- a/fs/vfs/fs_epoll.c +++ b/fs/vfs/fs_epoll.c @@ -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); diff --git a/fs/vfs/fs_open.c b/fs/vfs/fs_open.c index b62aaf0cffe..8d49eb636ee 100644 --- a/fs/vfs/fs_open.c +++ b/fs/vfs/fs_open.c @@ -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);