]> err.no Git - linux-2.6/blobdiff - fs/udf/namei.c
powerpc/mm: Don't clear _PAGE_COHERENT when _PAGE_SAO is set
[linux-2.6] / fs / udf / namei.c
index 47a6589e10b5ce984a988c2f3332fb12c891aa1c..d3231947db19edc3e4e592d3feadd7ab95e2c08a 100644 (file)
@@ -315,7 +315,7 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir,
        uint16_t liu;
        int block;
        kernel_lb_addr eloc;
-       uint32_t elen;
+       uint32_t elen = 0;
        sector_t offset;
        struct extent_position epos = {};
        struct udf_inode_info *dinfo;
@@ -406,7 +406,8 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir,
        }
 
 add:
-       if (dinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
+       /* Is there any extent whose size we need to round up? */
+       if (dinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB && elen) {
                elen = (elen + sb->s_blocksize - 1) & ~(sb->s_blocksize - 1);
                if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
                        epos.offset -= sizeof(short_ad);
@@ -898,7 +899,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
 
        if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
                kernel_lb_addr eloc;
-               uint32_t elen;
+               uint32_t bsize;
 
                block = udf_new_block(inode->i_sb, inode,
                                iinfo->i_location.partitionReferenceNum,
@@ -911,9 +912,9 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
                eloc.logicalBlockNum = block;
                eloc.partitionReferenceNum =
                                iinfo->i_location.partitionReferenceNum;
-               elen = inode->i_sb->s_blocksize;
-               iinfo->i_lenExtents = elen;
-               udf_add_aext(inode, &epos, eloc, elen, 0);
+               bsize = inode->i_sb->s_blocksize;
+               iinfo->i_lenExtents = bsize;
+               udf_add_aext(inode, &epos, eloc, bsize, 0);
                brelse(epos.bh);
 
                block = udf_get_pblock(inode->i_sb, block,