[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
set_current_mode()
Question: Why some kernel code uses "current->mode = ", and another use
set_current_mode() ? I understand set_current_mode() has some SMP
implications... I see ugly mixed usage like in:
inode.c:164
add_wait_queue(&inode->i_wait, &wait);
repeat:
set_current_state(TASK_UNINTERRUPTIBLE);
if (inode->i_state & I_LOCK) {
schedule();
goto repeat;
}
remove_wait_queue(&inode->i_wait, &wait);
current->state = TASK_RUNNING;
Shouldn't it be something like:
set_current_state(TASK_RUNNING);
remove_wait_queue(&inode->i_wait, &wait);
?
--
Dan Aloni
dax@karrde.org
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.kernelnewbies.org/