Skip to content
Snippets Groups Projects
Commit 71988931 authored by Eric Mei's avatar Eric Mei
Browse files

liblustre:

 - must update kms after write
parent db17d96d
No related branches found
No related tags found
No related merge requests found
...@@ -692,6 +692,9 @@ out_cleanup: ...@@ -692,6 +692,9 @@ out_cleanup:
RETURN(ERR_PTR(rc)); RETURN(ERR_PTR(rc));
} }
void lov_increase_kms(struct obd_export *exp, struct lov_stripe_md *lsm,
obd_off size);
struct llu_sysio_callback_args* struct llu_sysio_callback_args*
llu_file_write(struct inode *inode, const struct iovec *iovec, llu_file_write(struct inode *inode, const struct iovec *iovec,
size_t iovlen, loff_t pos) size_t iovlen, loff_t pos)
...@@ -700,6 +703,7 @@ llu_file_write(struct inode *inode, const struct iovec *iovec, ...@@ -700,6 +703,7 @@ llu_file_write(struct inode *inode, const struct iovec *iovec,
struct ll_file_data *fd = lli->lli_file_data; struct ll_file_data *fd = lli->lli_file_data;
struct lustre_handle lockh = {0}; struct lustre_handle lockh = {0};
struct lov_stripe_md *lsm = lli->lli_smd; struct lov_stripe_md *lsm = lli->lli_smd;
struct obd_export *exp = NULL;
ldlm_policy_data_t policy; ldlm_policy_data_t policy;
struct llu_sysio_callback_args *lsca; struct llu_sysio_callback_args *lsca;
struct llu_sysio_cookie *cookie; struct llu_sysio_cookie *cookie;
...@@ -713,6 +717,10 @@ llu_file_write(struct inode *inode, const struct iovec *iovec, ...@@ -713,6 +717,10 @@ llu_file_write(struct inode *inode, const struct iovec *iovec,
LASSERT(iovlen <= MAX_IOVEC); LASSERT(iovlen <= MAX_IOVEC);
exp = llu_i2obdexp(inode);
if (exp == NULL)
RETURN(ERR_PTR(-EINVAL));
OBD_ALLOC(lsca, sizeof(*lsca)); OBD_ALLOC(lsca, sizeof(*lsca));
if (!lsca) if (!lsca)
RETURN(ERR_PTR(-ENOMEM)); RETURN(ERR_PTR(-ENOMEM));
...@@ -745,12 +753,10 @@ llu_file_write(struct inode *inode, const struct iovec *iovec, ...@@ -745,12 +753,10 @@ llu_file_write(struct inode *inode, const struct iovec *iovec,
/* save cookie */ /* save cookie */
lsca->cookies[lsca->ncookies++] = cookie; lsca->cookies[lsca->ncookies++] = cookie;
pos += count; pos += count;
/* file size grow. XXX should be done here? */ lov_increase_kms(exp, lsm, pos);
if (pos > lli->lli_st_size) { /* file size grow */
if (pos > lli->lli_st_size)
lli->lli_st_size = pos; lli->lli_st_size = pos;
set_bit(LLI_F_PREFER_EXTENDED_SIZE,
&lli->lli_flags);
}
} else { } else {
llu_extent_unlock(fd, inode, lsm, LCK_PW, &lockh); llu_extent_unlock(fd, inode, lsm, LCK_PW, &lockh);
GOTO(err_out, err = PTR_ERR(cookie)); GOTO(err_out, err = PTR_ERR(cookie));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment