Skip to contentSkip to conversation

ufs: move non-layout parts of ufs_fs.h to fs/ufs/

PATCH In review Christoph Hellwig 3 participants 4 messages Aug 3, 2007 – Aug 5, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ufs: move non-layout parts of ufs_fs.h to fs/ufs/

Move prototypes and in-core structures to fs/uf/ similar to what most other filesystems already do.

fs/ufs/balloc.c +1 -0
Index: linux-2.6/fs/ufs/balloc.c
===================================================================
@@ -19,6 +19,7 @@
 #include <linux/bitops.h>
 #include <asm/byteorder.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/cylinder.c +1 -0
Index: linux-2.6/fs/ufs/cylinder.c
===================================================================
@@ -17,6 +17,7 @@
 
 #include <asm/byteorder.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/dir.c +1 -0
Index: linux-2.6/fs/ufs/dir.c
===================================================================
@@ -20,6 +20,7 @@
 #include <linux/fs.h>
 #include <linux/ufs_fs.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/file.c +3 -0
Index: linux-2.6/fs/ufs/file.c
===================================================================
@@ -27,6 +27,9 @@
 #include <linux/ufs_fs.h>
 #include <linux/buffer_head.h>	/* for sync_mapping_buffers() */
 
+#include "ufs.h"
+
+
 static int ufs_sync_file(struct file *file, struct dentry *dentry, int datasync)
 {
 	struct inode *inode = dentry->d_inode;
fs/ufs/ialloc.c +1 -0
Index: linux-2.6/fs/ufs/ialloc.c
===================================================================
@@ -34,6 +34,7 @@
 #include <linux/bitops.h>
 #include <asm/byteorder.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/inode.c +1 -0
Index: linux-2.6/fs/ufs/inode.c
===================================================================
@@ -38,6 +38,7 @@
 #include <linux/smp_lock.h>
 #include <linux/buffer_head.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/namei.c +1 -2
Index: linux-2.6/fs/ufs/namei.c
===================================================================
@@ -31,7 +31,7 @@
 #include <linux/fs.h>
 #include <linux/ufs_fs.h>
 #include <linux/smp_lock.h>
-#include "swab.h"	/* will go away - see comment in mknod() */
+#include "ufs.h"
 #include "util.h"
 
 static inline int ufs_add_nondir(struct dentry *dentry, struct inode *inode)
@@ -110,7 +110,6 @@ static int ufs_mknod (struct inode * dir
 	err = PTR_ERR(inode);
 	if (!IS_ERR(inode)) {
 		init_special_inode(inode, mode, rdev);
-		/* NOTE: that'll go when we get wide dev_t */
 		ufs_set_inode_dev(inode->i_sb, UFS_I(inode), rdev);
 		mark_inode_dirty(inode);
 		lock_kernel();
fs/ufs/super.c +1 -0
Index: linux-2.6/fs/ufs/super.c
===================================================================
@@ -89,6 +89,7 @@
 #include <linux/vfs.h>
 #include <linux/log2.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/symlink.c +2 -0
Index: linux-2.6/fs/ufs/symlink.c
===================================================================
@@ -28,6 +28,8 @@
 #include <linux/fs.h>
 #include <linux/namei.h>
 #include <linux/ufs_fs.h>
+#include "ufs.h"
+
 
 static void *ufs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
fs/ufs/truncate.c +1 -0
Index: linux-2.6/fs/ufs/truncate.c
===================================================================
@@ -46,6 +46,7 @@
 #include <linux/blkdev.h>
 #include <linux/sched.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/ufs.h new file +121 -0

121 lines not on this page · raw message

fs/ufs/util.c +1 -0
Index: linux-2.6/fs/ufs/util.c
===================================================================
@@ -11,6 +11,7 @@
 #include <linux/ufs_fs.h>
 #include <linux/buffer_head.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
include/linux/ufs_fs.h +0 -90

100 lines not on this page · raw message

include/linux/ufs_fs_i.h deleted +0 -33
Index: linux-2.6/include/linux/ufs_fs_i.h
===================================================================
@@ -1,33 +0,0 @@
-/*
- *  linux/include/linux/ufs_fs_i.h
- *
- * Copyright (C) 1996
- * Adrian Rodriguez ([email protected])
- * Laboratory for Computer Science Research Computing Facility
- * Rutgers, The State University of New Jersey
- *
- * NeXTstep support added on February 5th 1998 by
- * Niels Kristian Bech Jensen <[email protected]>.
- */
-
-#ifndef _LINUX_UFS_FS_I_H
-#define _LINUX_UFS_FS_I_H
-
-struct ufs_inode_info {
-	union {
-		__fs32	i_data[15];
-		__u8	i_symlink[4*15];
-		__fs64	u2_i_data[15];
-	} i_u1;
-	__u32	i_flags;
-	__u32	i_shadow;
-	__u32	i_unused1;
-	__u32	i_unused2;
-	__u32	i_oeftflag;
-	__u16	i_osync;
-	__u64	i_lastfrag;
-	__u32   i_dir_start_lookup;
-	struct inode vfs_inode;
-};
-
-#endif /* _LINUX_UFS_FS_I_H */
include/linux/ufs_fs_sb.h deleted +0 -37
Index: linux-2.6/include/linux/ufs_fs_sb.h
===================================================================
@@ -1,37 +0,0 @@
-/* 
- *  linux/include/linux/ufs_fs_sb.h
- *
- * Copyright (C) 1996
- * Adrian Rodriguez ([email protected])
- * Laboratory for Computer Science Research Computing Facility
- * Rutgers, The State University of New Jersey
- *
- * $Id: ufs_fs_sb.h,v 1.8 1998/05/06 12:04:40 jj Exp $
- *
- * Write support by Daniel Pirkl <[email protected]>
- */
-
-#ifndef __LINUX_UFS_FS_SB_H
-#define __LINUX_UFS_FS_SB_H
-
-
-#define UFS_MAX_GROUP_LOADED 8
-#define UFS_CGNO_EMPTY ((unsigned)-1)
-
-struct ufs_sb_private_info;
-struct ufs_cg_private_info;
-struct ufs_csum;
-
-struct ufs_sb_info {
-	struct ufs_sb_private_info * s_uspi;	
-	struct ufs_csum	* s_csp;
-	unsigned s_bytesex;
-	unsigned s_flags;
-	struct buffer_head ** s_ucg;
-	struct ufs_cg_private_info * s_ucpi[UFS_MAX_GROUP_LOADED]; 
-	unsigned s_cgno[UFS_MAX_GROUP_LOADED];
-	unsigned short s_cg_loaded;
-	unsigned s_mount_opt;
-};
-
-#endif
#1 lore raw

Move prototypes and in-core structures to fs/ufs/ similar to what most other filesystems already do.

I made little modifications: move also ufs debug macros and mount options constants into fs/ufs/ufs.h, this stuff also private for ufs.

---

fs/ufs/balloc.c +1 -0
Index: linux-2.6.23-rc2/fs/ufs/balloc.c
===================================================================
@@ -19,6 +19,7 @@
 #include <linux/bitops.h>
 #include <asm/byteorder.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/cylinder.c +1 -0
Index: linux-2.6.23-rc2/fs/ufs/cylinder.c
===================================================================
@@ -17,6 +17,7 @@
 
 #include <asm/byteorder.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/dir.c +1 -0
Index: linux-2.6.23-rc2/fs/ufs/dir.c
===================================================================
@@ -20,6 +20,7 @@
 #include <linux/fs.h>
 #include <linux/ufs_fs.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/file.c +3 -0
Index: linux-2.6.23-rc2/fs/ufs/file.c
===================================================================
@@ -27,6 +27,9 @@
 #include <linux/ufs_fs.h>
 #include <linux/buffer_head.h>	/* for sync_mapping_buffers() */
 
+#include "ufs.h"
+
+
 static int ufs_sync_file(struct file *file, struct dentry *dentry, int datasync)
 {
 	struct inode *inode = dentry->d_inode;
fs/ufs/ialloc.c +1 -0
Index: linux-2.6.23-rc2/fs/ufs/ialloc.c
===================================================================
@@ -34,6 +34,7 @@
 #include <linux/bitops.h>
 #include <asm/byteorder.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/inode.c +1 -0
Index: linux-2.6.23-rc2/fs/ufs/inode.c
===================================================================
@@ -38,6 +38,7 @@
 #include <linux/smp_lock.h>
 #include <linux/buffer_head.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/namei.c +1 -2
Index: linux-2.6.23-rc2/fs/ufs/namei.c
===================================================================
@@ -31,7 +31,7 @@
 #include <linux/fs.h>
 #include <linux/ufs_fs.h>
 #include <linux/smp_lock.h>
-#include "swab.h"	/* will go away - see comment in mknod() */
+#include "ufs.h"
 #include "util.h"
 
 static inline int ufs_add_nondir(struct dentry *dentry, struct inode *inode)
@@ -110,7 +110,6 @@ static int ufs_mknod (struct inode * dir
 	err = PTR_ERR(inode);
 	if (!IS_ERR(inode)) {
 		init_special_inode(inode, mode, rdev);
-		/* NOTE: that'll go when we get wide dev_t */
 		ufs_set_inode_dev(inode->i_sb, UFS_I(inode), rdev);
 		mark_inode_dirty(inode);
 		lock_kernel();
fs/ufs/super.c +1 -0
Index: linux-2.6.23-rc2/fs/ufs/super.c
===================================================================
@@ -91,6 +91,7 @@
 #include <linux/mount.h>
 #include <linux/seq_file.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/symlink.c +2 -0
Index: linux-2.6.23-rc2/fs/ufs/symlink.c
===================================================================
@@ -28,6 +28,8 @@
 #include <linux/fs.h>
 #include <linux/namei.h>
 #include <linux/ufs_fs.h>
+#include "ufs.h"
+
 
 static void *ufs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
fs/ufs/truncate.c +1 -0
Index: linux-2.6.23-rc2/fs/ufs/truncate.c
===================================================================
@@ -46,6 +46,7 @@
 #include <linux/blkdev.h>
 #include <linux/sched.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
fs/ufs/ufs.h new file +157 -0

157 lines not on this page · raw message

fs/ufs/util.c +1 -0
Index: linux-2.6.23-rc2/fs/ufs/util.c
===================================================================
@@ -11,6 +11,7 @@
 #include <linux/ufs_fs.h>
 #include <linux/buffer_head.h>
 
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
include/linux/ufs_fs.h +0 -126

148 lines not on this page · raw message

include/linux/ufs_fs_i.h deleted +0 -33
Index: linux-2.6.23-rc2/include/linux/ufs_fs_i.h
===================================================================
@@ -1,33 +0,0 @@
-/*
- *  linux/include/linux/ufs_fs_i.h
- *
- * Copyright (C) 1996
- * Adrian Rodriguez ([email protected])
- * Laboratory for Computer Science Research Computing Facility
- * Rutgers, The State University of New Jersey
- *
- * NeXTstep support added on February 5th 1998 by
- * Niels Kristian Bech Jensen <[email protected]>.
- */
-
-#ifndef _LINUX_UFS_FS_I_H
-#define _LINUX_UFS_FS_I_H
-
-struct ufs_inode_info {
-	union {
-		__fs32	i_data[15];
-		__u8	i_symlink[4*15];
-		__fs64	u2_i_data[15];
-	} i_u1;
-	__u32	i_flags;
-	__u32	i_shadow;
-	__u32	i_unused1;
-	__u32	i_unused2;
-	__u32	i_oeftflag;
-	__u16	i_osync;
-	__u64	i_lastfrag;
-	__u32   i_dir_start_lookup;
-	struct inode vfs_inode;
-};
-
-#endif /* _LINUX_UFS_FS_I_H */
include/linux/ufs_fs_sb.h deleted +0 -37
Index: linux-2.6.23-rc2/include/linux/ufs_fs_sb.h
===================================================================
@@ -1,37 +0,0 @@
-/* 
- *  linux/include/linux/ufs_fs_sb.h
- *
- * Copyright (C) 1996
- * Adrian Rodriguez ([email protected])
- * Laboratory for Computer Science Research Computing Facility
- * Rutgers, The State University of New Jersey
- *
- * $Id: ufs_fs_sb.h,v 1.8 1998/05/06 12:04:40 jj Exp $
- *
- * Write support by Daniel Pirkl <[email protected]>
- */
-
-#ifndef __LINUX_UFS_FS_SB_H
-#define __LINUX_UFS_FS_SB_H
-
-
-#define UFS_MAX_GROUP_LOADED 8
-#define UFS_CGNO_EMPTY ((unsigned)-1)
-
-struct ufs_sb_private_info;
-struct ufs_cg_private_info;
-struct ufs_csum;
-
-struct ufs_sb_info {
-	struct ufs_sb_private_info * s_uspi;	
-	struct ufs_csum	* s_csp;
-	unsigned s_bytesex;
-	unsigned s_flags;
-	struct buffer_head ** s_ucg;
-	struct ufs_cg_private_info * s_ucpi[UFS_MAX_GROUP_LOADED]; 
-	unsigned s_cgno[UFS_MAX_GROUP_LOADED];
-	unsigned short s_cg_loaded;
-	unsigned s_mount_opt;
-};
-
-#endif
Signature · 1 line
/Evgeniy
#2 lore raw
Quoted 6 lines · Evgeniy Dushistov

Move prototypes and in-core structures to fs/ufs/ similar to what most other filesystems already do.

I made little modifications: move also ufs debug macros and mount options constants into fs/ufs/ufs.h, this stuff also private for ufs.

Is there any reason to have util.h included directly? Or to have it as a separate file and not a part of ufs.h, while we are at it...

#3 lore raw
Quoted 10 lines · Al Viro
Quoted 6 lines · Evgeniy Dushistov

Move prototypes and in-core structures to fs/ufs/ similar to what most other filesystems already do.

I made little modifications: move also ufs debug macros and mount options constants into fs/ufs/ufs.h, this stuff also private for ufs.

Is there any reason to have util.h included directly? Or to have it as a separate file and not a part of ufs.h, while we are at it...

I didn't want to do too many different things at once, but getting rid of util.h sounds fine to me.