Lines Matching refs:wr

22 	struct orangefs_write_range *wr = NULL;  in orangefs_writepage_locked()  local
33 wr = (struct orangefs_write_range *)page_private(page); in orangefs_writepage_locked()
34 WARN_ON(wr->pos >= len); in orangefs_writepage_locked()
35 off = wr->pos; in orangefs_writepage_locked()
36 if (off + wr->len > len) in orangefs_writepage_locked()
39 wlen = wr->len; in orangefs_writepage_locked()
58 len, wr, NULL, NULL); in orangefs_writepage_locked()
93 struct orangefs_write_range *wrp, wr; in orangefs_writepages_work() local
121 wr.uid = ow->uid; in orangefs_writepages_work()
122 wr.gid = ow->gid; in orangefs_writepages_work()
124 0, &wr, NULL, NULL); in orangefs_writepages_work()
160 struct orangefs_write_range *wr; in orangefs_writepages_callback() local
170 wr = (struct orangefs_write_range *)page_private(page); in orangefs_writepages_callback()
174 ow->off = wr->pos; in orangefs_writepages_callback()
175 ow->len = wr->len; in orangefs_writepages_callback()
176 ow->uid = wr->uid; in orangefs_writepages_callback()
177 ow->gid = wr->gid; in orangefs_writepages_callback()
182 if (!uid_eq(ow->uid, wr->uid) || !gid_eq(ow->gid, wr->gid)) { in orangefs_writepages_callback()
188 if (ow->off + ow->len == wr->pos) { in orangefs_writepages_callback()
189 ow->len += wr->len; in orangefs_writepages_callback()
361 struct orangefs_write_range *wr; in orangefs_write_begin() local
385 struct orangefs_write_range *wr; in orangefs_write_begin() local
386 wr = (struct orangefs_write_range *)page_private(page); in orangefs_write_begin()
387 if (wr->pos + wr->len == pos && in orangefs_write_begin()
388 uid_eq(wr->uid, current_fsuid()) && in orangefs_write_begin()
389 gid_eq(wr->gid, current_fsgid())) { in orangefs_write_begin()
390 wr->len += len; in orangefs_write_begin()
399 wr = kmalloc(sizeof *wr, GFP_KERNEL); in orangefs_write_begin()
400 if (!wr) in orangefs_write_begin()
403 wr->pos = pos; in orangefs_write_begin()
404 wr->len = len; in orangefs_write_begin()
405 wr->uid = current_fsuid(); in orangefs_write_begin()
406 wr->gid = current_fsgid(); in orangefs_write_begin()
407 attach_page_private(page, wr); in orangefs_write_begin()
451 struct orangefs_write_range *wr; in orangefs_invalidatepage() local
452 wr = (struct orangefs_write_range *)page_private(page); in orangefs_invalidatepage()
458 } else if (page_offset(page) + offset <= wr->pos && in orangefs_invalidatepage()
459 wr->pos + wr->len <= page_offset(page) + offset + length) { in orangefs_invalidatepage()
465 } else if (wr->pos < page_offset(page) + offset && in orangefs_invalidatepage()
466 wr->pos + wr->len <= page_offset(page) + offset + length && in orangefs_invalidatepage()
467 page_offset(page) + offset < wr->pos + wr->len) { in orangefs_invalidatepage()
469 x = wr->pos + wr->len - (page_offset(page) + offset); in orangefs_invalidatepage()
470 WARN_ON(x > wr->len); in orangefs_invalidatepage()
471 wr->len -= x; in orangefs_invalidatepage()
472 wr->uid = current_fsuid(); in orangefs_invalidatepage()
473 wr->gid = current_fsgid(); in orangefs_invalidatepage()
475 } else if (page_offset(page) + offset <= wr->pos && in orangefs_invalidatepage()
476 page_offset(page) + offset + length < wr->pos + wr->len && in orangefs_invalidatepage()
477 wr->pos < page_offset(page) + offset + length) { in orangefs_invalidatepage()
479 x = page_offset(page) + offset + length - wr->pos; in orangefs_invalidatepage()
480 WARN_ON(x > wr->len); in orangefs_invalidatepage()
481 wr->pos += x; in orangefs_invalidatepage()
482 wr->len -= x; in orangefs_invalidatepage()
483 wr->uid = current_fsuid(); in orangefs_invalidatepage()
484 wr->gid = current_fsgid(); in orangefs_invalidatepage()
486 } else if (wr->pos < page_offset(page) + offset && in orangefs_invalidatepage()
487 page_offset(page) + offset + length < wr->pos + wr->len) { in orangefs_invalidatepage()
499 if (!((page_offset(page) + offset + length <= wr->pos) ^ in orangefs_invalidatepage()
500 (wr->pos + wr->len <= page_offset(page) + offset))) { in orangefs_invalidatepage()
505 wr->pos, wr->len); in orangefs_invalidatepage()
681 struct orangefs_write_range *wr; in orangefs_page_mkwrite() local
703 wr = (struct orangefs_write_range *)page_private(page); in orangefs_page_mkwrite()
704 if (uid_eq(wr->uid, current_fsuid()) && in orangefs_page_mkwrite()
705 gid_eq(wr->gid, current_fsgid())) { in orangefs_page_mkwrite()
706 wr->pos = page_offset(page); in orangefs_page_mkwrite()
707 wr->len = PAGE_SIZE; in orangefs_page_mkwrite()
716 wr = kmalloc(sizeof *wr, GFP_KERNEL); in orangefs_page_mkwrite()
717 if (!wr) { in orangefs_page_mkwrite()
721 wr->pos = page_offset(page); in orangefs_page_mkwrite()
722 wr->len = PAGE_SIZE; in orangefs_page_mkwrite()
723 wr->uid = current_fsuid(); in orangefs_page_mkwrite()
724 wr->gid = current_fsgid(); in orangefs_page_mkwrite()
725 attach_page_private(page, wr); in orangefs_page_mkwrite()