Commit 0fe988de authored by Ben Fennema's avatar Ben Fennema Committed by Linus Torvalds

[PATCH] udf patch for 2.5.7-pre1 (part 2/4)

This patch fixes writing the descriptor version for udf revisions >= 2.0
parent a7fb1571
......@@ -606,6 +606,10 @@ static void udf_table_free_blocks(struct super_block * sb,
mark_inode_dirty(table);
}
}
if (UDF_SB_UDFREV(sb) >= 0x0200)
udf_new_tag(nbh->b_data, TID_ALLOC_EXTENT_DESC, 3, 1,
nbloc.logicalBlockNum, sizeof(tag));
else
udf_new_tag(nbh->b_data, TID_ALLOC_EXTENT_DESC, 2, 1,
nbloc.logicalBlockNum, sizeof(tag));
switch (UDF_I_ALLOCTYPE(table))
......
......@@ -1518,6 +1518,9 @@ udf_update_inode(struct inode *inode, int do_sync)
ICB_FLAG_SETGID | ICB_FLAG_STICKY));
fe->icbTag.flags = cpu_to_le16(icbflags);
if (UDF_SB_UDFREV(inode->i_sb) >= 0x0200)
fe->descTag.descVersion = cpu_to_le16(3);
else
fe->descTag.descVersion = cpu_to_le16(2);
fe->descTag.tagSerialNum = cpu_to_le16(UDF_SB_SERIALNUM(inode->i_sb));
fe->descTag.tagLocation = cpu_to_le32(UDF_I_LOCATION(inode).logicalBlockNum);
......@@ -1690,6 +1693,10 @@ Sint8 udf_add_aext(struct inode *inode, lb_addr *bloc, int *extoffset,
mark_inode_dirty(inode);
}
}
if (UDF_SB_UDFREV(inode->i_sb) >= 0x0200)
udf_new_tag(nbh->b_data, TID_ALLOC_EXTENT_DESC, 3, 1,
bloc->logicalBlockNum, sizeof(tag));
else
udf_new_tag(nbh->b_data, TID_ALLOC_EXTENT_DESC, 2, 1,
bloc->logicalBlockNum, sizeof(tag));
switch (UDF_I_ALLOCTYPE(inode))
......
......@@ -591,6 +591,9 @@ udf_add_entry(struct inode *dir, struct dentry *dentry,
}
memset(cfi, 0, sizeof(struct FileIdentDesc));
if (UDF_SB_UDFREV(sb) >= 0x0200)
udf_new_tag((char *)cfi, TID_FILE_IDENT_DESC, 3, 1, block, sizeof(tag));
else
udf_new_tag((char *)cfi, TID_FILE_IDENT_DESC, 2, 1, block, sizeof(tag));
cfi->fileVersionNum = cpu_to_le16(1);
cfi->lengthFileIdent = namelen;
......
......@@ -851,6 +851,14 @@ udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
{
UDF_SB_PARTLEN(sb,i) = le32_to_cpu(p->partitionLength); /* blocks */
UDF_SB_PARTROOT(sb,i) = le32_to_cpu(p->partitionStartingLocation) + UDF_SB_SESSION(sb);
if (le32_to_cpu(p->accessType) == PARTITION_ACCESS_R)
UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_READ_ONLY;
if (le32_to_cpu(p->accessType) == PARTITION_ACCESS_WO)
UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_WRITE_ONCE;
if (le32_to_cpu(p->accessType) == PARTITION_ACCESS_RW)
UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_REWRITABLE;
if (le32_to_cpu(p->accessType) == PARTITION_ACCESS_OW)
UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_OVERWRITABLE;
if (!strcmp(p->partitionContents.ident, PARTITION_CONTENTS_NSR02) ||
!strcmp(p->partitionContents.ident, PARTITION_CONTENTS_NSR03))
......
......@@ -25,6 +25,10 @@
#define UDF_PART_FLAG_UNALLOC_TABLE 0x0002
#define UDF_PART_FLAG_FREED_BITMAP 0x0004
#define UDF_PART_FLAG_FREED_TABLE 0x0008
#define UDF_PART_FLAG_READ_ONLY 0x0010
#define UDF_PART_FLAG_WRITE_ONCE 0x0020
#define UDF_PART_FLAG_REWRITABLE 0x0040
#define UDF_PART_FLAG_OVERWRITABLE 0x0080
#define UDF_SB_FREE(X)\
{\
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment