diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2008-02-08 07:20:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 12:22:34 -0500 |
commit | 6c79e987d629cb0f8f7e2983725f4434a2dec66b (patch) | |
tree | ea2e17a12a0bdc5d68d2fe49941bfdf249e0f647 /fs/udf/namei.c | |
parent | 3a71fc5de56338076fe99f24f50bccfebabefe18 (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/namei.c')
-rw-r--r-- | fs/udf/namei.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index bec96a6b3343..86033d92824c 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c | |||
@@ -325,7 +325,7 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, | |||
325 | struct udf_fileident_bh *fibh, | 325 | struct udf_fileident_bh *fibh, |
326 | struct fileIdentDesc *cfi, int *err) | 326 | struct fileIdentDesc *cfi, int *err) |
327 | { | 327 | { |
328 | struct super_block *sb; | 328 | struct super_block *sb = dir->i_sb; |
329 | struct fileIdentDesc *fi = NULL; | 329 | struct fileIdentDesc *fi = NULL; |
330 | char name[UDF_NAME_LEN], fname[UDF_NAME_LEN]; | 330 | char name[UDF_NAME_LEN], fname[UDF_NAME_LEN]; |
331 | int namelen; | 331 | int namelen; |
@@ -342,8 +342,6 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, | |||
342 | sector_t offset; | 342 | sector_t offset; |
343 | struct extent_position epos = {}; | 343 | struct extent_position epos = {}; |
344 | 344 | ||
345 | sb = dir->i_sb; | ||
346 | |||
347 | if (dentry) { | 345 | if (dentry) { |
348 | if (!dentry->d_name.len) { | 346 | if (!dentry->d_name.len) { |
349 | *err = -EINVAL; | 347 | *err = -EINVAL; |
@@ -535,7 +533,7 @@ add: | |||
535 | } | 533 | } |
536 | 534 | ||
537 | memset(cfi, 0, sizeof(struct fileIdentDesc)); | 535 | memset(cfi, 0, sizeof(struct fileIdentDesc)); |
538 | if (UDF_SB_UDFREV(sb) >= 0x0200) | 536 | if (UDF_SB(sb)->s_udfrev >= 0x0200) |
539 | udf_new_tag((char *)cfi, TAG_IDENT_FID, 3, 1, block, sizeof(tag)); | 537 | udf_new_tag((char *)cfi, TAG_IDENT_FID, 3, 1, block, sizeof(tag)); |
540 | else | 538 | else |
541 | udf_new_tag((char *)cfi, TAG_IDENT_FID, 2, 1, block, sizeof(tag)); | 539 | udf_new_tag((char *)cfi, TAG_IDENT_FID, 2, 1, block, sizeof(tag)); |
@@ -901,6 +899,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry, | |||
901 | int block; | 899 | int block; |
902 | char name[UDF_NAME_LEN]; | 900 | char name[UDF_NAME_LEN]; |
903 | int namelen; | 901 | int namelen; |
902 | struct buffer_head *bh; | ||
904 | 903 | ||
905 | lock_kernel(); | 904 | lock_kernel(); |
906 | if (!(inode = udf_new_inode(dir, S_IFLNK, &err))) | 905 | if (!(inode = udf_new_inode(dir, S_IFLNK, &err))) |
@@ -1014,17 +1013,19 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry, | |||
1014 | goto out_no_entry; | 1013 | goto out_no_entry; |
1015 | cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); | 1014 | cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); |
1016 | cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode)); | 1015 | cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode)); |
1017 | if (UDF_SB_LVIDBH(inode->i_sb)) { | 1016 | bh = UDF_SB(inode->i_sb)->s_lvid_bh; |
1017 | if (bh) { | ||
1018 | struct logicalVolIntegrityDesc *lvid = (struct logicalVolIntegrityDesc *)bh->b_data; | ||
1018 | struct logicalVolHeaderDesc *lvhd; | 1019 | struct logicalVolHeaderDesc *lvhd; |
1019 | uint64_t uniqueID; | 1020 | uint64_t uniqueID; |
1020 | lvhd = (struct logicalVolHeaderDesc *)(UDF_SB_LVID(inode->i_sb)->logicalVolContentsUse); | 1021 | lvhd = (struct logicalVolHeaderDesc *)(lvid->logicalVolContentsUse); |
1021 | uniqueID = le64_to_cpu(lvhd->uniqueID); | 1022 | uniqueID = le64_to_cpu(lvhd->uniqueID); |
1022 | *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = | 1023 | *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = |
1023 | cpu_to_le32(uniqueID & 0x00000000FFFFFFFFUL); | 1024 | cpu_to_le32(uniqueID & 0x00000000FFFFFFFFUL); |
1024 | if (!(++uniqueID & 0x00000000FFFFFFFFUL)) | 1025 | if (!(++uniqueID & 0x00000000FFFFFFFFUL)) |
1025 | uniqueID += 16; | 1026 | uniqueID += 16; |
1026 | lvhd->uniqueID = cpu_to_le64(uniqueID); | 1027 | lvhd->uniqueID = cpu_to_le64(uniqueID); |
1027 | mark_buffer_dirty(UDF_SB_LVIDBH(inode->i_sb)); | 1028 | mark_buffer_dirty(bh); |
1028 | } | 1029 | } |
1029 | udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); | 1030 | udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); |
1030 | if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) { | 1031 | if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) { |
@@ -1053,6 +1054,7 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir, | |||
1053 | struct udf_fileident_bh fibh; | 1054 | struct udf_fileident_bh fibh; |
1054 | struct fileIdentDesc cfi, *fi; | 1055 | struct fileIdentDesc cfi, *fi; |
1055 | int err; | 1056 | int err; |
1057 | struct buffer_head *bh; | ||
1056 | 1058 | ||
1057 | lock_kernel(); | 1059 | lock_kernel(); |
1058 | if (inode->i_nlink >= (256 << sizeof(inode->i_nlink)) - 1) { | 1060 | if (inode->i_nlink >= (256 << sizeof(inode->i_nlink)) - 1) { |
@@ -1066,17 +1068,19 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir, | |||
1066 | } | 1068 | } |
1067 | cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); | 1069 | cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); |
1068 | cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode)); | 1070 | cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode)); |
1069 | if (UDF_SB_LVIDBH(inode->i_sb)) { | 1071 | bh = UDF_SB(inode->i_sb)->s_lvid_bh; |
1072 | if (bh) { | ||
1073 | struct logicalVolIntegrityDesc *lvid = (struct logicalVolIntegrityDesc *)bh->b_data; | ||
1070 | struct logicalVolHeaderDesc *lvhd; | 1074 | struct logicalVolHeaderDesc *lvhd; |
1071 | uint64_t uniqueID; | 1075 | uint64_t uniqueID; |
1072 | lvhd = (struct logicalVolHeaderDesc *)(UDF_SB_LVID(inode->i_sb)->logicalVolContentsUse); | 1076 | lvhd = (struct logicalVolHeaderDesc *)(lvid->logicalVolContentsUse); |
1073 | uniqueID = le64_to_cpu(lvhd->uniqueID); | 1077 | uniqueID = le64_to_cpu(lvhd->uniqueID); |
1074 | *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = | 1078 | *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = |
1075 | cpu_to_le32(uniqueID & 0x00000000FFFFFFFFUL); | 1079 | cpu_to_le32(uniqueID & 0x00000000FFFFFFFFUL); |
1076 | if (!(++uniqueID & 0x00000000FFFFFFFFUL)) | 1080 | if (!(++uniqueID & 0x00000000FFFFFFFFUL)) |
1077 | uniqueID += 16; | 1081 | uniqueID += 16; |
1078 | lvhd->uniqueID = cpu_to_le64(uniqueID); | 1082 | lvhd->uniqueID = cpu_to_le64(uniqueID); |
1079 | mark_buffer_dirty(UDF_SB_LVIDBH(inode->i_sb)); | 1083 | mark_buffer_dirty(bh); |
1080 | } | 1084 | } |
1081 | udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); | 1085 | udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); |
1082 | if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) { | 1086 | if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) { |