ast_flags |= CEF_NONBLOCK;
if (io->ci_lock_no_expand)
ast_flags |= CEF_LOCK_NO_EXPAND;
+ if (vio->vui_fd) {
+ /* Group lock held means no lockless any more */
+ if (vio->vui_fd->fd_flags & LL_FILE_GROUP_LOCKED)
+ io->ci_ignore_lockless = 1;
+
+ if (ll_file_nolock(vio->vui_fd->fd_file) ||
+ (vio->vui_fd->fd_flags & LL_FILE_LOCKLESS_IO &&
+ !io->ci_ignore_lockless))
+ ast_flags |= CEF_NEVER;
+ }
result = vvp_mmap_locks(env, vio, io);
if (result == 0)
inode_unlock(inode);
written = result;
- if (result > 0 || result == -EIOCBQUEUED)
+ if (result > 0)
#ifdef HAVE_GENERIC_WRITE_SYNC_2ARGS
result = generic_write_sync(vio->vui_iocb, result);
#else
/* rewind ki_pos to where it has successfully committed */
vio->vui_iocb->ki_pos = pos + io->ci_nob - nob;
}
- if (result > 0) {
+ if (result > 0 || result == -EIOCBQUEUED) {
ll_file_set_flag(ll_i2info(inode), LLIF_DATA_MODIFIED);
if (result < cnt)
io->ci_continue = 0;
- result = 0;
+ if (result > 0)
+ result = 0;
}
RETURN(result);