Lines Matching refs:memfd

35 #include "memfd-util.h"
65 if (part->memfd >= 0) {
66 /* If we can reuse the memfd, try that. For that it
72 bus_kernel_push_memfd(m->bus, part->memfd, part->data, part->mapped, part->allocated);
77 safe_close(part->memfd);
571 m->body.memfd = -1;
1199 part->memfd = -1;
1213 assert(part->memfd < 0);
1236 if (!part->data && part->memfd < 0) {
1237 part->memfd = bus_kernel_pop_memfd(m->bus, &part->data, &part->mapped, &part->allocated);
1241 if (part->memfd >= 0) {
1247 r = memfd_set_size(part->memfd, new_allocated);
1261 n = mmap(NULL, psz, PROT_READ|PROT_WRITE, MAP_SHARED, part->memfd, 0);
2679 int memfd,
2691 assert_return(memfd >= 0, -EBADF);
2697 r = memfd_set_sealed(memfd);
2701 copy_fd = dup(memfd);
2705 r = memfd_get_size(memfd, &real_size);
2741 part->memfd = copy_fd;
2755 int memfd,
2767 assert_return(memfd >= 0, -EBADF);
2772 r = memfd_set_sealed(memfd);
2776 copy_fd = dup(memfd);
2780 r = memfd_get_size(memfd, &real_size);
2828 part->memfd = copy_fd;
2998 /* If this is something we can send as memfd, then let's seal
2999 the memfd now. Note that we can send memfds as payload only
3003 if (part->memfd >= 0 &&
3006 part != m->body_end) { /* The last part may never be sent as memfd */
3014 /* Then, sync up real memfd size */
3016 r = memfd_set_size(part->memfd, sz);
3021 if (memfd_set_sealed(part->memfd) >= 0)
3049 if (part->memfd < 0 && part->is_zero && part->size < 8) {
3058 if (part->memfd >= 0)
3059 p = mmap(NULL, psz, PROT_READ, MAP_PRIVATE, part->memfd, part->memfd_offset - shift);
3080 if (part->memfd < 0)