From 32a6abe915fe60052b6549c9e610127969e578f1 Mon Sep 17 00:00:00 2001 From: shaver Date: Wed, 2 Jul 2003 13:32:34 +0000 Subject: [PATCH] Client-side portions of bug 974: push cache and dirty-page management down into 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 | 27 +++++++++++++++++++++++++++ lustre/ptlrpc/ptlrpc_lib.c | 5 +++++ 2 files changed, 32 insertions(+) diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index e53b605..4684383 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -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 */ diff --git a/lustre/ptlrpc/ptlrpc_lib.c b/lustre/ptlrpc/ptlrpc_lib.c index 59a4b8d..ccc05dc 100644 --- a/lustre/ptlrpc/ptlrpc_lib.c +++ b/lustre/ptlrpc/ptlrpc_lib.c @@ -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); -- 1.8.3.1