Merge to kernel-2.6.20-1.2949.fc6.vs2.2.0.1
[linux-2.6.git] / fs / udf / directory.c
index 0038465..198caa3 100644 (file)
@@ -4,11 +4,6 @@
  * PURPOSE
  *     Directory related functions
  *
- * CONTACTS
- *     E-mail regarding any portion of the Linux UDF file system should be
- *     directed to the development team mailing list (run by majordomo):
- *             linux_udf@hpesjro.fc.hp.com
- *
  * COPYRIGHT
  *     This file is distributed under the terms of the GNU General Public
  *     License (GPL). Copies of the GPL can be obtained from:
 #include <linux/string.h>
 #include <linux/buffer_head.h>
 
-uint8_t * udf_filead_read(struct inode *dir, uint8_t *tmpad, uint8_t ad_size,
-       lb_addr fe_loc, int *pos, int *offset, struct buffer_head **bh, int *error)
+#if 0
+static uint8_t *
+udf_filead_read(struct inode *dir, uint8_t *tmpad, uint8_t ad_size,
+               kernel_lb_addr fe_loc, int *pos, int *offset,
+               struct buffer_head **bh, int *error)
 {
        int loffset = *offset;
        int block;
@@ -38,14 +36,14 @@ uint8_t * udf_filead_read(struct inode *dir, uint8_t *tmpad, uint8_t ad_size,
 
        if (!ad)
        {
-               udf_release_data(*bh);
+               brelse(*bh);
                *error = 1;
                return NULL;
        }
 
        if (*offset == dir->i_sb->s_blocksize)
        {
-               udf_release_data(*bh);
+               brelse(*bh);
                block = udf_get_lb_pblock(dir->i_sb, fe_loc, ++*pos);
                if (!block)
                        return NULL;
@@ -59,7 +57,7 @@ uint8_t * udf_filead_read(struct inode *dir, uint8_t *tmpad, uint8_t ad_size,
                remainder = dir->i_sb->s_blocksize - loffset;
                memcpy((uint8_t *)ad, (*bh)->b_data + loffset, remainder);
 
-               udf_release_data(*bh);
+               brelse(*bh);
                block = udf_get_lb_pblock(dir->i_sb, fe_loc, ++*pos);
                if (!block)
                        return NULL;
@@ -71,14 +69,15 @@ uint8_t * udf_filead_read(struct inode *dir, uint8_t *tmpad, uint8_t ad_size,
        }
        return ad;
 }
+#endif
 
 struct fileIdentDesc *
 udf_fileident_read(struct inode *dir, loff_t *nf_pos,
        struct udf_fileident_bh *fibh,
        struct fileIdentDesc *cfi,
-       lb_addr *bloc, uint32_t *extoffset, 
-       lb_addr *eloc, uint32_t *elen,
-       uint32_t *offset, struct buffer_head **bh)
+       struct extent_position *epos,
+       kernel_lb_addr *eloc, uint32_t *elen,
+       sector_t *offset)
 {
        struct fileIdentDesc *fi;
        int i, num, block;
@@ -106,13 +105,11 @@ udf_fileident_read(struct inode *dir, loff_t *nf_pos,
 
        if (fibh->eoffset == dir->i_sb->s_blocksize)
        {
-               int lextoffset = *extoffset;
+               int lextoffset = epos->offset;
 
-               if (udf_next_aext(dir, bloc, extoffset, eloc, elen, bh, 1) !=
+               if (udf_next_aext(dir, epos, eloc, elen, 1) !=
                        (EXT_RECORDED_ALLOCATED >> 30))
-               {
                        return NULL;
-               }
 
                block = udf_get_lb_pblock(dir->i_sb, *eloc, *offset);
 
@@ -121,9 +118,9 @@ udf_fileident_read(struct inode *dir, loff_t *nf_pos,
                if ((*offset << dir->i_sb->s_blocksize_bits) >= *elen)
                        *offset = 0;
                else
-                       *extoffset = lextoffset;
+                       epos->offset = lextoffset;
 
-               udf_release_data(fibh->sbh);
+               brelse(fibh->sbh);
                if (!(fibh->sbh = fibh->ebh = udf_tread(dir->i_sb, block)))
                        return NULL;
                fibh->soffset = fibh->eoffset = 0;
@@ -152,7 +149,7 @@ udf_fileident_read(struct inode *dir, loff_t *nf_pos,
        }
        else if (fibh->sbh != fibh->ebh)
        {
-               udf_release_data(fibh->sbh);
+               brelse(fibh->sbh);
                fibh->sbh = fibh->ebh;
        }
 
@@ -170,13 +167,11 @@ udf_fileident_read(struct inode *dir, loff_t *nf_pos,
        }
        else if (fibh->eoffset > dir->i_sb->s_blocksize)
        {
-               int lextoffset = *extoffset;
+               int lextoffset = epos->offset;
 
-               if (udf_next_aext(dir, bloc, extoffset, eloc, elen, bh, 1) !=
+               if (udf_next_aext(dir, epos, eloc, elen, 1) !=
                        (EXT_RECORDED_ALLOCATED >> 30))
-               {
                        return NULL;
-               }
 
                block = udf_get_lb_pblock(dir->i_sb, *eloc, *offset);
 
@@ -185,7 +180,7 @@ udf_fileident_read(struct inode *dir, loff_t *nf_pos,
                if ((*offset << dir->i_sb->s_blocksize_bits) >= *elen)
                        *offset = 0;
                else
-                       *extoffset = lextoffset;
+                       epos->offset = lextoffset;
 
                fibh->soffset -= dir->i_sb->s_blocksize;
                fibh->eoffset -= dir->i_sb->s_blocksize;
@@ -259,7 +254,8 @@ udf_get_fileident(void * buffer, int bufsize, int * offset)
        return fi;
 }
 
-extent_ad *
+#if 0
+static extent_ad *
 udf_get_fileextent(void * buffer, int bufsize, int * offset)
 {
        extent_ad * ext;
@@ -293,6 +289,7 @@ udf_get_fileextent(void * buffer, int bufsize, int * offset)
        *offset = *offset + sizeof(extent_ad);
        return ext;
 }
+#endif
 
 short_ad *
 udf_get_fileshortad(uint8_t *ptr, int maxoffset, int *offset, int inc)