Whamcloud - gitweb
- move the peter branch changes to the head
[fs/lustre-release.git] / lustre / llite / file.c
index eecff78..41ff0b8 100644 (file)
@@ -49,7 +49,7 @@ static int ll_file_open(struct inode *inode, struct file *file)
         /*  XXX object needs to be cleaned up if mdc_open fails */
         /*  XXX error handling appropriate here? */
         if (lli->lli_smd == NULL || lli->lli_smd->lmd_object_id == 0) {
-                struct mdc_obd *mdc = sbi2mdc(ll_s2sbi(inode->i_sb));
+                struct client_obd *mdc = sbi2mdc(ll_s2sbi(inode->i_sb));
                 struct inode * inode = file->f_dentry->d_inode;
 
                 lli->lli_smd = NULL; 
@@ -59,7 +59,7 @@ static int ll_file_open(struct inode *inode, struct file *file)
                 }
                 oa->o_valid = OBD_MD_FLMODE;
                 oa->o_mode = S_IFREG | 0600;
-                oa->o_easize = mdc->mdc_max_mdsize;
+                oa->o_easize = mdc->cl_max_mdsize;
                 rc = obd_create(ll_i2obdconn(inode), oa, &lli->lli_smd);
                 if (rc)
                         RETURN(rc);
@@ -265,8 +265,10 @@ static ssize_t ll_file_read(struct file *filp, char *buf, size_t count,
                                   &extent, sizeof(extent), LCK_PR, &flags,
                                   ll_lock_callback, inode, sizeof(*inode),
                                   &lockh);
-                if (err != ELDLM_OK)
+                if (err != ELDLM_OK) {
                         CERROR("lock enqueue: err: %d\n", err);
+                        RETURN(err);
+                }
                 ldlm_lock_dump((void *)(unsigned long)lockh.addr);
         }
 
@@ -279,8 +281,10 @@ static ssize_t ll_file_read(struct file *filp, char *buf, size_t count,
 
         if (!(fd->fd_flags & LL_FILE_IGNORE_LOCK)) {
                 err = obd_cancel(&sbi->ll_osc_conn, LCK_PR, &lockh);
-                if (err != ELDLM_OK)
+                if (err != ELDLM_OK) {
                         CERROR("lock cancel: err: %d\n", err);
+                        RETURN(err);
+                }
         }
 
         RETURN(retval);
@@ -315,8 +319,10 @@ ll_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
                                   &extent, sizeof(extent), LCK_PW, &flags,
                                   ll_lock_callback, inode, sizeof(*inode),
                                   &lockh);
-                if (err != ELDLM_OK)
+                if (err != ELDLM_OK) {
                         CERROR("lock enqueue: err: %d\n", err);
+                        RETURN(err);
+                }
                 ldlm_lock_dump((void *)(unsigned long)lockh.addr);
         }
 
@@ -327,8 +333,10 @@ 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, LCK_PW, &lockh);
-                if (err != ELDLM_OK)
+                if (err != ELDLM_OK) {
                         CERROR("lock cancel: err: %d\n", err);
+                        RETURN(err);
+                }
         }
 
         RETURN(retval);