Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int dio_clu_sync(struct dio_cluster *cluster)
- {
- int err;
- struct dio_io *io;
- if (!test_bit(DIO_CLU_DIRTY, &cluster->flags))
- return 0;
- down_write(&cluster->sync_rw_lock);
- if (!test_bit(DIO_CLU_DIRTY, &cluster->flags)) {
- err = 0;
- goto out;
- }
- io = dio_io_alloc(cluster);
- if (!io) {
- err = -ENOMEM;
- goto out;
- }
- set_bit(DIO_IO_WAIT, &io->flags);
- dio_submit(WRITE, io);
- wait_for_completion(&io->comp);
- trace_dio_clu_sync(cluster->index); /* tsk */
- err = io->err;
- if (!err)
- clear_bit(DIO_CLU_DIRTY, &cluster->flags);
- dio_io_deref(io);
- out:
- up_write(&cluster->sync_rw_lock);
- return err;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement