Whamcloud - gitweb
b=22755 Don't consume grant twice on recoverable resend
[fs/lustre-release.git] / lustre / osc / lproc_osc.c
index 9140a58..237200b 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -256,6 +256,19 @@ static int osc_wr_cur_grant_bytes(struct file *file, const char *buffer,
         return count;
 }
 
+static int osc_rd_cur_lost_grant_bytes(char *page, char **start, off_t off,
+                                       int count, int *eof, void *data)
+{
+        struct obd_device *dev = data;
+        struct client_obd *cli = &dev->u.cli;
+        int rc;
+
+        client_obd_list_lock(&cli->cl_loi_list_lock);
+        rc = snprintf(page, count, "%lu\n", cli->cl_lost_grant);
+        client_obd_list_unlock(&cli->cl_loi_list_lock);
+        return rc;
+}
+
 static int osc_rd_grant_shrink_interval(char *page, char **start, off_t off,
                                         int count, int *eof, void *data)
 {
@@ -614,6 +627,7 @@ static struct lprocfs_vars lprocfs_osc_obd_vars[] = {
         { "cur_dirty_bytes", osc_rd_cur_dirty_bytes, 0, 0 },
         { "cur_grant_bytes", osc_rd_cur_grant_bytes,
                              osc_wr_cur_grant_bytes, 0 },
+        { "cur_lost_grant_bytes", osc_rd_cur_lost_grant_bytes, 0, 0},
         { "grant_shrink_interval", osc_rd_grant_shrink_interval,
                                    osc_wr_grant_shrink_interval, 0 },
         { "create_count",    osc_rd_create_count, osc_wr_create_count, 0 },
@@ -624,8 +638,6 @@ static struct lprocfs_vars lprocfs_osc_obd_vars[] = {
         { "checksums",       osc_rd_checksum, osc_wr_checksum, 0 },
         { "checksum_type",   osc_rd_checksum_type, osc_wd_checksum_type, 0 },
         { "resend_count",    osc_rd_resend_count, osc_wr_resend_count, 0},
-        { "quota_resend_count",  lprocfs_rd_quota_resend_count,
-                                 lprocfs_wr_quota_resend_count, 0},
         { "timeouts",        lprocfs_rd_timeouts,      0, 0 },
         { "contention_seconds", osc_rd_contention_seconds,
                                 osc_wr_contention_seconds, 0 },