|
@@ -250,6 +250,34 @@ encode_wcc_data(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
|
|
|
return encode_post_op_attr(rqstp, p, fhp);
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * Fill in the pre_op attr for the wcc data
|
|
|
+ */
|
|
|
+void fill_pre_wcc(struct svc_fh *fhp)
|
|
|
+{
|
|
|
+ struct inode *inode;
|
|
|
+ struct kstat stat;
|
|
|
+ __be32 err;
|
|
|
+
|
|
|
+ if (fhp->fh_pre_saved)
|
|
|
+ return;
|
|
|
+
|
|
|
+ inode = d_inode(fhp->fh_dentry);
|
|
|
+ err = fh_getattr(fhp, &stat);
|
|
|
+ if (err) {
|
|
|
+ /* Grab the times from inode anyway */
|
|
|
+ stat.mtime = inode->i_mtime;
|
|
|
+ stat.ctime = inode->i_ctime;
|
|
|
+ stat.size = inode->i_size;
|
|
|
+ }
|
|
|
+
|
|
|
+ fhp->fh_pre_mtime = stat.mtime;
|
|
|
+ fhp->fh_pre_ctime = stat.ctime;
|
|
|
+ fhp->fh_pre_size = stat.size;
|
|
|
+ fhp->fh_pre_change = nfsd4_change_attribute(&stat, inode);
|
|
|
+ fhp->fh_pre_saved = true;
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* Fill in the post_op attr for the wcc data
|
|
|
*/
|
|
@@ -261,7 +289,8 @@ void fill_post_wcc(struct svc_fh *fhp)
|
|
|
printk("nfsd: inode locked twice during operation.\n");
|
|
|
|
|
|
err = fh_getattr(fhp, &fhp->fh_post_attr);
|
|
|
- fhp->fh_post_change = nfsd4_change_attribute(d_inode(fhp->fh_dentry));
|
|
|
+ fhp->fh_post_change = nfsd4_change_attribute(&fhp->fh_post_attr,
|
|
|
+ d_inode(fhp->fh_dentry));
|
|
|
if (err) {
|
|
|
fhp->fh_post_saved = false;
|
|
|
/* Grab the ctime anyway - set_change_info might use it */
|