diff options
Diffstat (limited to 'include/linux/ufs_fs.h')
-rw-r--r-- | include/linux/ufs_fs.h | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index 28967eda9d7b..dc2e9fe69418 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h | |||
@@ -40,13 +40,16 @@ typedef __u64 __fs64; | |||
40 | typedef __u32 __fs32; | 40 | typedef __u32 __fs32; |
41 | typedef __u16 __fs16; | 41 | typedef __u16 __fs16; |
42 | #else | 42 | #else |
43 | #include <asm/div64.h> | ||
43 | typedef __u64 __bitwise __fs64; | 44 | typedef __u64 __bitwise __fs64; |
44 | typedef __u32 __bitwise __fs32; | 45 | typedef __u32 __bitwise __fs32; |
45 | typedef __u16 __bitwise __fs16; | 46 | typedef __u16 __bitwise __fs16; |
46 | #endif | 47 | #endif |
47 | 48 | ||
49 | #ifdef __KERNEL__ | ||
48 | #include <linux/ufs_fs_i.h> | 50 | #include <linux/ufs_fs_i.h> |
49 | #include <linux/ufs_fs_sb.h> | 51 | #include <linux/ufs_fs_sb.h> |
52 | #endif | ||
50 | 53 | ||
51 | #define UFS_BBLOCK 0 | 54 | #define UFS_BBLOCK 0 |
52 | #define UFS_BBSIZE 8192 | 55 | #define UFS_BBSIZE 8192 |
@@ -261,17 +264,10 @@ typedef __u16 __bitwise __fs16; | |||
261 | */ | 264 | */ |
262 | #define ufs_inotocg(x) ((x) / uspi->s_ipg) | 265 | #define ufs_inotocg(x) ((x) / uspi->s_ipg) |
263 | #define ufs_inotocgoff(x) ((x) % uspi->s_ipg) | 266 | #define ufs_inotocgoff(x) ((x) % uspi->s_ipg) |
264 | #define ufs_inotofsba(x) (ufs_cgimin(ufs_inotocg(x)) + ufs_inotocgoff(x) / uspi->s_inopf) | 267 | #define ufs_inotofsba(x) (((u64)ufs_cgimin(ufs_inotocg(x))) + ufs_inotocgoff(x) / uspi->s_inopf) |
265 | #define ufs_inotofsbo(x) ((x) % uspi->s_inopf) | 268 | #define ufs_inotofsbo(x) ((x) % uspi->s_inopf) |
266 | 269 | ||
267 | /* | 270 | /* |
268 | * Give cylinder group number for a file system block. | ||
269 | * Give cylinder group block number for a file system block. | ||
270 | */ | ||
271 | #define ufs_dtog(d) ((d) / uspi->s_fpg) | ||
272 | #define ufs_dtogd(d) ((d) % uspi->s_fpg) | ||
273 | |||
274 | /* | ||
275 | * Compute the cylinder and rotational position of a cyl block addr. | 271 | * Compute the cylinder and rotational position of a cyl block addr. |
276 | */ | 272 | */ |
277 | #define ufs_cbtocylno(bno) \ | 273 | #define ufs_cbtocylno(bno) \ |
@@ -303,7 +299,7 @@ typedef __u16 __bitwise __fs16; | |||
303 | #define UFS_MAXMNTLEN 512 | 299 | #define UFS_MAXMNTLEN 512 |
304 | #define UFS2_MAXMNTLEN 468 | 300 | #define UFS2_MAXMNTLEN 468 |
305 | #define UFS2_MAXVOLLEN 32 | 301 | #define UFS2_MAXVOLLEN 32 |
306 | /* #define UFS_MAXCSBUFS 31 */ | 302 | #define UFS_MAXCSBUFS 31 |
307 | #define UFS_LINK_MAX 32000 | 303 | #define UFS_LINK_MAX 32000 |
308 | /* | 304 | /* |
309 | #define UFS2_NOCSPTRS ((128 / sizeof(void *)) - 4) | 305 | #define UFS2_NOCSPTRS ((128 / sizeof(void *)) - 4) |
@@ -721,6 +717,7 @@ struct ufs_cg_private_info { | |||
721 | __u32 c_nclusterblks; /* number of clusters this cg */ | 717 | __u32 c_nclusterblks; /* number of clusters this cg */ |
722 | }; | 718 | }; |
723 | 719 | ||
720 | |||
724 | struct ufs_sb_private_info { | 721 | struct ufs_sb_private_info { |
725 | struct ufs_buffer_head s_ubh; /* buffer containing super block */ | 722 | struct ufs_buffer_head s_ubh; /* buffer containing super block */ |
726 | struct ufs_csum_core cs_total; | 723 | struct ufs_csum_core cs_total; |
@@ -754,7 +751,7 @@ struct ufs_sb_private_info { | |||
754 | __u32 s_npsect; /* # sectors/track including spares */ | 751 | __u32 s_npsect; /* # sectors/track including spares */ |
755 | __u32 s_interleave; /* hardware sector interleave */ | 752 | __u32 s_interleave; /* hardware sector interleave */ |
756 | __u32 s_trackskew; /* sector 0 skew, per track */ | 753 | __u32 s_trackskew; /* sector 0 skew, per track */ |
757 | __u32 s_csaddr; /* blk addr of cyl grp summary area */ | 754 | __u64 s_csaddr; /* blk addr of cyl grp summary area */ |
758 | __u32 s_cssize; /* size of cyl grp summary area */ | 755 | __u32 s_cssize; /* size of cyl grp summary area */ |
759 | __u32 s_cgsize; /* cylinder group size */ | 756 | __u32 s_cgsize; /* cylinder group size */ |
760 | __u32 s_ntrak; /* tracks per cylinder */ | 757 | __u32 s_ntrak; /* tracks per cylinder */ |
@@ -789,6 +786,7 @@ struct ufs_sb_private_info { | |||
789 | 786 | ||
790 | __u32 s_maxsymlinklen;/* upper limit on fast symlinks' size */ | 787 | __u32 s_maxsymlinklen;/* upper limit on fast symlinks' size */ |
791 | __s32 fs_magic; /* filesystem magic */ | 788 | __s32 fs_magic; /* filesystem magic */ |
789 | unsigned int s_dirblksize; | ||
792 | }; | 790 | }; |
793 | 791 | ||
794 | /* | 792 | /* |
@@ -949,17 +947,17 @@ struct ufs_super_block_third { | |||
949 | #ifdef __KERNEL__ | 947 | #ifdef __KERNEL__ |
950 | 948 | ||
951 | /* balloc.c */ | 949 | /* balloc.c */ |
952 | extern void ufs_free_fragments (struct inode *, unsigned, unsigned); | 950 | extern void ufs_free_fragments (struct inode *, u64, unsigned); |
953 | extern void ufs_free_blocks (struct inode *, unsigned, unsigned); | 951 | extern void ufs_free_blocks (struct inode *, u64, unsigned); |
954 | extern unsigned ufs_new_fragments(struct inode *, __fs32 *, unsigned, unsigned, | 952 | extern u64 ufs_new_fragments(struct inode *, void *, u64, u64, |
955 | unsigned, int *, struct page *); | 953 | unsigned, int *, struct page *); |
956 | 954 | ||
957 | /* cylinder.c */ | 955 | /* cylinder.c */ |
958 | extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); | 956 | extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); |
959 | extern void ufs_put_cylinder (struct super_block *, unsigned); | 957 | extern void ufs_put_cylinder (struct super_block *, unsigned); |
960 | 958 | ||
961 | /* dir.c */ | 959 | /* dir.c */ |
962 | extern struct inode_operations ufs_dir_inode_operations; | 960 | extern const struct inode_operations ufs_dir_inode_operations; |
963 | extern int ufs_add_link (struct dentry *, struct inode *); | 961 | extern int ufs_add_link (struct dentry *, struct inode *); |
964 | extern ino_t ufs_inode_by_name(struct inode *, struct dentry *); | 962 | extern ino_t ufs_inode_by_name(struct inode *, struct dentry *); |
965 | extern int ufs_make_empty(struct inode *, struct inode *); | 963 | extern int ufs_make_empty(struct inode *, struct inode *); |
@@ -971,7 +969,7 @@ extern void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de, | |||
971 | struct page *page, struct inode *inode); | 969 | struct page *page, struct inode *inode); |
972 | 970 | ||
973 | /* file.c */ | 971 | /* file.c */ |
974 | extern struct inode_operations ufs_file_inode_operations; | 972 | extern const struct inode_operations ufs_file_inode_operations; |
975 | extern const struct file_operations ufs_file_operations; | 973 | extern const struct file_operations ufs_file_operations; |
976 | 974 | ||
977 | extern const struct address_space_operations ufs_aops; | 975 | extern const struct address_space_operations ufs_aops; |
@@ -998,7 +996,7 @@ extern void ufs_error (struct super_block *, const char *, const char *, ...) __ | |||
998 | extern void ufs_panic (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); | 996 | extern void ufs_panic (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); |
999 | 997 | ||
1000 | /* symlink.c */ | 998 | /* symlink.c */ |
1001 | extern struct inode_operations ufs_fast_symlink_inode_operations; | 999 | extern const struct inode_operations ufs_fast_symlink_inode_operations; |
1002 | 1000 | ||
1003 | /* truncate.c */ | 1001 | /* truncate.c */ |
1004 | extern int ufs_truncate (struct inode *, loff_t); | 1002 | extern int ufs_truncate (struct inode *, loff_t); |
@@ -1013,6 +1011,22 @@ static inline struct ufs_inode_info *UFS_I(struct inode *inode) | |||
1013 | return container_of(inode, struct ufs_inode_info, vfs_inode); | 1011 | return container_of(inode, struct ufs_inode_info, vfs_inode); |
1014 | } | 1012 | } |
1015 | 1013 | ||
1014 | /* | ||
1015 | * Give cylinder group number for a file system block. | ||
1016 | * Give cylinder group block number for a file system block. | ||
1017 | */ | ||
1018 | /* #define ufs_dtog(d) ((d) / uspi->s_fpg) */ | ||
1019 | static inline u64 ufs_dtog(struct ufs_sb_private_info * uspi, u64 b) | ||
1020 | { | ||
1021 | do_div(b, uspi->s_fpg); | ||
1022 | return b; | ||
1023 | } | ||
1024 | /* #define ufs_dtogd(d) ((d) % uspi->s_fpg) */ | ||
1025 | static inline u32 ufs_dtogd(struct ufs_sb_private_info * uspi, u64 b) | ||
1026 | { | ||
1027 | return do_div(b, uspi->s_fpg); | ||
1028 | } | ||
1029 | |||
1016 | #endif /* __KERNEL__ */ | 1030 | #endif /* __KERNEL__ */ |
1017 | 1031 | ||
1018 | #endif /* __LINUX_UFS_FS_H */ | 1032 | #endif /* __LINUX_UFS_FS_H */ |