Whamcloud - gitweb
Landing b_bug974 onto HEAD (20040213_1538).
[fs/lustre-release.git] / lustre / osc / lproc_osc.c
index 5d790d5..9216ec0 100644 (file)
@@ -35,9 +35,6 @@ static struct lprocfs_vars lprocfs_obd_vars[]  = { {0} };
 static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
 #else
 
-#define OSC_MAX_RIF_MAX 32
-#define OSC_MAX_DIRTY_MB_MAX 4096 /* totally arbitrary */
-
 int osc_rd_max_pages_per_rpc(char *page, char **start, off_t off, int count,
                              int *eof, void *data)
 {
@@ -80,7 +77,7 @@ int osc_rd_max_rpcs_in_flight(char *page, char **start, off_t off, int count,
         int rc;
 
         spin_lock(&cli->cl_loi_list_lock);
-        rc = snprintf(page, count, "%d\n", cli->cl_max_rpcs_in_flight);
+        rc = snprintf(page, count, "%u\n", cli->cl_max_rpcs_in_flight);
         spin_unlock(&cli->cl_loi_list_lock);
         return rc;
 }
@@ -137,6 +134,7 @@ int osc_wr_max_dirty_mb(struct file *file, const char *buffer,
 
         spin_lock(&cli->cl_loi_list_lock);
         cli->cl_dirty_max = (obd_count)val * 1024 * 1024;
+        osc_wake_cache_waiters(cli);
         spin_unlock(&cli->cl_loi_list_lock);
 
         return count;
@@ -150,7 +148,20 @@ int osc_rd_cur_dirty_bytes(char *page, char **start, off_t off, int count,
         int rc;
 
         spin_lock(&cli->cl_loi_list_lock);
-        rc = snprintf(page, count, LPU64"\n", cli->cl_dirty);
+        rc = snprintf(page, count, "%lu\n", cli->cl_dirty);
+        spin_unlock(&cli->cl_loi_list_lock);
+        return rc;
+}
+
+int osc_rd_cur_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;
+
+        spin_lock(&cli->cl_loi_list_lock);
+        rc = snprintf(page, count, "%lu\n", cli->cl_avail_grant);
         spin_unlock(&cli->cl_loi_list_lock);
         return rc;
 }
@@ -284,17 +295,19 @@ static struct lprocfs_vars lprocfs_obd_vars[] = {
         { "blocksize",       lprocfs_rd_blksize,     0, 0 },
         { "kbytestotal",     lprocfs_rd_kbytestotal, 0, 0 },
         { "kbytesfree",      lprocfs_rd_kbytesfree,  0, 0 },
+        { "kbytesavail",     lprocfs_rd_kbytesavail, 0, 0 },
         { "filestotal",      lprocfs_rd_filestotal,  0, 0 },
         { "filesfree",       lprocfs_rd_filesfree,   0, 0 },
         //{ "filegroups",      lprocfs_rd_filegroups,  0, 0 },
         { "ost_server_uuid", lprocfs_rd_server_uuid, 0, 0 },
         { "ost_conn_uuid",   lprocfs_rd_conn_uuid, 0, 0 },
-        { "max_pages_per_rpc", osc_rd_max_pages_per_rpc, 
+        { "max_pages_per_rpc", osc_rd_max_pages_per_rpc,
                                osc_wr_max_pages_per_rpc, 0 },
-        { "max_rpcs_in_flight", osc_rd_max_rpcs_in_flight, 
+        { "max_rpcs_in_flight", osc_rd_max_rpcs_in_flight,
                                 osc_wr_max_rpcs_in_flight, 0 },
         { "max_dirty_mb", osc_rd_max_dirty_mb, osc_wr_max_dirty_mb, 0 },
         { "cur_dirty_bytes", osc_rd_cur_dirty_bytes, 0, 0 },
+        { "cur_grant_bytes", osc_rd_cur_grant_bytes, 0, 0 },
         {"create_low_watermark", osc_rd_create_low_wm, osc_wr_create_low_wm, 0},
         { "create_count", osc_rd_create_count, osc_wr_create_count, 0 },
         { "prealloc_next_id", osc_rd_prealloc_next_id, 0, 0 },
@@ -407,7 +420,7 @@ struct seq_operations osc_rpc_stats_seq_sops = {
 
 static int osc_rpc_stats_seq_open(struct inode *inode, struct file *file)
 {
-        struct proc_dir_entry *dp = inode->u.generic_ip;
+        struct proc_dir_entry *dp = PDE(inode);
         struct seq_file *seq;
         int rc;