patch-2.4.10 linux/fs/ntfs/macros.h
Next file: linux/fs/ntfs/struct.h
Previous file: linux/fs/ntfs/inode.h
Back to the patch index
Back to the overall index
- Lines: 36
- Date:
Sat Sep 8 12:24:40 2001
- Orig file:
v2.4.9/linux/fs/ntfs/macros.h
- Orig date:
Mon Aug 27 12:41:46 2001
diff -u --recursive --new-file v2.4.9/linux/fs/ntfs/macros.h linux/fs/ntfs/macros.h
@@ -1,15 +1,31 @@
-/* macros.h
+/*
+ * macros.h
*
- * Copyright (C) 1995 Martin von Löwis
- * Copyright (C) 1996 Régis Duchesne
+ * Copyright (C) 1995 Martin von Löwis
+ * Copyright (C) 1996 Régis Duchesne
+ * Copyright (c) 2001 Anton Altaparmakov
*/
+#include <linux/ntfs_fs_i.h>
+#include <linux/fs.h>
+#include <asm/page.h>
#define NTFS_FD(vol) ((vol)->u.fd)
#define NTFS_SB(vol) ((struct super_block*)(vol)->sb)
#define NTFS_SB2VOL(sb) (&(sb)->u.ntfs_sb)
#define NTFS_INO2VOL(ino) (&((ino)->i_sb->u.ntfs_sb))
-#define NTFS_LINO2NINO(ino) (&((ino)->u.ntfs_i))
+#define NTFS_LINO2NINO(ino) ((struct ntfs_inode_info*)(&((ino)->u.ntfs_i)))
+static inline struct inode *VFS_I(struct ntfs_inode_info *ntfs_ino)
+{
+ struct inode *i = (struct inode*)((char*)ntfs_ino -
+ ((char*)&(((struct inode*)NULL)->u.ntfs_i) -
+ (char*)NULL));
+#ifdef DEBUG
+ if ((char*)NTFS_LINO2NINO(i) != (char*)ntfs_ino)
+ BUG();
+#endif
+ return i;
+}
#define IS_MAGIC(a,b) (*(int*)(a) == *(int*)(b))
#define IS_MFT_RECORD(a) IS_MAGIC((a),"FILE")
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)