From b2467872ff4fa4bfb9a8eed175ea5b05b1cba411 Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 11 Apr 2003 04:55:39 +0000 Subject: [PATCH] Fix inode->i_blksize (for fstat st_blksize and hopefully improved cp performance) so that it is the maximum vector write size (num_stripes * max_iov_size) as told by obd_get_info("brw_size"). Also change the obd_get_info() API to fix some minor abuses (passing part of the key in via val, returning data via the return code). Also remove any pretense of obd_get_info() allocating memory for the caller, following normal portals caller-allocates behaviour. Make inputs and returns be fixed size, so they can be network-encoded across different arches. --- lustre/llite/iod.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lustre/llite/iod.c b/lustre/llite/iod.c index c72d9a6..8b30a20 100644 --- a/lustre/llite/iod.c +++ b/lustre/llite/iod.c @@ -242,22 +242,20 @@ static int should_writeback(void) return 0; } -static int ll_alloc_brw(struct lustre_handle *conn, +static int ll_alloc_brw(struct lustre_handle *conn, struct ll_writeback_pages *llwp) { static char key[] = "brw_size"; - unsigned long brw_size; - obd_count unused = sizeof(brw_size); - void *val; + __u32 brw_size; + __u32 vallen = sizeof(brw_size); int rc; ENTRY; memset(llwp, 0, sizeof(struct ll_writeback_pages)); - rc = obd_get_info(conn, sizeof(key) - 1, key, &unused, &val); - if ( rc != 0 ) + rc = obd_get_info(conn, sizeof(key) - 1, key, &vallen, &brw_size); + if (rc != 0) RETURN(rc); - brw_size = (unsigned long)val; LASSERT(brw_size >= PAGE_SIZE); llwp->max = brw_size >> PAGE_SHIFT; -- 1.8.3.1