Whamcloud - gitweb
Fix inode->i_blksize (for fstat st_blksize and hopefully improved cp
authoradilger <adilger>
Fri, 11 Apr 2003 04:55:39 +0000 (04:55 +0000)
committeradilger <adilger>
Fri, 11 Apr 2003 04:55:39 +0000 (04:55 +0000)
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

index c72d9a6..8b30a20 100644 (file)
@@ -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;