#include <fcntl.h>
#include <sys/uio.h>
-#include <fs.h>
+#ifdef HAVE_XTIO_H
+#include <xtio.h>
+#endif
#include <sysio.h>
#include <mount.h>
#include <inode.h>
+#ifdef HAVE_FILE_H
#include <file.h>
+#endif
#undef LIST_HEAD
rc = obd_get_info(exp, sizeof(key), &key, &vallen, &stripe);
if (rc != 0) {
CERROR("obd_get_info: rc = %d\n", rc);
- LBUG();
+ RETURN(rc);
}
LASSERT(stripe < lsm->lsm_stripe_count);
RETURN(stripe);
lsm = lli->lli_smd;
stripe = llu_lock_to_stripe_offset(inode, lock);
- l_lock(&lock->l_resource->lr_namespace->ns_lock);
+ if (stripe < 0) {
+ CERROR("lock on inode without such object\n");
+ break;
+ }
+#warning "fix l_lock() using here!"
+// l_lock(&lock->l_resource->lr_namespace->ns_lock);
kms = ldlm_extent_shift_kms(lock,
lsm->lsm_oinfo[stripe].loi_kms);
- l_unlock(&lock->l_resource->lr_namespace->ns_lock);
+// l_unlock(&lock->l_resource->lr_namespace->ns_lock);
if (lsm->lsm_oinfo[stripe].loi_kms != kms)
LDLM_DEBUG(lock, "updating kms from "LPU64" to "LPU64,
lsm->lsm_oinfo[stripe].loi_kms, kms);
GOTO(iput, rc = -ELDLM_NO_LOCK_DATA);
/* First, find out which stripe index this lock corresponds to. */
- if (lli->lli_smd->lsm_stripe_count > 1)
+ if (lli->lli_smd->lsm_stripe_count > 1) {
stripe = llu_lock_to_stripe_offset(inode, lock);
+ if (stripe < 0) {
+ CWARN("lock on inode without such object\n");
+ GOTO(iput, rc = -ELDLM_NO_LOCK_DATA);
+ }
+ }
rc = lustre_pack_reply(req, 1, &size, NULL);
if (rc) {
struct inode *llap_inode;
};
-static struct ll_async_page *llap_from_cookie(void *cookie)
-{
- struct ll_async_page *llap = cookie;
- if (llap->llap_magic != LLAP_MAGIC)
- return ERR_PTR(-EINVAL);
- return llap;
-};
-
static void llu_ap_fill_obdo(void *data, int cmd, struct obdo *oa)
{
struct ll_async_page *llap;
obd_valid valid_flags;
ENTRY;
- llap = llap_from_cookie(data);
- if (IS_ERR(llap)) {
- EXIT;
- return;
- }
-
+ llap = LLAP_FROM_COOKIE(data);
inode = llap->llap_inode;
lsm = llu_i2info(inode)->lli_smd;
struct ll_async_page *llap;
struct page *page;
- llap = llap_from_cookie(data);
- if (IS_ERR(llap)) {
- EXIT;
- return;
- }
-
+ llap = LLAP_FROM_COOKIE(data);
llap->llap_queued = 0;
page = llap->llap_page;
OBD_FREE(group, LLU_IO_GROUP_SIZE(group->lig_maxpages));
}
-void lov_increase_kms(struct obd_export *exp, struct lov_stripe_md *lsm,
- obd_off size);
-
static
ssize_t llu_file_prwv(const struct iovec *iovec, int iovlen,
_SYSIO_OFF_T pos, ssize_t len,
pos += ret;
if (!is_read) {
LASSERT(ret == count);
- lov_increase_kms(exp, lsm, pos);
+ obd_adjust_kms(exp, lsm, pos, 0);
/* file size grow immediately */
if (pos > lli->lli_st_size)
lli->lli_st_size = pos;