[Ocfs2-commits] jlbec commits r2245 - branches/alloc_inode/fs/ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Sat May 14 01:00:12 CDT 2005
Author: jlbec
Date: 2005-05-14 01:00:10 -0500 (Sat, 14 May 2005)
New Revision: 2245
Modified:
branches/alloc_inode/fs/ocfs2/aops.c
branches/alloc_inode/fs/ocfs2/buffer_head_io.c
branches/alloc_inode/fs/ocfs2/dcache.c
branches/alloc_inode/fs/ocfs2/extent_map.c
branches/alloc_inode/fs/ocfs2/file.c
branches/alloc_inode/fs/ocfs2/heartbeat.c
branches/alloc_inode/fs/ocfs2/inode.c
branches/alloc_inode/fs/ocfs2/inode.h
branches/alloc_inode/fs/ocfs2/journal.h
branches/alloc_inode/fs/ocfs2/localalloc.c
branches/alloc_inode/fs/ocfs2/ocfs.h
branches/alloc_inode/fs/ocfs2/ocfs2.h
branches/alloc_inode/fs/ocfs2/proc.c
branches/alloc_inode/fs/ocfs2/suballoc.c
branches/alloc_inode/fs/ocfs2/vote.c
Log:
o Move struct ocfs2_inode_info to inode.h where it belongs.
o Move all ip_flags work to inode_info, except INODE_INITIALIZED,
which is junk for generic_ip and will be dropped when I'm done.
Modified: branches/alloc_inode/fs/ocfs2/aops.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/aops.c 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/aops.c 2005-05-14 06:00:10 UTC (rev 2245)
@@ -136,7 +136,7 @@
mlog_entry("(0x%p, %llu, 0x%p, %d)\n", inode,
(unsigned long long)iblock, bh_result, create);
- if (OCFS_I(inode)->ip_flags & OCFS_INODE_SYSTEM_FILE) {
+ if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_SYSTEM_FILE) {
mlog(ML_NOTICE, "get_block on system inode 0x%p (%lu)\n",
inode, inode->i_ino);
}
Modified: branches/alloc_inode/fs/ocfs2/buffer_head_io.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/buffer_head_io.c 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/buffer_head_io.c 2005-05-14 06:00:10 UTC (rev 2245)
@@ -34,6 +34,7 @@
#include "ocfs2.h"
#include "alloc.h"
+#include "inode.h"
#include "journal.h"
#include "buffer_head_io.h"
Modified: branches/alloc_inode/fs/ocfs2/dcache.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/dcache.c 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/dcache.c 2005-05-14 06:00:10 UTC (rev 2245)
@@ -36,6 +36,7 @@
#include "alloc.h"
#include "dcache.h"
#include "file.h"
+#include "inode.h"
static int ocfs_dentry_revalidate(struct dentry *dentry, struct nameidata *nd)
{
Modified: branches/alloc_inode/fs/ocfs2/extent_map.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/extent_map.c 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/extent_map.c 2005-05-14 06:00:10 UTC (rev 2245)
@@ -39,6 +39,7 @@
#include "ocfs2.h"
#include "extent_map.h"
+#include "inode.h"
#include "buffer_head_io.h"
Modified: branches/alloc_inode/fs/ocfs2/file.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/file.c 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/file.c 2005-05-14 06:00:10 UTC (rev 2245)
@@ -88,6 +88,7 @@
{
int status;
int mode = file->f_flags;
+ struct ocfs2_inode_info *oi = OCFS2_I(inode);
ocfs_inode_private *oip = OCFS_I(inode);
mlog_entry ("(0x%p, 0x%p, '%.*s')\n", inode, file,
@@ -99,13 +100,13 @@
spin_lock(&oip->ip_lock);
if (oip->ip_open_cnt &&
!ocfs2_valid_open(mode,
- oip->ip_flags & OCFS_INODE_OPEN_DIRECT)) {
+ oi->ip_flags & OCFS2_INODE_OPEN_DIRECT)) {
spin_unlock(&oip->ip_lock);
goto leave;
}
if (mode & O_DIRECT)
- oip->ip_flags |= OCFS_INODE_OPEN_DIRECT;
+ oi->ip_flags |= OCFS2_INODE_OPEN_DIRECT;
oip->ip_open_cnt++;
spin_unlock(&oip->ip_lock);
@@ -117,6 +118,7 @@
static int ocfs_file_release(struct inode *inode, struct file *file)
{
+ struct ocfs2_inode_info *oi = OCFS2_I(inode);
ocfs_inode_private *oip = OCFS_I(inode);
mlog_entry("(0x%p, 0x%p, '%.*s')\n", inode, file,
@@ -125,7 +127,7 @@
spin_lock(&oip->ip_lock);
if (!--oip->ip_open_cnt)
- oip->ip_flags &= ~OCFS_INODE_OPEN_DIRECT;
+ oi->ip_flags &= ~OCFS2_INODE_OPEN_DIRECT;
spin_unlock(&oip->ip_lock);
mlog_exit(0);
@@ -1016,7 +1018,7 @@
ocfs2_update_inode_size(inode, newsize);
spin_lock(&OCFS_I(inode)->ip_lock);
- if (OCFS_I(inode)->ip_flags & OCFS_INODE_OPEN_DIRECT) {
+ if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_OPEN_DIRECT) {
/* This is a total broken hack for O_DIRECT crack */
OCFS_I(inode)->ip_mmu_private = i_size_read(inode);
}
Modified: branches/alloc_inode/fs/ocfs2/heartbeat.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/heartbeat.c 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/heartbeat.c 2005-05-14 06:00:10 UTC (rev 2245)
@@ -41,6 +41,7 @@
#include "alloc.h"
#include "heartbeat.h"
+#include "inode.h"
#include "journal.h"
#include "vote.h"
Modified: branches/alloc_inode/fs/ocfs2/inode.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/inode.c 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/inode.c 2005-05-14 06:00:10 UTC (rev 2245)
@@ -309,10 +309,10 @@
inode->i_nlink = fe->i_links_count;
if (fe->i_flags & OCFS2_LOCAL_ALLOC_FL) {
- OCFS_I(inode)->ip_flags |= OCFS_INODE_BITMAP;
+ OCFS2_I(inode)->ip_flags |= OCFS2_INODE_BITMAP;
mlog(0, "local alloc inode: i_ino=%lu\n", inode->i_ino);
} else if (fe->i_flags & OCFS2_BITMAP_FL) {
- OCFS_I(inode)->ip_flags |= OCFS_INODE_BITMAP;
+ OCFS2_I(inode)->ip_flags |= OCFS2_INODE_BITMAP;
} else if (fe->i_flags & OCFS2_SUPER_BLOCK_FL) {
mlog(0, "superblock inode: i_ino=%lu\n", inode->i_ino);
// we can't actually hit this as read_inode can't handle
@@ -421,7 +421,7 @@
BUG();
if (sysfile)
- OCFS_I(inode)->ip_flags |= OCFS_INODE_SYSTEM_FILE;
+ OCFS2_I(inode)->ip_flags |= OCFS2_INODE_SYSTEM_FILE;
status = 0;
@@ -512,7 +512,7 @@
mlog_entry("(inode->i_ino = %lu)\n", inode->i_ino);
- if (OCFS_I(inode)->ip_flags & OCFS_INODE_SYSTEM_FILE) {
+ if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_SYSTEM_FILE) {
mlog(0, "Skipping system file delete.\n");
goto bail;
}
@@ -523,7 +523,7 @@
}
spin_lock(&OCFS_I(inode)->ip_lock);
- if (OCFS_I(inode)->ip_flags & OCFS_INODE_SKIP_DELETE) {
+ if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_SKIP_DELETE) {
spin_unlock(&OCFS_I(inode)->ip_lock);
mlog(0, "Skipping delete of %lu because another node "
"has done this for us.\n", inode->i_ino);
@@ -557,7 +557,7 @@
* asked to delete the inode. Recheck our flags to catch this
* race and just clear_inode instead.*/
spin_lock(&OCFS_I(inode)->ip_lock);
- if (OCFS_I(inode)->ip_flags & OCFS_INODE_SKIP_DELETE) {
+ if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_SKIP_DELETE) {
spin_unlock(&OCFS_I(inode)->ip_lock);
mlog(0, "Skipping delete of %lu because another node "
"has done this for us.\n", inode->i_ino);
@@ -778,6 +778,7 @@
OCFS_I(inode)->ip_flags &= ~OCFS_INODE_INITIALIZED;
OCFS2_I(inode)->ip_blkno = 0ULL;
+ OCFS2_I(inode)->ip_flags = 0;
/* clean out the inode private ... why?! */
memset(inode->u.generic_ip, 0, sizeof(ocfs_inode_private));
Modified: branches/alloc_inode/fs/ocfs2/inode.h
===================================================================
--- branches/alloc_inode/fs/ocfs2/inode.h 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/inode.h 2005-05-14 06:00:10 UTC (rev 2245)
@@ -26,6 +26,79 @@
#ifndef OCFS2_INODE_H
#define OCFS2_INODE_H
+/* OCFS2 Inode Private Data */
+struct ocfs2_inode_info
+{
+ u64 ip_blkno;
+
+ ocfs2_lock_res ip_meta_lockres;
+ ocfs2_lock_res ip_data_lockres;
+
+ /* protects allocation changes on this inode. */
+ struct rw_semaphore ip_alloc_sem;
+
+ /* These fields are protected by ip_lock */
+ spinlock_t ip_lock;
+ u32 ip_open_cnt;
+ u32 ip_clusters;
+ loff_t ip_mmu_private;
+ struct ocfs2_extent_map ip_map;
+ struct list_head ip_io_markers;
+ int ip_orphaned_slot;
+
+ struct semaphore ip_io_sem;
+
+ /* Used by the journalling code to attach an inode to a
+ * handle. These are protected by ip_io_sem in order to lock
+ * out other I/O to the inode until we either commit or
+ * abort. */
+ struct list_head ip_handle_list;
+ struct _ocfs_journal_handle *ip_handle;
+
+ atomic_t ip_clean_buffer_seq;
+ u32 ip_flags; /* see below */
+
+ /* protected by recovery_lock. */
+ struct inode *ip_next_orphan;
+
+ u32 ip_dir_start_lookup;
+
+ /* next two are protected by trans_inc_lock */
+ /* which transaction were we created on? Zero if none. */
+ unsigned long ip_created_trans;
+ /* last transaction we were a part of. */
+ unsigned long ip_last_trans;
+
+ struct inode vfs_inode;
+};
+
+/*
+ * Flags for the ip_flags field
+ */
+/* Special types of inodes */
+#define OCFS2_INODE_SYSTEM_FILE 0x00000001
+#define OCFS2_INODE_JOURNAL 0x00000002
+#define OCFS2_INODE_BITMAP 0x00000004
+/* Has the inode been deleted yet? */
+#define OCFS2_INODE_DELETED 0x00000008
+/* Another node is deleting, so our delete is a nop */
+#define OCFS2_INODE_SKIP_DELETE 0x00000010
+/* Does someone have the file open O_DIRECT */
+#define OCFS2_INODE_OPEN_DIRECT 0x00000020
+
+static inline struct ocfs2_inode_info *OCFS2_I(struct inode *inode)
+{
+ return container_of(inode, struct ocfs2_inode_info, vfs_inode);
+}
+
+#define INODE_DELETED(i) (OCFS2_I(i)->ip_flags & OCFS2_INODE_DELETED)
+#define SET_INODE_DELETED(i) (OCFS2_I(i)->ip_flags |= OCFS2_INODE_DELETED)
+#define CLEAR_INODE_DELETED(i) (OCFS2_I(i)->ip_flags &= (~OCFS2_INODE_DELETED))
+
+#define INODE_JOURNAL(i) (OCFS2_I(i)->ip_flags & OCFS2_INODE_JOURNAL)
+#define SET_INODE_JOURNAL(i) (OCFS2_I(i)->ip_flags |= OCFS2_INODE_JOURNAL)
+#define CLEAR_INODE_JOURNAL(i) (OCFS2_I(i)->ip_flags &= (~OCFS2_INODE_JOURNAL))
+
extern kmem_cache_t *ocfs2_inode_cache;
struct buffer_head *ocfs_bread(struct inode * inode, int block,
Modified: branches/alloc_inode/fs/ocfs2/journal.h
===================================================================
--- branches/alloc_inode/fs/ocfs2/journal.h 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/journal.h 2005-05-14 06:00:10 UTC (rev 2245)
@@ -117,7 +117,7 @@
/* System files are never "new" as they're written out by
* mkfs. This helps us early during mount, before we have the
* journal open and j_trans_id could be junk. */
- if (OCFS_I(inode)->ip_flags & OCFS_INODE_SYSTEM_FILE)
+ if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_SYSTEM_FILE)
return 0;
spin_lock(&trans_inc_lock);
ret = !(time_after(OCFS2_SB(inode->i_sb)->journal->j_trans_id,
Modified: branches/alloc_inode/fs/ocfs2/localalloc.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/localalloc.c 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/localalloc.c 2005-05-14 06:00:10 UTC (rev 2245)
@@ -37,6 +37,7 @@
#include "alloc.h"
#include "dlmglue.h"
+#include "inode.h"
#include "journal.h"
#include "localalloc.h"
#include "suballoc.h"
Modified: branches/alloc_inode/fs/ocfs2/ocfs.h
===================================================================
--- branches/alloc_inode/fs/ocfs2/ocfs.h 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/ocfs.h 2005-05-14 06:00:10 UTC (rev 2245)
@@ -218,32 +218,15 @@
} ocfs_inode_private;
/* 'flags' flags. */
-/* has this inode been deleted, either from this node or from another node. */
-#define OCFS_INODE_DELETED 0x00000001
-/* is this the journal inode? */
-#define OCFS_INODE_JOURNAL 0x00000002
/* set on init_private, cleared on clear_inode */
+/* XXX this stays until generic_ip is gone, and does not move to
+ * alloc_inode() */
#define OCFS_INODE_INITIALIZED 0x00000004
-/* is this a system file? */
-#define OCFS_INODE_SYSTEM_FILE 0x00000008
-/* are we going to let another node deal with deletion of this inode? */
-#define OCFS_INODE_SKIP_DELETE 0x00000010
-#define OCFS_INODE_IN_REFRESH 0x00000020
-#define OCFS_INODE_BITMAP 0x00000040
-#define OCFS_INODE_OPEN_DIRECT 0x00000080
#define OCFS_I(i) ((ocfs_inode_private *)(i->u.generic_ip))
#define GET_INODE_CLEAN_SEQ(i) (atomic_t *)(&(OCFS_I(i)->ip_clean_buffer_seq))
-#define INODE_DELETED(i) (OCFS_I(i)->ip_flags & OCFS_INODE_DELETED)
-#define SET_INODE_DELETED(i) (OCFS_I(i)->ip_flags |= OCFS_INODE_DELETED)
-#define CLEAR_INODE_DELETED(i) (OCFS_I(i)->ip_flags &= (~OCFS_INODE_DELETED))
-
-#define INODE_JOURNAL(i) (OCFS_I(i)->ip_flags & OCFS_INODE_JOURNAL)
-#define SET_INODE_JOURNAL(i) (OCFS_I(i)->ip_flags |= OCFS_INODE_JOURNAL)
-#define CLEAR_INODE_JOURNAL(i) (OCFS_I(i)->ip_flags &= (~OCFS_INODE_JOURNAL))
-
typedef enum _ocfs_vol_state
{
VOLUME_INIT = 0,
Modified: branches/alloc_inode/fs/ocfs2/ocfs2.h
===================================================================
--- branches/alloc_inode/fs/ocfs2/ocfs2.h 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/ocfs2.h 2005-05-14 06:00:10 UTC (rev 2245)
@@ -26,57 +26,7 @@
#ifndef OCFS2_H
#define OCFS2_H
-/* OCFS2 Inode Private Data */
-struct ocfs2_inode_info
-{
- u64 ip_blkno;
- ocfs2_lock_res ip_meta_lockres;
- ocfs2_lock_res ip_data_lockres;
-
- /* protects allocation changes on this inode. */
- struct rw_semaphore ip_alloc_sem;
-
- /* These fields are protected by ip_lock */
- spinlock_t ip_lock;
- u32 ip_open_cnt;
- u32 ip_clusters;
- loff_t ip_mmu_private;
- struct ocfs2_extent_map ip_map;
- struct list_head ip_io_markers;
- int ip_orphaned_slot;
-
- struct semaphore ip_io_sem;
-
- /* Used by the journalling code to attach an inode to a
- * handle. These are protected by ip_io_sem in order to lock
- * out other I/O to the inode until we either commit or
- * abort. */
- struct list_head ip_handle_list;
- struct _ocfs_journal_handle *ip_handle;
-
- atomic_t ip_clean_buffer_seq;
- u32 ip_flags; /* see below */
-
- /* protected by recovery_lock. */
- struct inode *ip_next_orphan;
-
- u32 ip_dir_start_lookup;
-
- /* next two are protected by trans_inc_lock */
- /* which transaction were we created on? Zero if none. */
- unsigned long ip_created_trans;
- /* last transaction we were a part of. */
- unsigned long ip_last_trans;
-
- struct inode vfs_inode;
-};
-
-static inline struct ocfs2_inode_info *OCFS2_I(struct inode *inode)
-{
- return container_of(inode, struct ocfs2_inode_info, vfs_inode);
-}
-
static inline u64 ocfs2_clusters_to_blocks(struct super_block *sb,
u32 clusters)
{
Modified: branches/alloc_inode/fs/ocfs2/proc.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/proc.c 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/proc.c 2005-05-14 06:00:10 UTC (rev 2245)
@@ -38,6 +38,7 @@
#include "proc.h"
#include "alloc.h"
#include "heartbeat.h"
+#include "inode.h"
#include "journal.h"
#include "ver.h"
Modified: branches/alloc_inode/fs/ocfs2/suballoc.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/suballoc.c 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/suballoc.c 2005-05-14 06:00:10 UTC (rev 2245)
@@ -37,6 +37,7 @@
#include "alloc.h"
#include "dlmglue.h"
+#include "inode.h"
#include "journal.h"
#include "localalloc.h"
#include "suballoc.h"
Modified: branches/alloc_inode/fs/ocfs2/vote.c
===================================================================
--- branches/alloc_inode/fs/ocfs2/vote.c 2005-05-14 05:04:19 UTC (rev 2244)
+++ branches/alloc_inode/fs/ocfs2/vote.c 2005-05-14 06:00:10 UTC (rev 2245)
@@ -228,7 +228,7 @@
SET_INODE_DELETED(inode);
/* We set the SKIP_DELETE flag on the inode so we don't try to
* delete it in delete_inode ourselves. */
- OCFS_I(inode)->ip_flags |= OCFS_INODE_SKIP_DELETE;
+ OCFS2_I(inode)->ip_flags |= OCFS2_INODE_SKIP_DELETE;
spin_unlock(&OCFS_I(inode)->ip_lock);
d_prune_aliases (inode);
More information about the Ocfs2-commits
mailing list