Pull osi into release branch
[sfrench/cifs-2.6.git] / fs / udf / symlink.c
index ba068a7865630bb07a8f968a91d20c13245c143f..e6f933dd6a7b9929440a781903ea11a4192698f8 100644 (file)
@@ -11,7 +11,7 @@
  *     Each contributing author retains all rights to their own work.
  *
  *  (C) 1998-2001 Ben Fennema
- *  (C) 1999 Stelias Computing Inc 
+ *  (C) 1999 Stelias Computing Inc
  *
  * HISTORY
  *
@@ -39,35 +39,33 @@ static void udf_pc_to_char(struct super_block *sb, char *from, int fromlen, char
        int elen = 0;
        char *p = to;
 
-       while (elen < fromlen)
-       {
+       while (elen < fromlen) {
                pc = (struct pathComponent *)(from + elen);
-               switch (pc->componentType)
-               {
-                       case 1:
-                               if (pc->lengthComponentIdent == 0)
-                               {
-                                       p = to;
-                                       *p++ = '/';
-                               }
-                               break;
-                       case 3:
-                               memcpy(p, "../", 3);
-                               p += 3;
-                               break;
-                       case 4:
-                               memcpy(p, "./", 2);
-                               p += 2;
-                               /* that would be . - just ignore */
-                               break;
-                       case 5:
-                               p += udf_get_filename(sb, pc->componentIdent, p, pc->lengthComponentIdent);
+               switch (pc->componentType) {
+               case 1:
+                       if (pc->lengthComponentIdent == 0) {
+                               p = to;
                                *p++ = '/';
-                               break;
+                       }
+                       break;
+               case 3:
+                       memcpy(p, "../", 3);
+                       p += 3;
+                       break;
+               case 4:
+                       memcpy(p, "./", 2);
+                       p += 2;
+                       /* that would be . - just ignore */
+                       break;
+               case 5:
+                       p += udf_get_filename(sb, pc->componentIdent, p,
+                                             pc->lengthComponentIdent);
+                       *p++ = '/';
+                       break;
                }
                elen += sizeof(struct pathComponent) + pc->lengthComponentIdent;
        }
-       if (p > to+1)
+       if (p > to + 1)
                p[-1] = '\0';
        else
                p[0] = '\0';
@@ -82,10 +80,9 @@ static int udf_symlink_filler(struct file *file, struct page *page)
        char *p = kmap(page);
 
        lock_kernel();
-       if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB)
+       if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) {
                symlink = UDF_I_DATA(inode) + UDF_I_LENEATTR(inode);
-       else
-       {
+       } else {
                bh = sb_bread(inode->i_sb, udf_block_map(inode, 0));
 
                if (!bh)
@@ -95,13 +92,14 @@ static int udf_symlink_filler(struct file *file, struct page *page)
        }
 
        udf_pc_to_char(inode->i_sb, symlink, inode->i_size, p);
-       udf_release_data(bh);
+       brelse(bh);
 
        unlock_kernel();
        SetPageUptodate(page);
        kunmap(page);
        unlock_page(page);
        return 0;
+
 out:
        unlock_kernel();
        SetPageError(page);