提交 18a59263 编写于 作者: D Deepa Dinamani

lustre: Use long long type to print inode time

Subsequent patches in the series convert inode timestamps
to use struct timespec64 instead of struct timespec as
part of solving the y2038 problem.

Convert these print formats to use long long types to
avoid warnings and errors on conversion.
Signed-off-by: NDeepa Dinamani <deepa.kernel@gmail.com>
CC: andreas.dilger@intel.com
上级 8efd6894
...@@ -1482,8 +1482,9 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import) ...@@ -1482,8 +1482,9 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)
} }
if (attr->ia_valid & (ATTR_MTIME | ATTR_CTIME)) if (attr->ia_valid & (ATTR_MTIME | ATTR_CTIME))
CDEBUG(D_INODE, "setting mtime %lu, ctime %lu, now = %llu\n", CDEBUG(D_INODE, "setting mtime %llu, ctime %llu, now = %llu\n",
LTIME_S(attr->ia_mtime), LTIME_S(attr->ia_ctime), (unsigned long long)LTIME_S(attr->ia_mtime),
(unsigned long long)LTIME_S(attr->ia_ctime),
(s64)ktime_get_real_seconds()); (s64)ktime_get_real_seconds());
if (S_ISREG(inode->i_mode)) if (S_ISREG(inode->i_mode))
...@@ -1760,9 +1761,10 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md) ...@@ -1760,9 +1761,10 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md)
if (body->mbo_valid & OBD_MD_FLMTIME) { if (body->mbo_valid & OBD_MD_FLMTIME) {
if (body->mbo_mtime > LTIME_S(inode->i_mtime)) { if (body->mbo_mtime > LTIME_S(inode->i_mtime)) {
CDEBUG(D_INODE, CDEBUG(D_INODE,
"setting ino %lu mtime from %lu to %llu\n", "setting ino %lu mtime from %llu to %llu\n",
inode->i_ino, LTIME_S(inode->i_mtime), inode->i_ino,
body->mbo_mtime); (unsigned long long)LTIME_S(inode->i_mtime),
(unsigned long long)body->mbo_mtime);
LTIME_S(inode->i_mtime) = body->mbo_mtime; LTIME_S(inode->i_mtime) = body->mbo_mtime;
} }
lli->lli_mtime = body->mbo_mtime; lli->lli_mtime = body->mbo_mtime;
......
...@@ -844,8 +844,9 @@ void ll_update_times(struct ptlrpc_request *request, struct inode *inode) ...@@ -844,8 +844,9 @@ void ll_update_times(struct ptlrpc_request *request, struct inode *inode)
LASSERT(body); LASSERT(body);
if (body->mbo_valid & OBD_MD_FLMTIME && if (body->mbo_valid & OBD_MD_FLMTIME &&
body->mbo_mtime > LTIME_S(inode->i_mtime)) { body->mbo_mtime > LTIME_S(inode->i_mtime)) {
CDEBUG(D_INODE, "setting fid " DFID " mtime from %lu to %llu\n", CDEBUG(D_INODE, "setting fid " DFID " mtime from %llu to %llu\n",
PFID(ll_inode2fid(inode)), LTIME_S(inode->i_mtime), PFID(ll_inode2fid(inode)),
(unsigned long long)LTIME_S(inode->i_mtime),
body->mbo_mtime); body->mbo_mtime);
LTIME_S(inode->i_mtime) = body->mbo_mtime; LTIME_S(inode->i_mtime) = body->mbo_mtime;
} }
......
...@@ -3031,11 +3031,12 @@ static int lmv_merge_attr(struct obd_export *exp, ...@@ -3031,11 +3031,12 @@ static int lmv_merge_attr(struct obd_export *exp,
for (i = 0; i < lsm->lsm_md_stripe_count; i++) { for (i = 0; i < lsm->lsm_md_stripe_count; i++) {
struct inode *inode = lsm->lsm_md_oinfo[i].lmo_root; struct inode *inode = lsm->lsm_md_oinfo[i].lmo_root;
CDEBUG(D_INFO, "" DFID " size %llu, blocks %llu nlink %u, atime %lu ctime %lu, mtime %lu.\n", CDEBUG(D_INFO, "" DFID " size %llu, blocks %llu nlink %u, atime %llu ctime %llu, mtime %llu.\n",
PFID(&lsm->lsm_md_oinfo[i].lmo_fid), PFID(&lsm->lsm_md_oinfo[i].lmo_fid),
i_size_read(inode), (unsigned long long)inode->i_blocks, i_size_read(inode), (unsigned long long)inode->i_blocks,
inode->i_nlink, LTIME_S(inode->i_atime), inode->i_nlink, (unsigned long long)LTIME_S(inode->i_atime),
LTIME_S(inode->i_ctime), LTIME_S(inode->i_mtime)); (unsigned long long)LTIME_S(inode->i_ctime),
(unsigned long long)LTIME_S(inode->i_mtime));
/* for slave stripe, it needs to subtract nlink for . and .. */ /* for slave stripe, it needs to subtract nlink for . and .. */
if (i) if (i)
......
...@@ -129,9 +129,9 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data, ...@@ -129,9 +129,9 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
} }
if (op_data->op_attr.ia_valid & (ATTR_MTIME | ATTR_CTIME)) if (op_data->op_attr.ia_valid & (ATTR_MTIME | ATTR_CTIME))
CDEBUG(D_INODE, "setting mtime %ld, ctime %ld\n", CDEBUG(D_INODE, "setting mtime %lld, ctime %lld\n",
LTIME_S(op_data->op_attr.ia_mtime), (long long)LTIME_S(op_data->op_attr.ia_mtime),
LTIME_S(op_data->op_attr.ia_ctime)); (long long)LTIME_S(op_data->op_attr.ia_ctime));
mdc_setattr_pack(req, op_data, ea, ealen); mdc_setattr_pack(req, op_data, ea, ealen);
ptlrpc_request_set_replen(req); ptlrpc_request_set_replen(req);
......
...@@ -60,9 +60,9 @@ void obdo_from_inode(struct obdo *dst, struct inode *src, u32 valid) ...@@ -60,9 +60,9 @@ void obdo_from_inode(struct obdo *dst, struct inode *src, u32 valid)
u32 newvalid = 0; u32 newvalid = 0;
if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME)) if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
CDEBUG(D_INODE, "valid %x, new time %lu/%lu\n", CDEBUG(D_INODE, "valid %x, new time %llu/%llu\n",
valid, LTIME_S(src->i_mtime), valid, (long long)LTIME_S(src->i_mtime),
LTIME_S(src->i_ctime)); (long long)LTIME_S(src->i_ctime));
if (valid & OBD_MD_FLATIME) { if (valid & OBD_MD_FLATIME) {
dst->o_atime = LTIME_S(src->i_atime); dst->o_atime = LTIME_S(src->i_atime);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册