aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/ialloc.c
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-02-08 07:20:30 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:34 -0500
commit6c79e987d629cb0f8f7e2983725f4434a2dec66b (patch)
treeea2e17a12a0bdc5d68d2fe49941bfdf249e0f647 /fs/udf/ialloc.c
parent3a71fc5de56338076fe99f24f50bccfebabefe18 (diff)
udf: remove some ugly macros
remove macros: - UDF_SB_PARTMAPS - UDF_SB_PARTTYPE - UDF_SB_PARTROOT - UDF_SB_PARTLEN - UDF_SB_PARTVSN - UDF_SB_PARTNUM - UDF_SB_TYPESPAR - UDF_SB_TYPEVIRT - UDF_SB_PARTFUNC - UDF_SB_PARTFLAGS - UDF_SB_VOLIDENT - UDF_SB_NUMPARTS - UDF_SB_PARTITION - UDF_SB_SESSION - UDF_SB_ANCHOR - UDF_SB_LASTBLOCK - UDF_SB_LVIDBH - UDF_SB_LVID - UDF_SB_UMASK - UDF_SB_GID - UDF_SB_UID - UDF_SB_RECORDTIME - UDF_SB_SERIALNUM - UDF_SB_UDFREV - UDF_SB_FLAGS - UDF_SB_VAT - UDF_UPDATE_UDFREV - UDF_SB_FREE and open code them convert UDF_SB_LVIDIU macro to udf_sb_lvidiu function rename some struct udf_sb_info fields: - s_volident to s_volume_ident - s_lastblock to s_last_block - s_lvidbh to s_lvid_bh - s_recordtime to s_record_time - s_serialnum to s_serial_number; - s_vat to s_vat_inode; Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: Ben Fennema <bfennema@falcon.csc.calpoly.edu> Cc: Jan Kara <jack@suse.cz> Acked-by: Christoph Hellwig <hch@infradead.org> 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.c33
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;