* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
#include <sys/stat.h>
#include <sys/queue.h>
#include <fcntl.h>
-# include <sysio.h>
-# ifdef HAVE_XTIO_H
-# include <xtio.h>
-# endif
-# include <fs.h>
-# include <mount.h>
-# include <inode.h>
-# ifdef HAVE_FILE_H
-# include <file.h>
-# endif
-# include <liblustre.h>
+#include <liblustre.h>
#endif
#include "cl_object.h"
*descr = whole_file;
descr->cld_obj = clob;
descr->cld_mode = CLM_PHANTOM;
- /* The lockreq for glimpse should be mandatory,
- * otherwise, osc may decide to use lockless */
- io->ci_lockreq = CILR_MANDATORY;
+ descr->cld_enq_flags = CEF_ASYNC | CEF_MUST;
cio->cui_glimpse = 1;
- lock = cl_lock_request(env, io, descr, CEF_ASYNC,
- "glimpse", cfs_current());
+ /*
+ * CEF_ASYNC is used because glimpse sub-locks cannot
+ * deadlock (because they never conflict with other
+ * locks) and, hence, can be enqueued out-of-order.
+ *
+ * CEF_MUST protects glimpse lock from conversion into
+ * a lockless mode.
+ */
+ lock = cl_lock_request(env, io, descr, "glimpse",
+ cfs_current());
cio->cui_glimpse = 0;
if (!IS_ERR(lock)) {
result = cl_wait(env, lock);
ENTRY;
- /*
- * XXX layering violation.
- */
- if (cl_i2info(inode)->lli_smd->lsm_stripe_count == 0)
+ if (!cl_i2info(inode)->lli_smd)
RETURN(0);
result = cl_io_get(inode, &env, &io, &refcheck);