diff options
Diffstat (limited to 'fs/udf/ialloc.c')
-rw-r--r-- | fs/udf/ialloc.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index 8145e943be61..7697b489a292 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c | |||
@@ -82,7 +82,8 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err) | |||
82 | UDF_I_NEXT_ALLOC_GOAL(inode) = 0; | 82 | UDF_I_NEXT_ALLOC_GOAL(inode) = 0; |
83 | UDF_I_STRAT4096(inode) = 0; | 83 | UDF_I_STRAT4096(inode) = 0; |
84 | 84 | ||
85 | block = udf_new_block(dir->i_sb, NULL, UDF_I_LOCATION(dir).partitionReferenceNum, | 85 | block = udf_new_block(dir->i_sb, NULL, |
86 | UDF_I_LOCATION(dir).partitionReferenceNum, | ||
86 | start, err); | 87 | start, err); |
87 | if (*err) { | 88 | if (*err) { |
88 | iput(inode); | 89 | iput(inode); |
@@ -91,11 +92,15 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err) | |||
91 | 92 | ||
92 | mutex_lock(&sbi->s_alloc_mutex); | 93 | mutex_lock(&sbi->s_alloc_mutex); |
93 | if (sbi->s_lvid_bh) { | 94 | if (sbi->s_lvid_bh) { |
94 | struct logicalVolIntegrityDesc *lvid = (struct logicalVolIntegrityDesc *)sbi->s_lvid_bh->b_data; | 95 | struct logicalVolIntegrityDesc *lvid = |
95 | struct logicalVolIntegrityDescImpUse *lvidiu = udf_sb_lvidiu(sbi); | 96 | (struct logicalVolIntegrityDesc *) |
97 | sbi->s_lvid_bh->b_data; | ||
98 | struct logicalVolIntegrityDescImpUse *lvidiu = | ||
99 | udf_sb_lvidiu(sbi); | ||
96 | struct logicalVolHeaderDesc *lvhd; | 100 | struct logicalVolHeaderDesc *lvhd; |
97 | uint64_t uniqueID; | 101 | uint64_t uniqueID; |
98 | lvhd = (struct logicalVolHeaderDesc *)(lvid->logicalVolContentsUse); | 102 | lvhd = (struct logicalVolHeaderDesc *) |
103 | (lvid->logicalVolContentsUse); | ||
99 | if (S_ISDIR(mode)) | 104 | if (S_ISDIR(mode)) |
100 | lvidiu->numDirs = | 105 | lvidiu->numDirs = |
101 | cpu_to_le32(le32_to_cpu(lvidiu->numDirs) + 1); | 106 | cpu_to_le32(le32_to_cpu(lvidiu->numDirs) + 1); |
@@ -119,7 +124,8 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err) | |||
119 | } | 124 | } |
120 | 125 | ||
121 | UDF_I_LOCATION(inode).logicalBlockNum = block; | 126 | UDF_I_LOCATION(inode).logicalBlockNum = block; |
122 | UDF_I_LOCATION(inode).partitionReferenceNum = UDF_I_LOCATION(dir).partitionReferenceNum; | 127 | UDF_I_LOCATION(inode).partitionReferenceNum = |
128 | UDF_I_LOCATION(dir).partitionReferenceNum; | ||
123 | inode->i_ino = udf_get_lb_pblock(sb, UDF_I_LOCATION(inode), 0); | 129 | inode->i_ino = udf_get_lb_pblock(sb, UDF_I_LOCATION(inode), 0); |
124 | inode->i_blocks = 0; | 130 | inode->i_blocks = 0; |
125 | UDF_I_LENEATTR(inode) = 0; | 131 | UDF_I_LENEATTR(inode) = 0; |
@@ -129,10 +135,14 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err) | |||
129 | UDF_I_EFE(inode) = 1; | 135 | UDF_I_EFE(inode) = 1; |
130 | if (UDF_VERS_USE_EXTENDED_FE > sbi->s_udfrev) | 136 | if (UDF_VERS_USE_EXTENDED_FE > sbi->s_udfrev) |
131 | sbi->s_udfrev = UDF_VERS_USE_EXTENDED_FE; | 137 | sbi->s_udfrev = UDF_VERS_USE_EXTENDED_FE; |
132 | UDF_I_DATA(inode) = kzalloc(inode->i_sb->s_blocksize - sizeof(struct extendedFileEntry), GFP_KERNEL); | 138 | UDF_I_DATA(inode) = kzalloc(inode->i_sb->s_blocksize - |
139 | sizeof(struct extendedFileEntry), | ||
140 | GFP_KERNEL); | ||
133 | } else { | 141 | } else { |
134 | UDF_I_EFE(inode) = 0; | 142 | UDF_I_EFE(inode) = 0; |
135 | UDF_I_DATA(inode) = kzalloc(inode->i_sb->s_blocksize - sizeof(struct fileEntry), GFP_KERNEL); | 143 | UDF_I_DATA(inode) = kzalloc(inode->i_sb->s_blocksize - |
144 | sizeof(struct fileEntry), | ||
145 | GFP_KERNEL); | ||
136 | } | 146 | } |
137 | if (!UDF_I_DATA(inode)) { | 147 | if (!UDF_I_DATA(inode)) { |
138 | iput(inode); | 148 | iput(inode); |