First round of fixes for re-implemented VFS message queues

This commit is contained in:
Gregory Nutt 2014-09-29 16:03:56 -06:00
parent 419b074b15
commit e340d89990
4 changed files with 10 additions and 8 deletions

View File

@ -149,7 +149,7 @@ int mq_close(mqd_t mqdes)
/* Decrement the reference count on the inode */ /* Decrement the reference count on the inode */
mq_release(inode); mq_inode_release(inode);
} }
return OK; return OK;
@ -169,7 +169,7 @@ int mq_close(mqd_t mqdes)
* *
****************************************************************************/ ****************************************************************************/
void mq_release(FAR struct inode *inode) void mq_inode_release(FAR struct inode *inode)
{ {
/* Decrement the reference count on the inode */ /* Decrement the reference count on the inode */

View File

@ -231,6 +231,7 @@ mqd_t mq_open(const char *mq_name, int oflags, ...)
/* Bind the message queue and the inode structure */ /* Bind the message queue and the inode structure */
INODE_SET_MQUEUE(inode);
inode->u.i_mqueue = msgq; inode->u.i_mqueue = msgq;
msgq->inode = inode; msgq->inode = inode;
} }

View File

@ -151,14 +151,15 @@ int mq_unlink(FAR const char *mq_name)
UNUSED(ret); UNUSED(ret);
/* Now we do not release the reference count in the normal way (by calling /* Now we do not release the reference count in the normal way (by calling
* inode release. Rather, we call sem_close(). sem_close will decrement * inode release. Rather, we call mq_inode_release(). mq_inode_release
* the reference count on the inode. But it will also free the message queue * will decrement the reference count on the inode. But it will also free
* if that reference count decrements to zero. Since we hold one reference, * the message queue if that reference count decrements to zero. Since we
* that can only occur if the message queue is not in-use. * hold one reference, that can only occur if the message queue is not
* in-use.
*/ */
inode_semgive(); inode_semgive();
mq_release(inode); mq_inode_release(inode);
return OK; return OK;
errout_with_semaphore: errout_with_semaphore:

View File

@ -89,7 +89,7 @@ extern "C"
* *
****************************************************************************/ ****************************************************************************/
void mq_release(FAR struct inode *inode); void mq_inode_release(FAR struct inode *inode);
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus