@@ -133,6 +133,7 @@ void req_capsule_shrink(struct req_capsule *pill,
extern struct req_format RQF_MDS_CONNECT;
extern struct req_format RQF_MDS_DISCONNECT;
extern struct req_format RQF_MDS_STATFS;
+extern struct req_format RQF_MDS_STATFS_NEW;
extern struct req_format RQF_MDS_GET_ROOT;
extern struct req_format RQF_MDS_SYNC;
extern struct req_format RQF_MDS_GETXATTR;
@@ -1474,6 +1474,7 @@ static int mdc_statfs(const struct lu_env *env,
time64_t max_age, u32 flags)
{
struct obd_device *obd = class_exp2obd(exp);
+ struct req_format *fmt;
struct ptlrpc_request *req;
struct obd_statfs *msfs;
struct obd_import *imp = NULL;
@@ -1490,8 +1491,12 @@ static int mdc_statfs(const struct lu_env *env,
if (!imp)
return -ENODEV;
- req = ptlrpc_request_alloc_pack(imp, &RQF_MDS_STATFS,
- LUSTRE_MDS_VERSION, MDS_STATFS);
+ fmt = &RQF_MDS_STATFS;
+ if ((exp_connect_flags2(exp) & OBD_CONNECT2_SUM_STATFS) &&
+ (flags & OBD_STATFS_SUM))
+ fmt = &RQF_MDS_STATFS_NEW;
+ req = ptlrpc_request_alloc_pack(imp, fmt, LUSTRE_MDS_VERSION,
+ MDS_STATFS);
if (!req) {
rc = -ENOMEM;
goto output;
@@ -683,6 +683,7 @@
&RQF_MDS_GET_INFO,
&RQF_MDS_GET_ROOT,
&RQF_MDS_STATFS,
+ &RQF_MDS_STATFS_NEW,
&RQF_MDS_GETATTR,
&RQF_MDS_GETATTR_NAME,
&RQF_MDS_GETXATTR,
@@ -1250,9 +1251,13 @@ struct req_format RQF_MDS_GET_ROOT =
EXPORT_SYMBOL(RQF_MDS_GET_ROOT);
struct req_format RQF_MDS_STATFS =
- DEFINE_REQ_FMT0("MDS_STATFS", mdt_body_only, obd_statfs_server);
+ DEFINE_REQ_FMT0("MDS_STATFS", empty, obd_statfs_server);
EXPORT_SYMBOL(RQF_MDS_STATFS);
+struct req_format RQF_MDS_STATFS_NEW =
+ DEFINE_REQ_FMT0("MDS_STATFS_NEW", mdt_body_only, obd_statfs_server);
+EXPORT_SYMBOL(RQF_MDS_STATFS_NEW);
+
struct req_format RQF_MDS_SYNC =
DEFINE_REQ_FMT0("MDS_SYNC", mdt_body_capa, mdt_body_only);
EXPORT_SYMBOL(RQF_MDS_SYNC);
@@ -2134,6 +2139,7 @@ u32 req_capsule_fmt_size(u32 magic, const struct req_format *fmt,
size += cfs_size_round(fmt->rf_fields[loc].d[i]->rmf_size);
return size;
}
+EXPORT_SYMBOL(req_capsule_fmt_size);
/**
* Changes the format of an RPC.