@@ -1962,7 +1962,7 @@ struct cl_io {
/**
* Ignore lockless and do normal locking for this io.
*/
- ci_ignore_lockless:1,
+ ci_dio_lock:1,
/**
* Set if we've tried all mirrors for this read IO, if it's not set,
* the read IO will check to-be-read OSCs' status, and make fast-switch
@@ -945,9 +945,6 @@ int ll_file_open(struct inode *inode, struct file *file)
mutex_unlock(&lli->lli_och_mutex);
- /* lockless for direct IO so that it can do IO in parallel */
- if (file->f_flags & O_DIRECT)
- fd->fd_flags |= LL_FILE_LOCKLESS_IO;
fd = NULL;
/* Must do this outside lli_och_mutex lock to prevent deadlock where
@@ -1573,7 +1570,7 @@ static void ll_heat_add(struct inode *inode, enum cl_io_type iot,
ssize_t result = 0;
int rc = 0;
unsigned int retried = 0;
- unsigned int ignore_lockless = 0;
+ unsigned int dio_lock = 0;
bool is_aio = false;
struct cl_dio_aio *ci_aio = NULL;
@@ -1595,7 +1592,7 @@ static void ll_heat_add(struct inode *inode, enum cl_io_type iot,
io = vvp_env_thread_io(env);
ll_io_init(io, file, iot == CIT_WRITE, args);
io->ci_aio = ci_aio;
- io->ci_ignore_lockless = ignore_lockless;
+ io->ci_dio_lock = dio_lock;
io->ci_ndelay_tried = retried;
if (cl_io_rw_init(env, io, iot, *ppos, count) == 0) {
@@ -1675,7 +1672,7 @@ static void ll_heat_add(struct inode *inode, enum cl_io_type iot,
*ppos, count, result);
/* preserve the tried count for FLR */
retried = io->ci_ndelay_tried;
- ignore_lockless = io->ci_ignore_lockless;
+ dio_lock = io->ci_dio_lock;
goto restart;
}
@@ -1723,9 +1723,9 @@ int ll_readpage(struct file *file, struct page *vmpage)
*/
if (file->f_flags & O_DIRECT &&
lcc && lcc->lcc_type == LCC_RW &&
- !io->ci_ignore_lockless) {
+ !io->ci_dio_lock) {
unlock_page(vmpage);
- io->ci_ignore_lockless = 1;
+ io->ci_dio_lock = 1;
io->ci_need_restart = 1;
return -ENOLCK;
}
@@ -538,12 +538,12 @@ static int ll_write_begin(struct file *file, struct address_space *mapping,
}
/*
- * Direct read can fall back to buffered read, but DIO is done
+ * Direct write can fall back to buffered read, but DIO is done
* with lockless i/o, and buffered requires LDLM locking, so
* in this case we must restart without lockless.
*/
- if (!io->ci_ignore_lockless) {
- io->ci_ignore_lockless = 1;
+ if (!io->ci_dio_lock) {
+ io->ci_dio_lock = 1;
io->ci_need_restart = 1;
result = -ENOLCK;
goto out;
@@ -557,11 +557,11 @@ static int vvp_io_rw_lock(const struct lu_env *env, struct cl_io *io,
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;
+ io->ci_dio_lock = 1;
if (ll_file_nolock(vio->vui_fd->fd_file) ||
- (vio->vui_fd->fd_flags & LL_FILE_LOCKLESS_IO &&
- !io->ci_ignore_lockless))
+ (vio->vui_fd->fd_file->f_flags & O_DIRECT &&
+ !io->ci_dio_lock))
ast_flags |= CEF_NEVER;
}
@@ -402,7 +402,6 @@ struct ll_ioc_lease_id {
#define LL_FILE_GROUP_LOCKED 0x00000002
#define LL_FILE_READAHEA 0x00000004
#define LL_FILE_LOCKED_DIRECTIO 0x00000008 /* client-side locks with dio */
-#define LL_FILE_LOCKLESS_IO 0x00000010 /* server-side locks with cio */
#define LL_FILE_FLOCK_WARNING 0x00000020 /* warned about disabled flock */
#define LOV_USER_MAGIC_V1 0x0BD10BD0