fs-api.c (dovecot-2.3.16) | : | fs-api.c (dovecot-2.3.17) | ||
---|---|---|---|---|
skipping to change at line 1098 | skipping to change at line 1098 | |||
ret = file->fs->v.get_nlinks(file, nlinks_r); | ret = file->fs->v.get_nlinks(file, nlinks_r); | |||
} T_END; | } T_END; | |||
if (!(ret < 0 && errno == EAGAIN)) | if (!(ret < 0 && errno == EAGAIN)) | |||
fs_file_timing_end(file, FS_OP_STAT); | fs_file_timing_end(file, FS_OP_STAT); | |||
return ret; | return ret; | |||
} | } | |||
int fs_default_copy(struct fs_file *src, struct fs_file *dest) | int fs_default_copy(struct fs_file *src, struct fs_file *dest) | |||
{ | { | |||
int tmp_errno; | int tmp_errno; | |||
/* we're going to be counting this as read+write, so remove the | /* we're going to be counting this as read+write, so don't update | |||
copy_count we just added */ | copy_count */ | |||
dest->fs->stats.copy_count--; | dest->copy_counted = TRUE; | |||
if (dest->copy_src != NULL) { | if (dest->copy_src != NULL) { | |||
i_assert(src == NULL || src == dest->copy_src); | i_assert(src == NULL || src == dest->copy_src); | |||
if (dest->copy_output == NULL) { | if (dest->copy_output == NULL) { | |||
i_assert(dest->copy_input == NULL); | i_assert(dest->copy_input == NULL); | |||
if (fs_write_stream_finish_async(dest) <= 0) | if (fs_write_stream_finish_async(dest) <= 0) | |||
return -1; | return -1; | |||
dest->copy_src = NULL; | dest->copy_src = NULL; | |||
return 0; | return 0; | |||
} | } | |||
skipping to change at line 1166 | skipping to change at line 1166 | |||
fs_set_error(src->event, ENOTSUP, "fs_copy() not supported"); | fs_set_error(src->event, ENOTSUP, "fs_copy() not supported"); | |||
return -1; | return -1; | |||
} | } | |||
fs_file_timing_start(dest, FS_OP_COPY); | fs_file_timing_start(dest, FS_OP_COPY); | |||
T_BEGIN { | T_BEGIN { | |||
ret = src->fs->v.copy(src, dest); | ret = src->fs->v.copy(src, dest); | |||
} T_END; | } T_END; | |||
if (!(ret < 0 && errno == EAGAIN)) { | if (!(ret < 0 && errno == EAGAIN)) { | |||
fs_file_timing_end(dest, FS_OP_COPY); | fs_file_timing_end(dest, FS_OP_COPY); | |||
dest->fs->stats.copy_count++; | if (dest->copy_counted) | |||
dest->copy_counted = FALSE; | ||||
else | ||||
dest->fs->stats.copy_count++; | ||||
dest->metadata_changed = FALSE; | dest->metadata_changed = FALSE; | |||
} | } | |||
return ret; | return ret; | |||
} | } | |||
int fs_copy_finish_async(struct fs_file *dest) | int fs_copy_finish_async(struct fs_file *dest) | |||
{ | { | |||
int ret; | int ret; | |||
T_BEGIN { | T_BEGIN { | |||
ret = dest->fs->v.copy(NULL, dest); | ret = dest->fs->v.copy(NULL, dest); | |||
} T_END; | } T_END; | |||
if (!(ret < 0 && errno == EAGAIN)) { | if (!(ret < 0 && errno == EAGAIN)) { | |||
fs_file_timing_end(dest, FS_OP_COPY); | fs_file_timing_end(dest, FS_OP_COPY); | |||
dest->fs->stats.copy_count++; | if (dest->copy_counted) | |||
dest->copy_counted = FALSE; | ||||
else | ||||
dest->fs->stats.copy_count++; | ||||
dest->metadata_changed = FALSE; | dest->metadata_changed = FALSE; | |||
} | } | |||
return ret; | return ret; | |||
} | } | |||
int fs_rename(struct fs_file *src, struct fs_file *dest) | int fs_rename(struct fs_file *src, struct fs_file *dest) | |||
{ | { | |||
int ret; | int ret; | |||
i_assert(src->fs == dest->fs); | i_assert(src->fs == dest->fs); | |||
End of changes. 3 change blocks. | ||||
5 lines changed or deleted | 11 lines changed or added |