/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
- * Lustre Light file operations
+ * Lustre Light Super operations
*
* Copyright (c) 2002, 2003 Cluster File Systems, Inc.
*
/* already opened? */
if (lli->lli_open_count++)
RETURN(0);
-
+
LASSERT(!lli->lli_file_data);
OBD_ALLOC(fd, sizeof(*fd));
ENTRY;
/* clear group lock, if present */
- if (fd->fd_flags & LL_FILE_GROUP_LOCKED) {
+ if (fd->fd_flags & LL_FILE_CW_LOCKED) {
struct lov_stripe_md *lsm = llu_i2info(inode)->lli_smd;
- fd->fd_flags &= ~(LL_FILE_GROUP_LOCKED|LL_FILE_IGNORE_LOCK);
- rc = llu_extent_unlock(fd, inode, lsm, LCK_GROUP,
- &fd->fd_cwlockh);
+ fd->fd_flags &= ~(LL_FILE_CW_LOCKED|LL_FILE_IGNORE_LOCK);
+ rc = llu_extent_unlock(fd, inode, lsm, LCK_CW, &fd->fd_cwlockh);
}
- obdo.o_id = lli->lli_st_ino;
- obdo.o_valid = OBD_MD_FLID;
- valid = OBD_MD_FLTYPE | OBD_MD_FLMODE | OBD_MD_FLSIZE |OBD_MD_FLBLOCKS |
- OBD_MD_FLATIME | OBD_MD_FLMTIME | OBD_MD_FLCTIME;
+ valid = OBD_MD_FLID;
if (test_bit(LLI_F_HAVE_OST_SIZE_LOCK, &lli->lli_flags))
valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS;
- obdo_from_inode(&obdo, inode, valid);
-
+ memset(&obdo, 0, sizeof(obdo));
+ obdo.o_id = lli->lli_st_ino;
+ obdo.o_mode = lli->lli_st_mode;
+ obdo.o_size = lli->lli_st_size;
+ obdo.o_blocks = lli->lli_st_blocks;
if (0 /* ll_is_inode_dirty(inode) */) {
obdo.o_flags = MDS_BFLAG_UNCOMMITTED_WRITES;
- obdo.o_valid |= OBD_MD_FLFLAGS;
+ valid |= OBD_MD_FLFLAGS;
}
+ obdo.o_valid = valid;
rc = mdc_close(mdc_exp, &obdo, och, &req);
if (rc == EAGAIN) {
/* We are the last writer, so the MDS has instructed us to get
//ll_queue_done_writing(inode);
rc = 0;
} else if (rc) {
- CERROR("inode %lu close failed: rc %d\n", lli->lli_st_ino, rc);
+ CERROR("inode %lu close failed: rc = %d\n", lli->lli_st_ino, rc);
} else {
rc = llu_objects_destroy(req, inode);
if (rc)