Lines Matching full:wr
23 struct orangefs_write_range *wr = NULL; in orangefs_writepage_locked() local
34 wr = (struct orangefs_write_range *)page_private(page); in orangefs_writepage_locked()
35 WARN_ON(wr->pos >= len); in orangefs_writepage_locked()
36 off = wr->pos; in orangefs_writepage_locked()
37 if (off + wr->len > len) in orangefs_writepage_locked()
40 wlen = wr->len; in orangefs_writepage_locked()
57 len, wr, NULL, NULL); in orangefs_writepage_locked()
91 struct orangefs_write_range *wrp, wr; in orangefs_writepages_work() local
115 wr.uid = ow->uid; in orangefs_writepages_work()
116 wr.gid = ow->gid; in orangefs_writepages_work()
118 0, &wr, NULL, NULL); in orangefs_writepages_work()
153 struct orangefs_write_range *wr = folio->private; in orangefs_writepages_callback() local
156 if (!wr) { in orangefs_writepages_callback()
166 ow->off = wr->pos; in orangefs_writepages_callback()
167 ow->len = wr->len; in orangefs_writepages_callback()
168 ow->uid = wr->uid; in orangefs_writepages_callback()
169 ow->gid = wr->gid; in orangefs_writepages_callback()
174 if (!uid_eq(ow->uid, wr->uid) || !gid_eq(ow->gid, wr->gid)) { in orangefs_writepages_callback()
180 if (ow->off + ow->len == wr->pos) { in orangefs_writepages_callback()
181 ow->len += wr->len; in orangefs_writepages_callback()
314 struct orangefs_write_range *wr; in orangefs_write_begin() local
336 struct orangefs_write_range *wr; in orangefs_write_begin() local
337 wr = folio_get_private(folio); in orangefs_write_begin()
338 if (wr->pos + wr->len == pos && in orangefs_write_begin()
339 uid_eq(wr->uid, current_fsuid()) && in orangefs_write_begin()
340 gid_eq(wr->gid, current_fsgid())) { in orangefs_write_begin()
341 wr->len += len; in orangefs_write_begin()
350 wr = kmalloc(sizeof *wr, GFP_KERNEL); in orangefs_write_begin()
351 if (!wr) in orangefs_write_begin()
354 wr->pos = pos; in orangefs_write_begin()
355 wr->len = len; in orangefs_write_begin()
356 wr->uid = current_fsuid(); in orangefs_write_begin()
357 wr->gid = current_fsgid(); in orangefs_write_begin()
358 folio_attach_private(folio, wr); in orangefs_write_begin()
402 struct orangefs_write_range *wr = folio_get_private(folio); in orangefs_invalidate_folio() local
408 } else if (folio_pos(folio) + offset <= wr->pos && in orangefs_invalidate_folio()
409 wr->pos + wr->len <= folio_pos(folio) + offset + length) { in orangefs_invalidate_folio()
415 } else if (wr->pos < folio_pos(folio) + offset && in orangefs_invalidate_folio()
416 wr->pos + wr->len <= folio_pos(folio) + offset + length && in orangefs_invalidate_folio()
417 folio_pos(folio) + offset < wr->pos + wr->len) { in orangefs_invalidate_folio()
419 x = wr->pos + wr->len - (folio_pos(folio) + offset); in orangefs_invalidate_folio()
420 WARN_ON(x > wr->len); in orangefs_invalidate_folio()
421 wr->len -= x; in orangefs_invalidate_folio()
422 wr->uid = current_fsuid(); in orangefs_invalidate_folio()
423 wr->gid = current_fsgid(); in orangefs_invalidate_folio()
425 } else if (folio_pos(folio) + offset <= wr->pos && in orangefs_invalidate_folio()
426 folio_pos(folio) + offset + length < wr->pos + wr->len && in orangefs_invalidate_folio()
427 wr->pos < folio_pos(folio) + offset + length) { in orangefs_invalidate_folio()
429 x = folio_pos(folio) + offset + length - wr->pos; in orangefs_invalidate_folio()
430 WARN_ON(x > wr->len); in orangefs_invalidate_folio()
431 wr->pos += x; in orangefs_invalidate_folio()
432 wr->len -= x; in orangefs_invalidate_folio()
433 wr->uid = current_fsuid(); in orangefs_invalidate_folio()
434 wr->gid = current_fsgid(); in orangefs_invalidate_folio()
436 } else if (wr->pos < folio_pos(folio) + offset && in orangefs_invalidate_folio()
437 folio_pos(folio) + offset + length < wr->pos + wr->len) { in orangefs_invalidate_folio()
449 if (!((folio_pos(folio) + offset + length <= wr->pos) ^ in orangefs_invalidate_folio()
450 (wr->pos + wr->len <= folio_pos(folio) + offset))) { in orangefs_invalidate_folio()
455 wr->pos, wr->len); in orangefs_invalidate_folio()
461 * Above there are returns where wr is freed or where we WARN. in orangefs_invalidate_folio()
462 * Thus the following runs if wr was modified above. in orangefs_invalidate_folio()
630 struct orangefs_write_range *wr; in orangefs_page_mkwrite() local
652 wr = folio_get_private(folio); in orangefs_page_mkwrite()
653 if (uid_eq(wr->uid, current_fsuid()) && in orangefs_page_mkwrite()
654 gid_eq(wr->gid, current_fsgid())) { in orangefs_page_mkwrite()
655 wr->pos = page_offset(vmf->page); in orangefs_page_mkwrite()
656 wr->len = PAGE_SIZE; in orangefs_page_mkwrite()
665 wr = kmalloc(sizeof *wr, GFP_KERNEL); in orangefs_page_mkwrite()
666 if (!wr) { in orangefs_page_mkwrite()
670 wr->pos = page_offset(vmf->page); in orangefs_page_mkwrite()
671 wr->len = PAGE_SIZE; in orangefs_page_mkwrite()
672 wr->uid = current_fsuid(); in orangefs_page_mkwrite()
673 wr->gid = current_fsgid(); in orangefs_page_mkwrite()
674 folio_attach_private(folio, wr); in orangefs_page_mkwrite()