fs: remove sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
82e76961cd
commit
0b2b5b781c
@ -100,7 +100,6 @@ int aio_cancel(int fildes, FAR struct aiocb *aiocbp)
|
||||
*/
|
||||
|
||||
ret = AIO_ALLDONE;
|
||||
sched_lock();
|
||||
aio_lock();
|
||||
|
||||
if (aiocbp)
|
||||
@ -220,7 +219,6 @@ int aio_cancel(int fildes, FAR struct aiocb *aiocbp)
|
||||
}
|
||||
|
||||
aio_unlock();
|
||||
sched_unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,6 @@ int file_mq_unlink(FAR const char *mq_name)
|
||||
|
||||
SETUP_SEARCH(&desc, fullpath, false);
|
||||
|
||||
sched_lock();
|
||||
ret = inode_find(&desc);
|
||||
if (ret < 0)
|
||||
{
|
||||
@ -175,7 +174,6 @@ int file_mq_unlink(FAR const char *mq_name)
|
||||
inode_unlock();
|
||||
mq_inode_release(inode);
|
||||
RELEASE_SEARCH(&desc);
|
||||
sched_unlock();
|
||||
return OK;
|
||||
|
||||
errout_with_lock:
|
||||
@ -186,7 +184,6 @@ errout_with_inode:
|
||||
|
||||
errout_with_search:
|
||||
RELEASE_SEARCH(&desc);
|
||||
sched_unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1181,8 +1181,6 @@ int procfs_register(FAR const struct procfs_entry_s *entry)
|
||||
newcount = g_procfs_entrycount + 1;
|
||||
newsize = newcount * sizeof(struct procfs_entry_s);
|
||||
|
||||
sched_lock();
|
||||
|
||||
newtable = (FAR struct procfs_entry_s *)
|
||||
kmm_realloc(g_procfs_entries, newsize);
|
||||
if (newtable != NULL)
|
||||
@ -1199,7 +1197,6 @@ int procfs_register(FAR const struct procfs_entry_s *entry)
|
||||
ret = OK;
|
||||
}
|
||||
|
||||
sched_unlock();
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
@ -118,15 +118,6 @@ FAR sem_t *sem_open(FAR const char *name, int oflags, ...)
|
||||
}
|
||||
}
|
||||
|
||||
/* The POSIX specification requires that the "check for the existence
|
||||
* of a semaphore and the creation of the semaphore if it does not
|
||||
* exist shall be atomic with respect to other processes executing
|
||||
* sem_open()..." A simple sched_lock() should be sufficient to meet
|
||||
* this requirement.
|
||||
*/
|
||||
|
||||
sched_lock();
|
||||
|
||||
/* Get the full path to the semaphore */
|
||||
|
||||
snprintf(fullpath, MAX_SEMPATH,
|
||||
@ -254,7 +245,6 @@ FAR sem_t *sem_open(FAR const char *name, int oflags, ...)
|
||||
}
|
||||
|
||||
RELEASE_SEARCH(&desc);
|
||||
sched_unlock();
|
||||
return sem;
|
||||
|
||||
errout_with_inode:
|
||||
@ -263,7 +253,6 @@ errout_with_inode:
|
||||
errout_with_lock:
|
||||
RELEASE_SEARCH(&desc);
|
||||
set_errno(errcode);
|
||||
sched_unlock();
|
||||
return SEM_FAILED;
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,6 @@ int sem_unlink(FAR const char *name)
|
||||
|
||||
SETUP_SEARCH(&desc, fullpath, false);
|
||||
|
||||
sched_lock();
|
||||
ret = inode_find(&desc);
|
||||
if (ret < 0)
|
||||
{
|
||||
@ -143,7 +142,6 @@ int sem_unlink(FAR const char *name)
|
||||
inode_unlock();
|
||||
ret = sem_close(&inode->u.i_nsem->ns_sem);
|
||||
RELEASE_SEARCH(&desc);
|
||||
sched_unlock();
|
||||
return ret;
|
||||
|
||||
errout_with_lock:
|
||||
@ -155,6 +153,5 @@ errout_with_inode:
|
||||
errout_with_search:
|
||||
RELEASE_SEARCH(&desc);
|
||||
set_errno(errcode);
|
||||
sched_unlock();
|
||||
return ERROR;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user