aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/ialloc.c
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-02-08 07:20:42 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:35 -0500
commitc0b344385fa05f6bea462e707fcba89f9e2776c2 (patch)
tree391376739ffb0b5c9dfcf294c9f746d7ff2daf66 /fs/udf/ialloc.c
parent5e0f001736651f6f859aeca95f895c829d223cdb (diff)
udf: remove UDF_I_* macros and open code them
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Acked-by: Jan Kara <jack@suse.cz> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/udf/ialloc.c')
-rw-r--r--fs/udf/ialloc.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c
index 7697b489a292..5ed8cda1c53e 100644
--- a/fs/udf/ialloc.c
+++ b/fs/udf/ialloc.c
@@ -57,7 +57,7 @@ void udf_free_inode(struct inode *inode)
57 } 57 }
58 mutex_unlock(&sbi->s_alloc_mutex); 58 mutex_unlock(&sbi->s_alloc_mutex);
59 59
60 udf_free_blocks(sb, NULL, UDF_I_LOCATION(inode), 0, 1); 60 udf_free_blocks(sb, NULL, UDF_I(inode)->i_location, 0, 1);
61} 61}
62 62
63struct inode *udf_new_inode(struct inode *dir, int mode, int *err) 63struct inode *udf_new_inode(struct inode *dir, int mode, int *err)
@@ -66,7 +66,7 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err)
66 struct udf_sb_info *sbi = UDF_SB(sb); 66 struct udf_sb_info *sbi = UDF_SB(sb);
67 struct inode *inode; 67 struct inode *inode;
68 int block; 68 int block;
69 uint32_t start = UDF_I_LOCATION(dir).logicalBlockNum; 69 uint32_t start = UDF_I(dir)->i_location.logicalBlockNum;
70 70
71 inode = new_inode(sb); 71 inode = new_inode(sb);
72 72
@@ -76,14 +76,14 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err)
76 } 76 }
77 *err = -ENOSPC; 77 *err = -ENOSPC;
78 78
79 UDF_I_UNIQUE(inode) = 0; 79 UDF_I(inode)->i_unique = 0;
80 UDF_I_LENEXTENTS(inode) = 0; 80 UDF_I(inode)->i_lenExtents = 0;
81 UDF_I_NEXT_ALLOC_BLOCK(inode) = 0; 81 UDF_I(inode)->i_next_alloc_block = 0;
82 UDF_I_NEXT_ALLOC_GOAL(inode) = 0; 82 UDF_I(inode)->i_next_alloc_goal = 0;
83 UDF_I_STRAT4096(inode) = 0; 83 UDF_I(inode)->i_strat4096 = 0;
84 84
85 block = udf_new_block(dir->i_sb, NULL, 85 block = udf_new_block(dir->i_sb, NULL,
86 UDF_I_LOCATION(dir).partitionReferenceNum, 86 UDF_I(dir)->i_location.partitionReferenceNum,
87 start, err); 87 start, err);
88 if (*err) { 88 if (*err) {
89 iput(inode); 89 iput(inode);
@@ -107,7 +107,7 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err)
107 else 107 else
108 lvidiu->numFiles = 108 lvidiu->numFiles =
109 cpu_to_le32(le32_to_cpu(lvidiu->numFiles) + 1); 109 cpu_to_le32(le32_to_cpu(lvidiu->numFiles) + 1);
110 UDF_I_UNIQUE(inode) = uniqueID = le64_to_cpu(lvhd->uniqueID); 110 UDF_I(inode)->i_unique = uniqueID = le64_to_cpu(lvhd->uniqueID);
111 if (!(++uniqueID & 0x00000000FFFFFFFFUL)) 111 if (!(++uniqueID & 0x00000000FFFFFFFFUL))
112 uniqueID += 16; 112 uniqueID += 16;
113 lvhd->uniqueID = cpu_to_le64(uniqueID); 113 lvhd->uniqueID = cpu_to_le64(uniqueID);
@@ -123,41 +123,41 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err)
123 inode->i_gid = current->fsgid; 123 inode->i_gid = current->fsgid;
124 } 124 }
125 125
126 UDF_I_LOCATION(inode).logicalBlockNum = block; 126 UDF_I(inode)->i_location.logicalBlockNum = block;
127 UDF_I_LOCATION(inode).partitionReferenceNum = 127 UDF_I(inode)->i_location.partitionReferenceNum =
128 UDF_I_LOCATION(dir).partitionReferenceNum; 128 UDF_I(dir)->i_location.partitionReferenceNum;
129 inode->i_ino = udf_get_lb_pblock(sb, UDF_I_LOCATION(inode), 0); 129 inode->i_ino = udf_get_lb_pblock(sb, UDF_I(inode)->i_location, 0);
130 inode->i_blocks = 0; 130 inode->i_blocks = 0;
131 UDF_I_LENEATTR(inode) = 0; 131 UDF_I(inode)->i_lenEAttr = 0;
132 UDF_I_LENALLOC(inode) = 0; 132 UDF_I(inode)->i_lenAlloc = 0;
133 UDF_I_USE(inode) = 0; 133 UDF_I(inode)->i_use = 0;
134 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_EXTENDED_FE)) { 134 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_EXTENDED_FE)) {
135 UDF_I_EFE(inode) = 1; 135 UDF_I(inode)->i_efe = 1;
136 if (UDF_VERS_USE_EXTENDED_FE > sbi->s_udfrev) 136 if (UDF_VERS_USE_EXTENDED_FE > sbi->s_udfrev)
137 sbi->s_udfrev = UDF_VERS_USE_EXTENDED_FE; 137 sbi->s_udfrev = UDF_VERS_USE_EXTENDED_FE;
138 UDF_I_DATA(inode) = kzalloc(inode->i_sb->s_blocksize - 138 UDF_I(inode)->i_ext.i_data = kzalloc(inode->i_sb->s_blocksize -
139 sizeof(struct extendedFileEntry), 139 sizeof(struct extendedFileEntry),
140 GFP_KERNEL); 140 GFP_KERNEL);
141 } else { 141 } else {
142 UDF_I_EFE(inode) = 0; 142 UDF_I(inode)->i_efe = 0;
143 UDF_I_DATA(inode) = kzalloc(inode->i_sb->s_blocksize - 143 UDF_I(inode)->i_ext.i_data = kzalloc(inode->i_sb->s_blocksize -
144 sizeof(struct fileEntry), 144 sizeof(struct fileEntry),
145 GFP_KERNEL); 145 GFP_KERNEL);
146 } 146 }
147 if (!UDF_I_DATA(inode)) { 147 if (!UDF_I(inode)->i_ext.i_data) {
148 iput(inode); 148 iput(inode);
149 *err = -ENOMEM; 149 *err = -ENOMEM;
150 mutex_unlock(&sbi->s_alloc_mutex); 150 mutex_unlock(&sbi->s_alloc_mutex);
151 return NULL; 151 return NULL;
152 } 152 }
153 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_AD_IN_ICB)) 153 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_AD_IN_ICB))
154 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_IN_ICB; 154 UDF_I(inode)->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB;
155 else if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_SHORT_AD)) 155 else if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_SHORT_AD))
156 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_SHORT; 156 UDF_I(inode)->i_alloc_type = ICBTAG_FLAG_AD_SHORT;
157 else 157 else
158 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_LONG; 158 UDF_I(inode)->i_alloc_type = ICBTAG_FLAG_AD_LONG;
159 inode->i_mtime = inode->i_atime = inode->i_ctime = 159 inode->i_mtime = inode->i_atime = inode->i_ctime =
160 UDF_I_CRTIME(inode) = current_fs_time(inode->i_sb); 160 UDF_I(inode)->i_crtime = current_fs_time(inode->i_sb);
161 insert_inode_hash(inode); 161 insert_inode_hash(inode);
162 mark_inode_dirty(inode); 162 mark_inode_dirty(inode);
163 mutex_unlock(&sbi->s_alloc_mutex); 163 mutex_unlock(&sbi->s_alloc_mutex);