Whamcloud - gitweb
b=21460
[fs/lustre-release.git] / lustre / llite / vvp_io.c
index 5107795..a29574c 100644 (file)
@@ -201,7 +201,6 @@ static int vvp_io_rw_lock(const struct lu_env *env, struct cl_io *io,
         int ast_flags = 0;
 
         LASSERT(io->ci_type == CIT_READ || io->ci_type == CIT_WRITE);
-        LASSERT(vvp_env_io(env)->cui_oneshot == 0);
         ENTRY;
 
         ccc_io_update_iov(env, cio, io);
@@ -252,20 +251,15 @@ static int vvp_io_write_lock(const struct lu_env *env,
         struct cl_io *io = ios->cis_io;
         loff_t start;
         loff_t end;
-        int    result;
 
-        if (cl2vvp_io(env, ios)->cui_oneshot == 0) {
-                if (io->u.ci_wr.wr_append) {
-                        start = 0;
-                        end   = OBD_OBJECT_EOF;
-                } else {
-                        start = io->u.ci_wr.wr.crw_pos;
-                        end   = start + io->u.ci_wr.wr.crw_count - 1;
-                }
-                result = vvp_io_rw_lock(env, io, CLM_WRITE, start, end);
-        } else
-                result = 0;
-        return result;
+        if (io->u.ci_wr.wr_append) {
+                start = 0;
+                end   = OBD_OBJECT_EOF;
+        } else {
+                start = io->u.ci_wr.wr.crw_pos;
+                end   = start + io->u.ci_wr.wr.crw_count - 1;
+        }
+        return vvp_io_rw_lock(env, io, CLM_WRITE, start, end);
 }
 
 static int vvp_io_trunc_iter_init(const struct lu_env *env,
@@ -322,7 +316,6 @@ static int vvp_io_trunc_start(const struct lu_env *env,
         int                   result;
 
         LASSERT(cio->u.trunc.cui_locks_released);
-        LASSERT(vio->cui_oneshot == 0);
 
         LOCK_INODE_MUTEX(inode);
         DOWN_WRITE_I_ALLOC_SEM(inode);
@@ -439,7 +432,6 @@ static int vvp_io_read_start(const struct lu_env *env,
         int     exceed = 0;
 
         CLOBINVRNT(env, obj, ccc_object_invariant(obj));
-        LASSERT(vio->cui_oneshot == 0);
 
         CDEBUG(D_VFSTRACE, "read: -> [%lli, %lli)\n", pos, pos + cnt);
 
@@ -531,7 +523,7 @@ static int vvp_io_write_start(const struct lu_env *env,
 
         CDEBUG(D_VFSTRACE, "write: [%lli, %lli)\n", pos, pos + (long long)cnt);
 
-        if (cl2vvp_io(env, ios)->cui_oneshot > 0)
+        if (cio->cui_iov == NULL) /* from a temp io in ll_cl_init(). */
                 result = 0;
         else
                 result = lustre_generic_file_write(file, cio, &pos);
@@ -626,8 +618,6 @@ static int vvp_io_fault_start(const struct lu_env *env,
         loff_t               size;
         pgoff_t              last; /* last page in a file data region */
 
-        LASSERT(vio->cui_oneshot == 0);
-
         if (fio->ft_executable &&
             LTIME_S(inode->i_mtime) != vio->u.fault.ft_mtime)
                 CWARN("binary "DFID
@@ -699,7 +689,6 @@ static int vvp_io_read_page(const struct lu_env *env,
         int rc;
 
         CLOBINVRNT(env, obj, ccc_object_invariant(obj));
-        LASSERT(cl2vvp_io(env, ios)->cui_oneshot == 0);
         LASSERT(slice->cpl_obj == obj);
 
         ENTRY;
@@ -985,7 +974,6 @@ int vvp_io_init(const struct lu_env *env, struct cl_object *obj,
 
         CL_IO_SLICE_CLEAN(cio, cui_cl);
         cl_io_slice_add(io, &cio->cui_cl, obj, &vvp_io_ops);
-        vio->cui_oneshot = 0;
         vio->cui_ra_window_set = 0;
         result = 0;
         if (io->ci_type == CIT_READ || io->ci_type == CIT_WRITE) {