Lines Matching refs:new
137 struct pnfs_block_extent *new, bool merge_ok) in __ext_tree_insert() argument
146 if (new->be_f_offset < be->be_f_offset) { in __ext_tree_insert()
147 if (merge_ok && ext_can_merge(new, be)) { in __ext_tree_insert()
148 be->be_f_offset = new->be_f_offset; in __ext_tree_insert()
150 be->be_v_offset = new->be_v_offset; in __ext_tree_insert()
151 be->be_length += new->be_length; in __ext_tree_insert()
156 } else if (new->be_f_offset >= ext_f_end(be)) { in __ext_tree_insert()
157 if (merge_ok && ext_can_merge(be, new)) { in __ext_tree_insert()
158 be->be_length += new->be_length; in __ext_tree_insert()
168 rb_link_node(&new->be_node, parent, p); in __ext_tree_insert()
169 rb_insert_color(&new->be_node, root); in __ext_tree_insert()
172 nfs4_put_deviceid_node(new->be_device); in __ext_tree_insert()
173 kfree(new); in __ext_tree_insert()
201 struct pnfs_block_extent *new; in __ext_tree_remove() local
203 new = kzalloc(sizeof(*new), GFP_ATOMIC); in __ext_tree_remove()
204 if (!new) in __ext_tree_remove()
209 new->be_f_offset = end; in __ext_tree_remove()
211 new->be_v_offset = in __ext_tree_remove()
214 new->be_length = len2; in __ext_tree_remove()
215 new->be_state = be->be_state; in __ext_tree_remove()
216 new->be_tag = be->be_tag; in __ext_tree_remove()
217 new->be_device = nfs4_get_deviceid(be->be_device); in __ext_tree_remove()
219 __ext_tree_insert(root, new, true); in __ext_tree_remove()
255 ext_tree_insert(struct pnfs_block_layout *bl, struct pnfs_block_extent *new) in ext_tree_insert() argument
261 switch (new->be_state) { in ext_tree_insert()
277 be = __ext_tree_search(root, new->be_f_offset); in ext_tree_insert()
278 if (!be || be->be_f_offset >= ext_f_end(new)) { in ext_tree_insert()
279 __ext_tree_insert(root, new, true); in ext_tree_insert()
280 } else if (new->be_f_offset >= be->be_f_offset) { in ext_tree_insert()
281 if (ext_f_end(new) <= ext_f_end(be)) { in ext_tree_insert()
282 nfs4_put_deviceid_node(new->be_device); in ext_tree_insert()
283 kfree(new); in ext_tree_insert()
285 sector_t new_len = ext_f_end(new) - ext_f_end(be); in ext_tree_insert()
286 sector_t diff = new->be_length - new_len; in ext_tree_insert()
288 new->be_f_offset += diff; in ext_tree_insert()
289 new->be_v_offset += diff; in ext_tree_insert()
290 new->be_length = new_len; in ext_tree_insert()
293 } else if (ext_f_end(new) <= ext_f_end(be)) { in ext_tree_insert()
294 new->be_length = be->be_f_offset - new->be_f_offset; in ext_tree_insert()
295 __ext_tree_insert(root, new, true); in ext_tree_insert()
298 sector_t new_len = ext_f_end(new) - ext_f_end(be); in ext_tree_insert()
299 sector_t diff = new->be_length - new_len; in ext_tree_insert()
301 split = kmemdup(new, sizeof(*new), GFP_ATOMIC); in ext_tree_insert()
308 split->be_device = nfs4_get_deviceid(new->be_device); in ext_tree_insert()
311 new->be_f_offset += diff; in ext_tree_insert()
312 new->be_v_offset += diff; in ext_tree_insert()
313 new->be_length = new_len; in ext_tree_insert()
383 struct pnfs_block_extent *new; in ext_tree_split() local
386 new = kzalloc(sizeof(*new), GFP_ATOMIC); in ext_tree_split()
387 if (!new) in ext_tree_split()
392 new->be_f_offset = split; in ext_tree_split()
394 new->be_v_offset = be->be_v_offset + be->be_length; in ext_tree_split()
395 new->be_length = orig_len - be->be_length; in ext_tree_split()
396 new->be_state = be->be_state; in ext_tree_split()
397 new->be_tag = be->be_tag; in ext_tree_split()
398 new->be_device = nfs4_get_deviceid(be->be_device); in ext_tree_split()
400 __ext_tree_insert(root, new, false); in ext_tree_split()