]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ocfs2/inode.h
Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-2.6-omap-h63xx.git] / fs / ocfs2 / inode.h
index 9957810fdf85e3b712cc0eef92e9f1606b787309..a41d0817121b21ed35e73def7ec91a5e603b7dec 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef OCFS2_INODE_H
 #define OCFS2_INODE_H
 
+#include "extent_map.h"
+
 /* OCFS2 Inode Private Data */
 struct ocfs2_inode_info
 {
@@ -34,6 +36,7 @@ struct ocfs2_inode_info
        struct ocfs2_lock_res           ip_rw_lockres;
        struct ocfs2_lock_res           ip_meta_lockres;
        struct ocfs2_lock_res           ip_data_lockres;
+       struct ocfs2_lock_res           ip_open_lockres;
 
        /* protects allocation changes on this inode. */
        struct rw_semaphore             ip_alloc_sem;
@@ -42,19 +45,10 @@ struct ocfs2_inode_info
        spinlock_t                      ip_lock;
        u32                             ip_open_count;
        u32                             ip_clusters;
-       struct ocfs2_extent_map         ip_map;
        struct list_head                ip_io_markers;
-       int                             ip_orphaned_slot;
 
        struct mutex                    ip_io_mutex;
 
-       /* Used by the journalling code to attach an inode to a
-        * handle.  These are protected by ip_io_mutex in order to lock
-        * out other I/O to the inode until we either commit or
-        * abort. */
-       struct list_head                ip_handle_list;
-       struct ocfs2_journal_handle     *ip_handle;
-
        u32                             ip_flags; /* see below */
        u32                             ip_attr; /* inode attributes */
 
@@ -71,6 +65,8 @@ struct ocfs2_inode_info
 
        struct ocfs2_caching_info       ip_metadata_cache;
 
+       struct ocfs2_extent_map         ip_extent_map;
+
        struct inode                    vfs_inode;
 };
 
@@ -113,7 +109,7 @@ static inline struct ocfs2_inode_info *OCFS2_I(struct inode *inode)
 #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)
 
-extern kmem_cache_t *ocfs2_inode_cache;
+extern struct kmem_cache *ocfs2_inode_cache;
 
 extern const struct address_space_operations ocfs2_aops;
 
@@ -124,14 +120,9 @@ void ocfs2_delete_inode(struct inode *inode);
 void ocfs2_drop_inode(struct inode *inode);
 
 /* Flags for ocfs2_iget() */
-#define OCFS2_FI_FLAG_NOWAIT   0x1
-#define OCFS2_FI_FLAG_DELETE   0x2
-#define OCFS2_FI_FLAG_SYSFILE  0x4
-#define OCFS2_FI_FLAG_NOLOCK   0x8
+#define OCFS2_FI_FLAG_SYSFILE          0x4
+#define OCFS2_FI_FLAG_ORPHAN_RECOVERY  0x8
 struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 feoff, int flags);
-struct inode *ocfs2_ilookup_for_vote(struct ocfs2_super *osb,
-                                    u64 blkno,
-                                    int delete_vote);
 int ocfs2_inode_init_private(struct inode *inode);
 int ocfs2_inode_revalidate(struct dentry *dentry);
 int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
@@ -143,12 +134,20 @@ ssize_t ocfs2_rw_direct(int rw, struct file *filp, char *buf,
 void ocfs2_sync_blockdev(struct super_block *sb);
 void ocfs2_refresh_inode(struct inode *inode,
                         struct ocfs2_dinode *fe);
-int ocfs2_mark_inode_dirty(struct ocfs2_journal_handle *handle,
+int ocfs2_mark_inode_dirty(handle_t *handle,
                           struct inode *inode,
                           struct buffer_head *bh);
 int ocfs2_aio_read(struct file *file, struct kiocb *req, struct iocb *iocb);
 int ocfs2_aio_write(struct file *file, struct kiocb *req, struct iocb *iocb);
 
 void ocfs2_set_inode_flags(struct inode *inode);
+void ocfs2_get_inode_flags(struct ocfs2_inode_info *oi);
+
+static inline blkcnt_t ocfs2_inode_sector_count(struct inode *inode)
+{
+       int c_to_s_bits = OCFS2_SB(inode->i_sb)->s_clustersize_bits - 9;
+
+       return (blkcnt_t)(OCFS2_I(inode)->ip_clusters << c_to_s_bits);
+}
 
 #endif /* OCFS2_INODE_H */