* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
int rc;
ENTRY;
+ /* Not recording */
if (!(mdd->mdd_cl.mc_flags & CLM_ON))
RETURN(0);
+ if ((mdd->mdd_cl.mc_mask & (1 << type)) == 0)
+ RETURN(0);
LASSERT(parent != NULL);
LASSERT(tname != NULL);
if (rc)
GOTO(cleanup, rc);
- la->la_valid = LA_CTIME;
- rc = mdd_attr_check_set_internal(env, mdd_cobj, la, handle, 0);
- if (rc)
- GOTO(cleanup, rc);
+ if (ma->ma_attr.la_nlink > 0 || mdd_cobj->mod_count > 0) {
+ /* update ctime of an unlinked file only if it is still
+ * opened or a link still exists */
+ la->la_valid = LA_CTIME;
+ rc = mdd_attr_check_set_internal(env, mdd_cobj, la, handle, 0);
+ if (rc)
+ GOTO(cleanup, rc);
+ }
rc = mdd_finish_unlink(env, mdd_cobj, ma, handle);
#ifdef HAVE_QUOTA_SUPPORT