Lines Matching refs:ed
75 struct e4defrag_data *ed;
84 ed = malloc(sizeof(*ed));
85 if (!ed) {
89 memset(ed, 0 ,sizeof(*ed));
95 ed->donor_fd = open(donor_name, O_CREAT|O_WRONLY, 0644);
96 if (ed->donor_fd < 0) {
98 log_err("Can't open donor file %s err:%d\n", donor_name, ed->donor_fd);
99 free(ed);
105 r = fallocate(ed->donor_fd, 0, td->o.start_offset, __len);
109 r = fstat(ed->donor_fd, &stub);
113 ed->bsz = stub.st_blksize;
114 td->io_ops_data = ed;
118 close(ed->donor_fd);
119 free(ed);
125 struct e4defrag_data *ed = td->io_ops_data;
126 if (ed) {
127 if (ed->donor_fd >= 0)
128 close(ed->donor_fd);
129 free(ed);
141 struct e4defrag_data *ed = td->io_ops_data;
156 ret = fallocate(ed->donor_fd, 0, io_u->offset, io_u->xfer_buflen);
162 me.donor_fd = ed->donor_fd;
163 me.orig_start = io_u->offset / ed->bsz;
165 len = (io_u->offset + io_u->xfer_buflen + ed->bsz -1);
166 me.len = len / ed->bsz - me.orig_start;
169 len = me.moved_len * ed->bsz;
187 ret = ftruncate(ed->donor_fd, 0);