diff options
Diffstat (limited to 'fs/udf/ialloc.c')
-rw-r--r-- | fs/udf/ialloc.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index 636d8f613929..8145e943be61 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c | |||
@@ -43,15 +43,17 @@ void udf_free_inode(struct inode *inode) | |||
43 | clear_inode(inode); | 43 | clear_inode(inode); |
44 | 44 | ||
45 | mutex_lock(&sbi->s_alloc_mutex); | 45 | mutex_lock(&sbi->s_alloc_mutex); |
46 | if (sbi->s_lvidbh) { | 46 | if (sbi->s_lvid_bh) { |
47 | struct logicalVolIntegrityDescImpUse *lvidiu = | ||
48 | udf_sb_lvidiu(sbi); | ||
47 | if (S_ISDIR(inode->i_mode)) | 49 | if (S_ISDIR(inode->i_mode)) |
48 | UDF_SB_LVIDIU(sb)->numDirs = | 50 | lvidiu->numDirs = |
49 | cpu_to_le32(le32_to_cpu(UDF_SB_LVIDIU(sb)->numDirs) - 1); | 51 | cpu_to_le32(le32_to_cpu(lvidiu->numDirs) - 1); |
50 | else | 52 | else |
51 | UDF_SB_LVIDIU(sb)->numFiles = | 53 | lvidiu->numFiles = |
52 | cpu_to_le32(le32_to_cpu(UDF_SB_LVIDIU(sb)->numFiles) - 1); | 54 | cpu_to_le32(le32_to_cpu(lvidiu->numFiles) - 1); |
53 | 55 | ||
54 | mark_buffer_dirty(sbi->s_lvidbh); | 56 | mark_buffer_dirty(sbi->s_lvid_bh); |
55 | } | 57 | } |
56 | mutex_unlock(&sbi->s_alloc_mutex); | 58 | mutex_unlock(&sbi->s_alloc_mutex); |
57 | 59 | ||
@@ -88,21 +90,23 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err) | |||
88 | } | 90 | } |
89 | 91 | ||
90 | mutex_lock(&sbi->s_alloc_mutex); | 92 | mutex_lock(&sbi->s_alloc_mutex); |
91 | if (UDF_SB_LVIDBH(sb)) { | 93 | if (sbi->s_lvid_bh) { |
94 | struct logicalVolIntegrityDesc *lvid = (struct logicalVolIntegrityDesc *)sbi->s_lvid_bh->b_data; | ||
95 | struct logicalVolIntegrityDescImpUse *lvidiu = udf_sb_lvidiu(sbi); | ||
92 | struct logicalVolHeaderDesc *lvhd; | 96 | struct logicalVolHeaderDesc *lvhd; |
93 | uint64_t uniqueID; | 97 | uint64_t uniqueID; |
94 | lvhd = (struct logicalVolHeaderDesc *)(UDF_SB_LVID(sb)->logicalVolContentsUse); | 98 | lvhd = (struct logicalVolHeaderDesc *)(lvid->logicalVolContentsUse); |
95 | if (S_ISDIR(mode)) | 99 | if (S_ISDIR(mode)) |
96 | UDF_SB_LVIDIU(sb)->numDirs = | 100 | lvidiu->numDirs = |
97 | cpu_to_le32(le32_to_cpu(UDF_SB_LVIDIU(sb)->numDirs) + 1); | 101 | cpu_to_le32(le32_to_cpu(lvidiu->numDirs) + 1); |
98 | else | 102 | else |
99 | UDF_SB_LVIDIU(sb)->numFiles = | 103 | lvidiu->numFiles = |
100 | cpu_to_le32(le32_to_cpu(UDF_SB_LVIDIU(sb)->numFiles) + 1); | 104 | cpu_to_le32(le32_to_cpu(lvidiu->numFiles) + 1); |
101 | UDF_I_UNIQUE(inode) = uniqueID = le64_to_cpu(lvhd->uniqueID); | 105 | UDF_I_UNIQUE(inode) = uniqueID = le64_to_cpu(lvhd->uniqueID); |
102 | if (!(++uniqueID & 0x00000000FFFFFFFFUL)) | 106 | if (!(++uniqueID & 0x00000000FFFFFFFFUL)) |
103 | uniqueID += 16; | 107 | uniqueID += 16; |
104 | lvhd->uniqueID = cpu_to_le64(uniqueID); | 108 | lvhd->uniqueID = cpu_to_le64(uniqueID); |
105 | mark_buffer_dirty(UDF_SB_LVIDBH(sb)); | 109 | mark_buffer_dirty(sbi->s_lvid_bh); |
106 | } | 110 | } |
107 | inode->i_mode = mode; | 111 | inode->i_mode = mode; |
108 | inode->i_uid = current->fsuid; | 112 | inode->i_uid = current->fsuid; |
@@ -123,7 +127,8 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err) | |||
123 | UDF_I_USE(inode) = 0; | 127 | UDF_I_USE(inode) = 0; |
124 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_EXTENDED_FE)) { | 128 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_EXTENDED_FE)) { |
125 | UDF_I_EFE(inode) = 1; | 129 | UDF_I_EFE(inode) = 1; |
126 | UDF_UPDATE_UDFREV(inode->i_sb, UDF_VERS_USE_EXTENDED_FE); | 130 | if (UDF_VERS_USE_EXTENDED_FE > sbi->s_udfrev) |
131 | sbi->s_udfrev = UDF_VERS_USE_EXTENDED_FE; | ||
127 | UDF_I_DATA(inode) = kzalloc(inode->i_sb->s_blocksize - sizeof(struct extendedFileEntry), GFP_KERNEL); | 132 | UDF_I_DATA(inode) = kzalloc(inode->i_sb->s_blocksize - sizeof(struct extendedFileEntry), GFP_KERNEL); |
128 | } else { | 133 | } else { |
129 | UDF_I_EFE(inode) = 0; | 134 | UDF_I_EFE(inode) = 0; |