From: shaver Date: Sat, 26 Jul 2003 17:58:57 +0000 (+0000) Subject: b=1590, (partial 948): X-Git-Tag: v1_7_110~1^13~162 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=9c6bbfd9cae0d219f8a0f682a5043c234c4ff6b4;p=fs%2Flustre-release.git b=1590, (partial 948): Stop flushing on close, and instead flush all outstanding client data atomically with the destruction of the final stripe. And when flushing for destroy, or other cases of truncate-to-zero, send a hint with the AST to indicate that dirty data should be discarded, instead of being written back. r=zab/phil --- diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 5e798d6..2753b31 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -606,7 +606,10 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr) struct ldlm_extent extent = { .start = attr->ia_size, .end = OBD_OBJECT_EOF }; struct lustre_handle lockh = { 0 }; - int err; + int err, ast_flags = 0; + /* XXX when we fix the AST intents to pass the discard-range + * XXX extent, make ast_flags always LDLM_AST_DISCARD_DATA + * XXX here. */ /* Writeback uses inode->i_size to determine how far out * its cached pages go. ll_truncate gets a PW lock, canceling @@ -619,8 +622,10 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr) * nodes through dirtying and writeback of final cached * pages. This last one is especially bad for racing * o_append users on other nodes. */ + if (extent.start == 0) + ast_flags = LDLM_AST_DISCARD_DATA; rc = ll_extent_lock_no_validate(NULL, inode, lsm, LCK_PW, - &extent, &lockh); + &extent, &lockh, ast_flags); if (rc != ELDLM_OK) { if (rc > 0) RETURN(-ENOLCK);