@@ -206,6 +206,11 @@ struct client_obd {
*/
u32 cl_dom_min_inline_repsize;
+ /* checksumming for data sent over the network */
+ unsigned int cl_checksum:1, /* 0 = disabled, 1 = enabled */
+ cl_checksum_dump:1, /* same */
+ cl_ocd_grant_param:1;
+ /* supported checksum types that are worked out at connect time */
enum lustre_sec_part cl_sp_me;
enum lustre_sec_part cl_sp_to;
struct sptlrpc_flavor cl_flvr_mgc; /* fixed flavor of mgc->mgs */
@@ -334,9 +339,6 @@ struct client_obd {
struct list_head cl_flight_waiters;
u32 cl_rpcs_in_flight;
- /* checksumming for data sent over the network */
- unsigned int cl_checksum:1, /* 0 = disabled, 1 = enabled */
- cl_checksum_dump:1; /* same */
/* supported checksum types that are worked out at connect time */
u32 cl_supp_cksum_types;
/* checksum algorithm to be used */
@@ -702,7 +702,7 @@ static void osc_announce_cached(struct client_obd *cli, struct obdo *oa,
oa->o_valid |= bits;
spin_lock(&cli->cl_loi_list_lock);
- if (OCD_HAS_FLAG(&cli->cl_import->imp_connect_data, GRANT_PARAM))
+ if (cli->cl_ocd_grant_param)
oa->o_dirty = cli->cl_dirty_grant;
else
oa->o_dirty = cli->cl_dirty_pages << PAGE_SHIFT;
@@ -735,8 +735,7 @@ static void osc_announce_cached(struct client_obd *cli, struct obdo *oa,
nrpages *= cli->cl_max_rpcs_in_flight + 1;
nrpages = max(nrpages, cli->cl_dirty_max_pages);
undirty = nrpages << PAGE_SHIFT;
- if (OCD_HAS_FLAG(&cli->cl_import->imp_connect_data,
- GRANT_PARAM)) {
+ if (cli->cl_ocd_grant_param) {
int nrextents;
/*
@@ -1070,10 +1069,10 @@ void osc_init_grant(struct client_obd *cli, struct obd_connect_data *ocd)
~chunk_mask) & chunk_mask;
/* determine maximum extent size, in #pages */
size = (u64)ocd->ocd_grant_max_blks << ocd->ocd_grant_blkbits;
- cli->cl_max_extent_pages = size >> PAGE_SHIFT;
- if (!cli->cl_max_extent_pages)
- cli->cl_max_extent_pages = 1;
+ cli->cl_max_extent_pages = (size >> PAGE_SHIFT) ? : 1;
+ cli->cl_ocd_grant_param = 1;
} else {
+ cli->cl_ocd_grant_param = 0;
cli->cl_grant_extent_tax = 0;
cli->cl_chunkbits = PAGE_SHIFT;
cli->cl_max_extent_pages = DT_MAX_BRW_PAGES;