Whamcloud - gitweb
Change lov.xml file a little so that it works with localhost.
[fs/lustre-release.git] / lustre / llite / file.c
index 54c3e57..b1a6287 100644 (file)
@@ -73,7 +73,7 @@ static int ll_file_open(struct inode *inode, struct file *file)
                         }
                         md = lli->lli_smd;
                 }
-                if (lli->lli_smd && lli->lli_smd->lmd_object_id == 0)
+                if (lli->lli_smd->lmd_object_id == 0)
                         LBUG();
                 up(&lli->lli_open_sem);
         }
@@ -94,15 +94,13 @@ static int ll_file_open(struct inode *inode, struct file *file)
                 CERROR("mdc_open didn't assign fd_mdshandle\n");
                 /* XXX handle this how, abort or is it non-fatal? */
         }
-        if (!fd->fd_mdshandle)
-                CERROR("mdc_open didn't assign fd_mdshandle\n");
 
         if (oa == NULL && (oa = obdo_alloc()) == NULL)
                 GOTO(out_mdc, rc = -EINVAL);
 
         oa->o_id = lli->lli_smd->lmd_object_id;
         oa->o_mode = S_IFREG | inode->i_mode;
-        oa->o_valid = OBD_MD_FLMODE | OBD_MD_FLID;
+        oa->o_valid = OBD_MD_FLMODE | OBD_MD_FLID | OBD_MD_FLSIZE;
         rc = obd_open(ll_i2obdconn(inode), oa, lli->lli_smd);
         obdo_free(oa);
         oa = NULL;
@@ -187,7 +185,8 @@ static int ll_file_release(struct inode *inode, struct file *file)
         }
         ptlrpc_free_req(fd->fd_req);
 
-        l_lock(&obddev->obd_namespace->ns_lock);
+        // XXX Phil lov devices have no namespace
+        //l_lock(&obddev->obd_namespace->ns_lock);
         list_for_each_safe(tmp, next, &lli->lli_osc_locks) {
                 struct ldlm_lock *lock;
                 struct lustre_handle lockh;
@@ -202,7 +201,7 @@ static int ll_file_release(struct inode *inode, struct file *file)
                 if (rc < 0)
                         CERROR("ldlm_cli_cancel: %d\n", rc);
         }
-        l_unlock(&obddev->obd_namespace->ns_lock);
+        //l_unlock(&obddev->obd_namespace->ns_lock);
 
         EXIT;
 
@@ -366,7 +365,7 @@ ll_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
                                   ll_lock_callback, inode, sizeof(*inode),
                                   lockhs);
                 if (err != ELDLM_OK) {
-                        OBD_FREE(lockhs, md->lmd_stripe_count * sizeof(*lockhs));
+                        OBD_FREE(lockhs, md->lmd_stripe_count *sizeof(*lockhs));
                         CERROR("lock enqueue: err: %d\n", err);
                         RETURN(err);
                 }
@@ -380,7 +379,7 @@ ll_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
         if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK)) {
                 err = obd_cancel(&sbi->ll_osc_conn, md, LCK_PW, lockhs);
                 if (err != ELDLM_OK) {
-                        OBD_FREE(lockhs, md->lmd_stripe_count * sizeof(*lockhs));
+                        OBD_FREE(lockhs, md->lmd_stripe_count *sizeof(*lockhs));
                         CERROR("lock cancel: err: %d\n", err);
                         RETURN(err);
                 }