aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ufs_fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ufs_fs.h')
-rw-r--r--include/linux/ufs_fs.h33
1 files changed, 22 insertions, 11 deletions
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 24ce39820560..44c45449065c 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -40,6 +40,7 @@ typedef __u64 __fs64;
40typedef __u32 __fs32; 40typedef __u32 __fs32;
41typedef __u16 __fs16; 41typedef __u16 __fs16;
42#else 42#else
43#include <asm/div64.h>
43typedef __u64 __bitwise __fs64; 44typedef __u64 __bitwise __fs64;
44typedef __u32 __bitwise __fs32; 45typedef __u32 __bitwise __fs32;
45typedef __u16 __bitwise __fs16; 46typedef __u16 __bitwise __fs16;
@@ -267,13 +268,6 @@ typedef __u16 __bitwise __fs16;
267#define ufs_inotofsbo(x) ((x) % uspi->s_inopf) 268#define ufs_inotofsbo(x) ((x) % uspi->s_inopf)
268 269
269/* 270/*
270 * Give cylinder group number for a file system block.
271 * Give cylinder group block number for a file system block.
272 */
273#define ufs_dtog(d) ((d) / uspi->s_fpg)
274#define ufs_dtogd(d) ((d) % uspi->s_fpg)
275
276/*
277 * Compute the cylinder and rotational position of a cyl block addr. 271 * Compute the cylinder and rotational position of a cyl block addr.
278 */ 272 */
279#define ufs_cbtocylno(bno) \ 273#define ufs_cbtocylno(bno) \
@@ -723,6 +717,7 @@ struct ufs_cg_private_info {
723 __u32 c_nclusterblks; /* number of clusters this cg */ 717 __u32 c_nclusterblks; /* number of clusters this cg */
724}; 718};
725 719
720
726struct ufs_sb_private_info { 721struct ufs_sb_private_info {
727 struct ufs_buffer_head s_ubh; /* buffer containing super block */ 722 struct ufs_buffer_head s_ubh; /* buffer containing super block */
728 struct ufs_csum_core cs_total; 723 struct ufs_csum_core cs_total;
@@ -952,10 +947,10 @@ struct ufs_super_block_third {
952#ifdef __KERNEL__ 947#ifdef __KERNEL__
953 948
954/* balloc.c */ 949/* balloc.c */
955extern void ufs_free_fragments (struct inode *, unsigned, unsigned); 950extern void ufs_free_fragments (struct inode *, u64, unsigned);
956extern void ufs_free_blocks (struct inode *, unsigned, unsigned); 951extern void ufs_free_blocks (struct inode *, u64, unsigned);
957extern unsigned ufs_new_fragments(struct inode *, __fs32 *, unsigned, unsigned, 952extern u64 ufs_new_fragments(struct inode *, void *, u64, u64,
958 unsigned, int *, struct page *); 953 unsigned, int *, struct page *);
959 954
960/* cylinder.c */ 955/* cylinder.c */
961extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); 956extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned);
@@ -1016,6 +1011,22 @@ static inline struct ufs_inode_info *UFS_I(struct inode *inode)
1016 return container_of(inode, struct ufs_inode_info, vfs_inode); 1011 return container_of(inode, struct ufs_inode_info, vfs_inode);
1017} 1012}
1018 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) */
1019static 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) */
1025static inline u32 ufs_dtogd(struct ufs_sb_private_info * uspi, u64 b)
1026{
1027 return do_div(b, uspi->s_fpg);
1028}
1029
1019#endif /* __KERNEL__ */ 1030#endif /* __KERNEL__ */
1020 1031
1021#endif /* __LINUX_UFS_FS_H */ 1032#endif /* __LINUX_UFS_FS_H */