aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/inode.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/inode.h')
-rw-r--r--fs/ocfs2/inode.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/fs/ocfs2/inode.h b/fs/ocfs2/inode.h
index 1a7dd2945b34..03ae075869ee 100644
--- a/fs/ocfs2/inode.h
+++ b/fs/ocfs2/inode.h
@@ -26,6 +26,8 @@
26#ifndef OCFS2_INODE_H 26#ifndef OCFS2_INODE_H
27#define OCFS2_INODE_H 27#define OCFS2_INODE_H
28 28
29#include "extent_map.h"
30
29/* OCFS2 Inode Private Data */ 31/* OCFS2 Inode Private Data */
30struct ocfs2_inode_info 32struct ocfs2_inode_info
31{ 33{
@@ -34,6 +36,7 @@ struct ocfs2_inode_info
34 struct ocfs2_lock_res ip_rw_lockres; 36 struct ocfs2_lock_res ip_rw_lockres;
35 struct ocfs2_lock_res ip_meta_lockres; 37 struct ocfs2_lock_res ip_meta_lockres;
36 struct ocfs2_lock_res ip_data_lockres; 38 struct ocfs2_lock_res ip_data_lockres;
39 struct ocfs2_lock_res ip_open_lockres;
37 40
38 /* protects allocation changes on this inode. */ 41 /* protects allocation changes on this inode. */
39 struct rw_semaphore ip_alloc_sem; 42 struct rw_semaphore ip_alloc_sem;
@@ -42,9 +45,7 @@ struct ocfs2_inode_info
42 spinlock_t ip_lock; 45 spinlock_t ip_lock;
43 u32 ip_open_count; 46 u32 ip_open_count;
44 u32 ip_clusters; 47 u32 ip_clusters;
45 struct ocfs2_extent_map ip_map;
46 struct list_head ip_io_markers; 48 struct list_head ip_io_markers;
47 int ip_orphaned_slot;
48 49
49 struct mutex ip_io_mutex; 50 struct mutex ip_io_mutex;
50 51
@@ -64,6 +65,8 @@ struct ocfs2_inode_info
64 65
65 struct ocfs2_caching_info ip_metadata_cache; 66 struct ocfs2_caching_info ip_metadata_cache;
66 67
68 struct ocfs2_extent_map ip_extent_map;
69
67 struct inode vfs_inode; 70 struct inode vfs_inode;
68}; 71};
69 72
@@ -117,14 +120,9 @@ void ocfs2_delete_inode(struct inode *inode);
117void ocfs2_drop_inode(struct inode *inode); 120void ocfs2_drop_inode(struct inode *inode);
118 121
119/* Flags for ocfs2_iget() */ 122/* Flags for ocfs2_iget() */
120#define OCFS2_FI_FLAG_NOWAIT 0x1 123#define OCFS2_FI_FLAG_SYSFILE 0x4
121#define OCFS2_FI_FLAG_DELETE 0x2 124#define OCFS2_FI_FLAG_ORPHAN_RECOVERY 0x8
122#define OCFS2_FI_FLAG_SYSFILE 0x4
123#define OCFS2_FI_FLAG_NOLOCK 0x8
124struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 feoff, int flags); 125struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 feoff, int flags);
125struct inode *ocfs2_ilookup_for_vote(struct ocfs2_super *osb,
126 u64 blkno,
127 int delete_vote);
128int ocfs2_inode_init_private(struct inode *inode); 126int ocfs2_inode_init_private(struct inode *inode);
129int ocfs2_inode_revalidate(struct dentry *dentry); 127int ocfs2_inode_revalidate(struct dentry *dentry);
130int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, 128int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
@@ -144,4 +142,11 @@ int ocfs2_aio_write(struct file *file, struct kiocb *req, struct iocb *iocb);
144 142
145void ocfs2_set_inode_flags(struct inode *inode); 143void ocfs2_set_inode_flags(struct inode *inode);
146 144
145static inline blkcnt_t ocfs2_inode_sector_count(struct inode *inode)
146{
147 int c_to_s_bits = OCFS2_SB(inode->i_sb)->s_clustersize_bits - 9;
148
149 return (blkcnt_t)(OCFS2_I(inode)->ip_clusters << c_to_s_bits);
150}
151
147#endif /* OCFS2_INODE_H */ 152#endif /* OCFS2_INODE_H */