// SPDX-License-Identifier: GPL-2.0-or-later /* handling of writes to regular files and writing back to the server * *Copyright(C)2007RedHat,Inc.AllRightsReserved. *WrittenbyDavidHowells(dhowells@redhat.com)
*/
afs_wait_for_operation(op);
ret = afs_put_operation(op); switch (ret) { case0:
__set_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags); break; case -EACCES: case -EPERM: case -ENOKEY: case -EKEYEXPIRED: case -EKEYREJECTED: case -EKEYREVOKED: /* If there are more keys we can try, use the retry algorithm *torotatethekeys.
*/ if (wreq->netfs_priv2)
set_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags); break;
}
netfs_write_subrequest_terminated(subreq, ret < 0 ? ret : subreq->len);
}
switch (wreq->origin) { case NETFS_READAHEAD: case NETFS_READPAGE: case NETFS_READ_GAPS: case NETFS_READ_SINGLE: case NETFS_READ_FOR_WRITE: case NETFS_UNBUFFERED_READ: case NETFS_DIO_READ: return; default: break;
}
switch (subreq->error) { case -EACCES: case -EPERM: case -ENOKEY: case -EKEYEXPIRED: case -EKEYREJECTED: case -EKEYREVOKED:
afs_get_writeback_key(wreq); if (!wreq->netfs_priv)
stream->failed = true; break;
}
}
/* *writesomeofthependingdatabacktotheserver
*/ int afs_writepages(struct address_space *mapping, struct writeback_control *wbc)
{ struct afs_vnode *vnode = AFS_FS_I(mapping->host); int ret;
/* We have to be careful as we can end up racing with setattr() *truncatingthepagecachesincethecallerdoesn'ttakealockhere *topreventit.
*/ if (wbc->sync_mode == WB_SYNC_ALL)
down_read(&vnode->validate_lock); elseif (!down_read_trylock(&vnode->validate_lock)) return0;
ret = netfs_writepages(mapping, wbc);
up_read(&vnode->validate_lock); return ret;
}
/* *flushanydirtypagesforthisprocess,andcheckforwriteerrors. *-thereturnstatusfromthiscallprovidesareliableindicationof *whetheranywriteerrorsoccurredforthisprocess.
*/ int afs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
{ struct afs_vnode *vnode = AFS_FS_I(file_inode(file)); struct afs_file *af = file->private_data; int ret;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.