Changeset 6c9b390 in rtems for cpukit/libblock
- Timestamp:
- 11/02/09 09:50:06 (14 years ago)
- Branches:
- 4.10, 4.11, 5, master
- Children:
- 5ac15a5
- Parents:
- deb22fc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libblock/src/bdbuf.c
rdeb22fc r6c9b390 1135 1135 1136 1136 /* 1137 * If this bd is already part of a group that supports the same number of 1138 * BDs per group return it. If the bd is part of another group check the 1139 * number of users and if 0 we can take this group and resize it. 1137 * If nobody waits for this BD, we may recycle it. 1140 1138 */ 1141 if (bd->group->bds_per_group == bds_per_group) 1142 { 1143 rtems_chain_extract (node); 1144 return bd; 1145 } 1146 1147 if (bd->group->users == 0) 1139 if (bd->waiters == 0) 1148 1140 { 1149 1141 /* 1150 * We use the group to locate the start of the BDs for this group. 1142 * If this bd is already part of a group that supports the same number of 1143 * BDs per group return it. If the bd is part of another group check the 1144 * number of users and if 0 we can take this group and resize it. 1151 1145 */ 1152 rtems_bdbuf_group_realloc (bd->group, bds_per_group); 1153 bd = (rtems_bdbuf_buffer*) rtems_chain_get (&bdbuf_cache.ready); 1154 return bd; 1146 if (bd->group->bds_per_group == bds_per_group) 1147 { 1148 rtems_chain_extract (node); 1149 return bd; 1150 } 1151 1152 if (bd->group->users == 0) 1153 { 1154 /* 1155 * We use the group to locate the start of the BDs for this group. 1156 */ 1157 rtems_bdbuf_group_realloc (bd->group, bds_per_group); 1158 bd = (rtems_bdbuf_buffer*) rtems_chain_get (&bdbuf_cache.ready); 1159 return bd; 1160 } 1155 1161 } 1156 1162 … … 2160 2166 rtems_chain_append (&bdbuf_cache.sync, &bd->link); 2161 2167 2168 if (bd->waiters) 2169 rtems_bdbuf_wake (&bdbuf_cache.access_waiters); 2170 2162 2171 rtems_bdbuf_wake_swapper (); 2163 2172
Note: See TracChangeset
for help on using the changeset viewer.