Whamcloud - gitweb
Client-side portions of bug 974: push cache and dirty-page management down into
authorshaver <shaver>
Wed, 2 Jul 2003 13:32:34 +0000 (13:32 +0000)
committershaver <shaver>
Wed, 2 Jul 2003 13:32:34 +0000 (13:32 +0000)
    OSC, in preparation for pre-allocation grants.  Also fixes 975 by providing
    /proc/fs/lustre/llite/fs0/max_dirty_pages to limit client-side cache.

lustre/llite/llite_internal.h
lustre/ptlrpc/ptlrpc_lib.c

index e53b605..4684383 100644 (file)
@@ -1,2 +1,29 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ * Copyright (C) 2003 Cluster File Systems, Inc.
+ *
+ * This code is issued under the GNU General Public License.
+ * See the file COPYING in this distribution
+ */
+
+#ifndef LLITE_INTERNAL_H
+#define LLITE_INTERNAL_H
+
+struct lustre_handle;
+struct lov_stripe_md;
+
 int ll_mdc_cancel_unused(struct lustre_handle *conn, struct inode *inode,
                          int flags, void *opaque);
+int ll_rd_dirty_pages(char *page, char **start, off_t off, int count,
+                      int *eof, void *data);
+int ll_rd_max_dirty_pages(char *page, char **start, off_t off, int count,
+                          int *eof, void *data);
+int ll_wr_max_dirty_pages(struct file *file, const char *buffer,
+                          unsigned long count, void *data);
+int ll_clear_dirty_pages(struct lustre_handle *conn, struct lov_stripe_md *lsm,
+                         unsigned long start, unsigned long end);
+int ll_mark_dirty_page(struct lustre_handle *conn, struct lov_stripe_md *lsm,
+                       unsigned long index);
+
+#endif /* LLITE_INTERNAL_H */
index 59a4b8d..ccc05dc 100644 (file)
@@ -80,6 +80,11 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf)
         memcpy(server_uuid.uuid, data->ioc_inlbuf2, MIN(data->ioc_inllen2,
                                                         sizeof(server_uuid)));
 
+        init_MUTEX(&cli->cl_dirty_sem);
+        cli->cl_dirty = 0;
+        cli->cl_dirty_granted = 0;
+        cli->cl_ost_can_grant = 1;
+
         conn = ptlrpc_uuid_to_connection(&server_uuid);
         if (conn == NULL)
                 RETURN(-ENOENT);