bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainenstatic unsigned int
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainenmbox_list_get_ext_id(struct mbox_mailbox *mbox,
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen if (mbox->mbox_list_index_ext_id == (uint32_t)-1) {
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen mail_index_ext_register(mail_index_view_get_index(view),
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainenint mbox_list_index_has_changed(struct mailbox *box,
c150beda11da6fbbb1a936829550945d5e884f68Josef 'Jeff' Sipek struct mbox_mailbox *mbox = MBOX_MAILBOX(box);
aa47c9bd1d1fc70cd699c49fd1ca92dbc7615953Timo Sirainen ret = index_storage_list_index_has_changed(box, list_view, seq, quick);
53cc097d3f8cd789f3c8fa0dfdd02bcda776230eTimo Sirainen if (ret != 0 || box->storage->set->mailbox_list_index_very_dirty_syncs)
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen ext_id = mbox_list_get_ext_id(mbox, list_view);
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen mail_index_lookup_ext(list_view, seq, ext_id, &data, &expunged);
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen if (rec == NULL || expunged || rec->mtime == 0) {
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen /* doesn't exist or not synced */
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen ret = mailbox_get_path_to(box, MAILBOX_LIST_PATH_TYPE_MAILBOX, &path);
d4002fe1f64d25a792f76fb102ef7dc519cd4e24Martti Rannanjärvi mailbox_set_critical(box, "stat(%s) failed: %m", path);
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen rec->size != (uint32_t)(st.st_size & 0xffffffffU))
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainenvoid mbox_list_index_update_sync(struct mailbox *box,
c150beda11da6fbbb1a936829550945d5e884f68Josef 'Jeff' Sipek struct mbox_mailbox *mbox = MBOX_MAILBOX(box);
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen const struct mbox_index_header *mhdr = &mbox->mbox_hdr;
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen index_storage_list_index_update_sync(box, trans, seq);
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen /* get the current record */
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen list_view = mail_index_transaction_get_view(trans);
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen ext_id = mbox_list_get_ext_id(mbox, list_view);
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen mail_index_lookup_ext(list_view, seq, ext_id, &data, &expunged);
fad2e085dbb4cf09cfd99b96f9cd89994f0908beTimo Sirainen memcmp(old_rec, &new_rec, sizeof(*old_rec)) != 0)