From: braam Date: Thu, 18 Sep 2003 18:12:33 +0000 (+0000) Subject: - Niu's changes are back in. X-Git-Tag: v1_7_110~1^13~117 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=cb96967dd4c6bc4f2020bf189794e07867f7247d;p=fs%2Flustre-release.git - Niu's changes are back in. - Changed utime.c to use a non-null time --- diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index ee16bba..b025ea9 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -790,3 +790,32 @@ void ll_umount_begin(struct super_block *sb) EXIT; } + +int ll_prep_inode(struct obd_export *exp, struct inode **inode, + struct ptlrpc_request *req, int offset, struct super_block *sb) +{ + struct lustre_md md; + int rc = 0; + + rc = mdc_req2lustre_md(req, offset, exp, &md); + if (rc) + RETURN(rc); + + if (*inode) + ll_update_inode(*inode, md.body, md.lsm); + else { + LASSERT(sb); + *inode = ll_iget(sb, md.body->ino, &md); + if (!*inode || is_bad_inode(*inode)) { + /* free the lsm if we allocated one above */ + if (md.lsm != NULL) + obd_free_memmd(exp, &md.lsm); + /* XXX might need iput() for bad inode */ + rc = -ENOMEM; + CERROR("new_inode -fatal: rc %d\n", rc); + LBUG(); + } + } + + RETURN(rc); +}