aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEvgeniy Dushistov <dushistov@mail.ru>2007-02-12 03:54:32 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:40 -0500
commit54fb996ac15c4014fa4d6b0ec8e42da134204897 (patch)
treeee7a98270cabefc996a13691a7c9d63141a8d3a9 /include
parent3313e29267414e4e3bf0d3de1caf9cb439b64aaf (diff)
[PATCH] ufs2 write: block allocation update
Patch adds ability to work with 64bit metadata, this made by replacing work with 32bit pointers by inline functions. Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ufs_fs.h33
-rw-r--r--include/linux/ufs_fs_i.h2
2 files changed, 23 insertions, 12 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 */
diff --git a/include/linux/ufs_fs_i.h b/include/linux/ufs_fs_i.h
index fef77d52b029..6496caa82f9e 100644
--- a/include/linux/ufs_fs_i.h
+++ b/include/linux/ufs_fs_i.h
@@ -25,7 +25,7 @@ struct ufs_inode_info {
25 __u32 i_unused2; 25 __u32 i_unused2;
26 __u32 i_oeftflag; 26 __u32 i_oeftflag;
27 __u16 i_osync; 27 __u16 i_osync;
28 __u32 i_lastfrag; 28 __u64 i_lastfrag;
29 __u32 i_dir_start_lookup; 29 __u32 i_dir_start_lookup;
30 struct inode vfs_inode; 30 struct inode vfs_inode;
31}; 31};