mqueue.c (712cba5d87a6c0e980ee5fad45734e189c4d7151) mqueue.c (194a6b5b9cb6b91a5f7d86984165a3bc55188599)
1/*
2 * POSIX message queues filesystem for Linux.
3 *
4 * Copyright (C) 2003,2004 Krzysztof Benedyczak (golbi@mat.uni.torun.pl)
5 * Michal Wronski (michal.wronski@gmail.com)
6 *
7 * Spinlocks: Mohamed Abbas (abbas.mohamed@intel.com)
8 * Lockless receive & send, fd based notify:

--- 953 unchanged lines hidden (view full) ---

962 struct ext_wait_queue wait;
963 struct ext_wait_queue *receiver;
964 struct msg_msg *msg_ptr;
965 struct mqueue_inode_info *info;
966 ktime_t expires, *timeout = NULL;
967 struct timespec ts;
968 struct posix_msg_tree_node *new_leaf = NULL;
969 int ret = 0;
1/*
2 * POSIX message queues filesystem for Linux.
3 *
4 * Copyright (C) 2003,2004 Krzysztof Benedyczak (golbi@mat.uni.torun.pl)
5 * Michal Wronski (michal.wronski@gmail.com)
6 *
7 * Spinlocks: Mohamed Abbas (abbas.mohamed@intel.com)
8 * Lockless receive & send, fd based notify:

--- 953 unchanged lines hidden (view full) ---

962 struct ext_wait_queue wait;
963 struct ext_wait_queue *receiver;
964 struct msg_msg *msg_ptr;
965 struct mqueue_inode_info *info;
966 ktime_t expires, *timeout = NULL;
967 struct timespec ts;
968 struct posix_msg_tree_node *new_leaf = NULL;
969 int ret = 0;
970 WAKE_Q(wake_q);
970 DEFINE_WAKE_Q(wake_q);
971
972 if (u_abs_timeout) {
973 int res = prepare_timeout(u_abs_timeout, &expires, &ts);
974 if (res)
975 return res;
976 timeout = &expires;
977 }
978

--- 167 unchanged lines hidden (view full) ---

1146 ret = -EAGAIN;
1147 } else {
1148 wait.task = current;
1149 wait.state = STATE_NONE;
1150 ret = wq_sleep(info, RECV, timeout, &wait);
1151 msg_ptr = wait.msg;
1152 }
1153 } else {
971
972 if (u_abs_timeout) {
973 int res = prepare_timeout(u_abs_timeout, &expires, &ts);
974 if (res)
975 return res;
976 timeout = &expires;
977 }
978

--- 167 unchanged lines hidden (view full) ---

1146 ret = -EAGAIN;
1147 } else {
1148 wait.task = current;
1149 wait.state = STATE_NONE;
1150 ret = wq_sleep(info, RECV, timeout, &wait);
1151 msg_ptr = wait.msg;
1152 }
1153 } else {
1154 WAKE_Q(wake_q);
1154 DEFINE_WAKE_Q(wake_q);
1155
1156 msg_ptr = msg_get(info);
1157
1158 inode->i_atime = inode->i_mtime = inode->i_ctime =
1159 current_time(inode);
1160
1161 /* There is now free space in queue. */
1162 pipelined_receive(&wake_q, info);

--- 305 unchanged lines hidden ---
1155
1156 msg_ptr = msg_get(info);
1157
1158 inode->i_atime = inode->i_mtime = inode->i_ctime =
1159 current_time(inode);
1160
1161 /* There is now free space in queue. */
1162 pipelined_receive(&wake_q, info);

--- 305 unchanged lines hidden ---