diff options
author | Steve Nickel <snickel58@gmail.com> | 2012-02-14 00:28:42 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2012-02-29 15:53:46 -0500 |
commit | d5e2cf07c388dbd06579ab39672e1bd8b9754e65 (patch) | |
tree | 107cce0364e823e2c6073eb9576e9c6bbf11e4cb /fs | |
parent | ac1334bfdae33be17ae6ae641bbbd1e6a2f04005 (diff) |
udf: Init/maintain file entry checkpoint field
In accordance with ECMA 1.67 Part 4, 14.9.15, the checkpoint field
should be initialized to 1 at creation. (Zero is *not* a valid value.)
Signed-off-by: Steven P. Nickel <snickel@focusinfo.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/udf/ialloc.c | 1 | ||||
-rw-r--r-- | fs/udf/inode.c | 4 | ||||
-rw-r--r-- | fs/udf/udf_i.h | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index 05ab48195be9..7e5aae4bf46f 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c | |||
@@ -116,6 +116,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode, int *err) | |||
116 | iinfo->i_lenEAttr = 0; | 116 | iinfo->i_lenEAttr = 0; |
117 | iinfo->i_lenAlloc = 0; | 117 | iinfo->i_lenAlloc = 0; |
118 | iinfo->i_use = 0; | 118 | iinfo->i_use = 0; |
119 | iinfo->i_checkpoint = 1; | ||
119 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_AD_IN_ICB)) | 120 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_AD_IN_ICB)) |
120 | iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB; | 121 | iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB; |
121 | else if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_SHORT_AD)) | 122 | else if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_SHORT_AD)) |
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 7699df7b3198..91c6f2311f35 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -1358,6 +1358,7 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) | |||
1358 | iinfo->i_unique = le64_to_cpu(fe->uniqueID); | 1358 | iinfo->i_unique = le64_to_cpu(fe->uniqueID); |
1359 | iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr); | 1359 | iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr); |
1360 | iinfo->i_lenAlloc = le32_to_cpu(fe->lengthAllocDescs); | 1360 | iinfo->i_lenAlloc = le32_to_cpu(fe->lengthAllocDescs); |
1361 | iinfo->i_checkpoint = le32_to_cpu(fe->checkpoint); | ||
1361 | offset = sizeof(struct fileEntry) + iinfo->i_lenEAttr; | 1362 | offset = sizeof(struct fileEntry) + iinfo->i_lenEAttr; |
1362 | } else { | 1363 | } else { |
1363 | inode->i_blocks = le64_to_cpu(efe->logicalBlocksRecorded) << | 1364 | inode->i_blocks = le64_to_cpu(efe->logicalBlocksRecorded) << |
@@ -1379,6 +1380,7 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) | |||
1379 | iinfo->i_unique = le64_to_cpu(efe->uniqueID); | 1380 | iinfo->i_unique = le64_to_cpu(efe->uniqueID); |
1380 | iinfo->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr); | 1381 | iinfo->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr); |
1381 | iinfo->i_lenAlloc = le32_to_cpu(efe->lengthAllocDescs); | 1382 | iinfo->i_lenAlloc = le32_to_cpu(efe->lengthAllocDescs); |
1383 | iinfo->i_checkpoint = le32_to_cpu(efe->checkpoint); | ||
1382 | offset = sizeof(struct extendedFileEntry) + | 1384 | offset = sizeof(struct extendedFileEntry) + |
1383 | iinfo->i_lenEAttr; | 1385 | iinfo->i_lenEAttr; |
1384 | } | 1386 | } |
@@ -1607,6 +1609,7 @@ static int udf_update_inode(struct inode *inode, int do_sync) | |||
1607 | fe->uniqueID = cpu_to_le64(iinfo->i_unique); | 1609 | fe->uniqueID = cpu_to_le64(iinfo->i_unique); |
1608 | fe->lengthExtendedAttr = cpu_to_le32(iinfo->i_lenEAttr); | 1610 | fe->lengthExtendedAttr = cpu_to_le32(iinfo->i_lenEAttr); |
1609 | fe->lengthAllocDescs = cpu_to_le32(iinfo->i_lenAlloc); | 1611 | fe->lengthAllocDescs = cpu_to_le32(iinfo->i_lenAlloc); |
1612 | fe->checkpoint = cpu_to_le32(iinfo->i_checkpoint); | ||
1610 | fe->descTag.tagIdent = cpu_to_le16(TAG_IDENT_FE); | 1613 | fe->descTag.tagIdent = cpu_to_le16(TAG_IDENT_FE); |
1611 | crclen = sizeof(struct fileEntry); | 1614 | crclen = sizeof(struct fileEntry); |
1612 | } else { | 1615 | } else { |
@@ -1646,6 +1649,7 @@ static int udf_update_inode(struct inode *inode, int do_sync) | |||
1646 | efe->uniqueID = cpu_to_le64(iinfo->i_unique); | 1649 | efe->uniqueID = cpu_to_le64(iinfo->i_unique); |
1647 | efe->lengthExtendedAttr = cpu_to_le32(iinfo->i_lenEAttr); | 1650 | efe->lengthExtendedAttr = cpu_to_le32(iinfo->i_lenEAttr); |
1648 | efe->lengthAllocDescs = cpu_to_le32(iinfo->i_lenAlloc); | 1651 | efe->lengthAllocDescs = cpu_to_le32(iinfo->i_lenAlloc); |
1652 | efe->checkpoint = cpu_to_le32(iinfo->i_checkpoint); | ||
1649 | efe->descTag.tagIdent = cpu_to_le16(TAG_IDENT_EFE); | 1653 | efe->descTag.tagIdent = cpu_to_le16(TAG_IDENT_EFE); |
1650 | crclen = sizeof(struct extendedFileEntry); | 1654 | crclen = sizeof(struct extendedFileEntry); |
1651 | } | 1655 | } |
diff --git a/fs/udf/udf_i.h b/fs/udf/udf_i.h index d1bd31ea724e..bb8309dcd5c1 100644 --- a/fs/udf/udf_i.h +++ b/fs/udf/udf_i.h | |||
@@ -23,6 +23,7 @@ struct udf_inode_info { | |||
23 | __u64 i_lenExtents; | 23 | __u64 i_lenExtents; |
24 | __u32 i_next_alloc_block; | 24 | __u32 i_next_alloc_block; |
25 | __u32 i_next_alloc_goal; | 25 | __u32 i_next_alloc_goal; |
26 | __u32 i_checkpoint; | ||
26 | unsigned i_alloc_type : 3; | 27 | unsigned i_alloc_type : 3; |
27 | unsigned i_efe : 1; /* extendedFileEntry */ | 28 | unsigned i_efe : 1; /* extendedFileEntry */ |
28 | unsigned i_use : 1; /* unallocSpaceEntry */ | 29 | unsigned i_use : 1; /* unallocSpaceEntry */ |