Whamcloud - gitweb
LU-3384 llite: use READ, WRITE around ll_rw_stats_tally()
[fs/lustre-release.git] / lustre / llite / vvp_io.c
index 27f58fc..e7ca14e 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -542,15 +542,16 @@ static int vvp_io_read_start(const struct lu_env *env,
         }
 
 out:
-        if (result >= 0) {
-                if (result < cnt)
-                        io->ci_continue = 0;
-                io->ci_nob += result;
-                ll_rw_stats_tally(ll_i2sbi(inode), current->pid,
-                                  cio->cui_fd, pos, result, 0);
-                result = 0;
-        }
-        return result;
+       if (result >= 0) {
+               if (result < cnt)
+                       io->ci_continue = 0;
+               io->ci_nob += result;
+               ll_rw_stats_tally(ll_i2sbi(inode), current->pid, cio->cui_fd,
+                                 pos, result, READ);
+               result = 0;
+       }
+
+       return result;
 }
 
 static void vvp_io_read_fini(const struct lu_env *env, const struct cl_io_slice *ios)
@@ -599,15 +600,16 @@ static int vvp_io_write_start(const struct lu_env *env,
         else
                 result = lustre_generic_file_write(file, cio, &pos);
 
-        if (result > 0) {
-                if (result < cnt)
-                        io->ci_continue = 0;
-                io->ci_nob += result;
-                ll_rw_stats_tally(ll_i2sbi(inode), current->pid,
-                                  cio->cui_fd, pos, result, 0);
-                result = 0;
-        }
-        RETURN(result);
+       if (result > 0) {
+               if (result < cnt)
+                       io->ci_continue = 0;
+               io->ci_nob += result;
+               ll_rw_stats_tally(ll_i2sbi(inode), current->pid,
+                                 cio->cui_fd, pos, result, WRITE);
+               result = 0;
+       }
+
+       RETURN(result);
 }
 
 #ifndef HAVE_VM_OP_FAULT