aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-04-23 01:59:02 -0400
committerBen Myers <bpm@sgi.com>2012-05-14 17:20:58 -0400
commit2a0ec1d9ed7f3aa7974fccfbb612fadda2e10bad (patch)
treedf922fdcf44b6b537b00668da1ffba98283727d1
parentfd50092c08068b5bc5d170bc17894db584aaf7b2 (diff)
xfs: move xfs_get_extsz_hint() and kill xfs_rw.h
The only thing left in xfs_rw.h is a function prototype for an inode function. Move that to xfs_inode.h, and kill xfs_rw.h. Also move the function implementing the prototype from xfs_rw.c to xfs_inode.c so we only have one function left in xfs_rw.c Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ben Myers <bpm@sgi.com>
-rw-r--r--fs/xfs/xfs_aops.c1
-rw-r--r--fs/xfs/xfs_attr.c1
-rw-r--r--fs/xfs/xfs_bmap.c1
-rw-r--r--fs/xfs/xfs_fsops.c1
-rw-r--r--fs/xfs/xfs_inode.c14
-rw-r--r--fs/xfs/xfs_inode.h2
-rw-r--r--fs/xfs/xfs_iomap.c1
-rw-r--r--fs/xfs/xfs_iops.c1
-rw-r--r--fs/xfs/xfs_log.c1
-rw-r--r--fs/xfs/xfs_log_recover.c1
-rw-r--r--fs/xfs/xfs_mount.c1
-rw-r--r--fs/xfs/xfs_rtalloc.c1
-rw-r--r--fs/xfs/xfs_rw.c15
-rw-r--r--fs/xfs/xfs_rw.h30
-rw-r--r--fs/xfs/xfs_trans_buf.c1
-rw-r--r--fs/xfs/xfs_vnodeops.c1
16 files changed, 16 insertions, 57 deletions
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index df7b1c7b776e..f03c9b401ce5 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -28,7 +28,6 @@
28#include "xfs_inode_item.h" 28#include "xfs_inode_item.h"
29#include "xfs_alloc.h" 29#include "xfs_alloc.h"
30#include "xfs_error.h" 30#include "xfs_error.h"
31#include "xfs_rw.h"
32#include "xfs_iomap.h" 31#include "xfs_iomap.h"
33#include "xfs_vnodeops.h" 32#include "xfs_vnodeops.h"
34#include "xfs_trace.h" 33#include "xfs_trace.h"
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c
index 561fd6040f1b..a17ff01b5adf 100644
--- a/fs/xfs/xfs_attr.c
+++ b/fs/xfs/xfs_attr.c
@@ -38,7 +38,6 @@
38#include "xfs_error.h" 38#include "xfs_error.h"
39#include "xfs_quota.h" 39#include "xfs_quota.h"
40#include "xfs_trans_space.h" 40#include "xfs_trans_space.h"
41#include "xfs_rw.h"
42#include "xfs_vnodeops.h" 41#include "xfs_vnodeops.h"
43#include "xfs_trace.h" 42#include "xfs_trace.h"
44 43
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 7431381751ec..478bce9e4043 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -41,7 +41,6 @@
41#include "xfs_rtalloc.h" 41#include "xfs_rtalloc.h"
42#include "xfs_error.h" 42#include "xfs_error.h"
43#include "xfs_attr_leaf.h" 43#include "xfs_attr_leaf.h"
44#include "xfs_rw.h"
45#include "xfs_quota.h" 44#include "xfs_quota.h"
46#include "xfs_trans_space.h" 45#include "xfs_trans_space.h"
47#include "xfs_buf_item.h" 46#include "xfs_buf_item.h"
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 2635e1755133..f6c7698c9a75 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -38,7 +38,6 @@
38#include "xfs_itable.h" 38#include "xfs_itable.h"
39#include "xfs_trans_space.h" 39#include "xfs_trans_space.h"
40#include "xfs_rtalloc.h" 40#include "xfs_rtalloc.h"
41#include "xfs_rw.h"
42#include "xfs_filestream.h" 41#include "xfs_filestream.h"
43#include "xfs_trace.h" 42#include "xfs_trace.h"
44 43
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index f64b482a7953..c6fb5f0577b8 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -61,6 +61,20 @@ STATIC int xfs_iformat_local(xfs_inode_t *, xfs_dinode_t *, int, int);
61STATIC int xfs_iformat_extents(xfs_inode_t *, xfs_dinode_t *, int); 61STATIC int xfs_iformat_extents(xfs_inode_t *, xfs_dinode_t *, int);
62STATIC int xfs_iformat_btree(xfs_inode_t *, xfs_dinode_t *, int); 62STATIC int xfs_iformat_btree(xfs_inode_t *, xfs_dinode_t *, int);
63 63
64/*
65 * helper function to extract extent size hint from inode
66 */
67xfs_extlen_t
68xfs_get_extsz_hint(
69 struct xfs_inode *ip)
70{
71 if ((ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) && ip->i_d.di_extsize)
72 return ip->i_d.di_extsize;
73 if (XFS_IS_REALTIME_INODE(ip))
74 return ip->i_mount->m_sb.sb_rextsize;
75 return 0;
76}
77
64#ifdef DEBUG 78#ifdef DEBUG
65/* 79/*
66 * Make sure that the extents in the given memory buffer 80 * Make sure that the extents in the given memory buffer
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index f0e252f384f9..1efff36a75b6 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -533,6 +533,8 @@ int xfs_iflush(struct xfs_inode *, struct xfs_buf **);
533void xfs_lock_inodes(xfs_inode_t **, int, uint); 533void xfs_lock_inodes(xfs_inode_t **, int, uint);
534void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint); 534void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint);
535 535
536xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
537
536#define IHOLD(ip) \ 538#define IHOLD(ip) \
537do { \ 539do { \
538 ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \ 540 ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 8116c282c9a1..d3a4a8d10440 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -36,7 +36,6 @@
36#include "xfs_rtalloc.h" 36#include "xfs_rtalloc.h"
37#include "xfs_error.h" 37#include "xfs_error.h"
38#include "xfs_itable.h" 38#include "xfs_itable.h"
39#include "xfs_rw.h"
40#include "xfs_attr.h" 39#include "xfs_attr.h"
41#include "xfs_buf_item.h" 40#include "xfs_buf_item.h"
42#include "xfs_trans_space.h" 41#include "xfs_trans_space.h"
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index e6d6a32220cf..e7a6660e19fb 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -33,7 +33,6 @@
33#include "xfs_rtalloc.h" 33#include "xfs_rtalloc.h"
34#include "xfs_error.h" 34#include "xfs_error.h"
35#include "xfs_itable.h" 35#include "xfs_itable.h"
36#include "xfs_rw.h"
37#include "xfs_attr.h" 36#include "xfs_attr.h"
38#include "xfs_buf_item.h" 37#include "xfs_buf_item.h"
39#include "xfs_utils.h" 38#include "xfs_utils.h"
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index dec1458ece7b..97e489b90f29 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -34,7 +34,6 @@
34#include "xfs_trans_priv.h" 34#include "xfs_trans_priv.h"
35#include "xfs_dinode.h" 35#include "xfs_dinode.h"
36#include "xfs_inode.h" 36#include "xfs_inode.h"
37#include "xfs_rw.h"
38#include "xfs_trace.h" 37#include "xfs_trace.h"
39 38
40kmem_zone_t *xfs_log_ticket_zone; 39kmem_zone_t *xfs_log_ticket_zone;
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index c8ee0fc49042..472fa1749bee 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -40,7 +40,6 @@
40#include "xfs_extfree_item.h" 40#include "xfs_extfree_item.h"
41#include "xfs_trans_priv.h" 41#include "xfs_trans_priv.h"
42#include "xfs_quota.h" 42#include "xfs_quota.h"
43#include "xfs_rw.h"
44#include "xfs_utils.h" 43#include "xfs_utils.h"
45#include "xfs_trace.h" 44#include "xfs_trace.h"
46 45
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 89be5ff57907..f511d22fee6f 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -38,7 +38,6 @@
38#include "xfs_rtalloc.h" 38#include "xfs_rtalloc.h"
39#include "xfs_bmap.h" 39#include "xfs_bmap.h"
40#include "xfs_error.h" 40#include "xfs_error.h"
41#include "xfs_rw.h"
42#include "xfs_quota.h" 41#include "xfs_quota.h"
43#include "xfs_fsops.h" 42#include "xfs_fsops.h"
44#include "xfs_utils.h" 43#include "xfs_utils.h"
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index b6ef74dd7417..92d4331cd4f1 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -33,7 +33,6 @@
33#include "xfs_rtalloc.h" 33#include "xfs_rtalloc.h"
34#include "xfs_fsops.h" 34#include "xfs_fsops.h"
35#include "xfs_error.h" 35#include "xfs_error.h"
36#include "xfs_rw.h"
37#include "xfs_inode_item.h" 36#include "xfs_inode_item.h"
38#include "xfs_trans_space.h" 37#include "xfs_trans_space.h"
39#include "xfs_utils.h" 38#include "xfs_utils.h"
diff --git a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c
index 7e3644f6ac9a..c406cb6075fa 100644
--- a/fs/xfs/xfs_rw.c
+++ b/fs/xfs/xfs_rw.c
@@ -28,7 +28,6 @@
28#include "xfs_dinode.h" 28#include "xfs_dinode.h"
29#include "xfs_inode.h" 29#include "xfs_inode.h"
30#include "xfs_error.h" 30#include "xfs_error.h"
31#include "xfs_rw.h"
32 31
33/* 32/*
34 * Force a shutdown of the filesystem instantly while keeping 33 * Force a shutdown of the filesystem instantly while keeping
@@ -89,17 +88,3 @@ xfs_do_force_shutdown(
89 "Please umount the filesystem and rectify the problem(s)"); 88 "Please umount the filesystem and rectify the problem(s)");
90 } 89 }
91} 90}
92
93/*
94 * helper function to extract extent size hint from inode
95 */
96xfs_extlen_t
97xfs_get_extsz_hint(
98 struct xfs_inode *ip)
99{
100 if ((ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) && ip->i_d.di_extsize)
101 return ip->i_d.di_extsize;
102 if (XFS_IS_REALTIME_INODE(ip))
103 return ip->i_mount->m_sb.sb_rextsize;
104 return 0;
105}
diff --git a/fs/xfs/xfs_rw.h b/fs/xfs/xfs_rw.h
deleted file mode 100644
index 13f631732da1..000000000000
--- a/fs/xfs/xfs_rw.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * Copyright (c) 2000-2006 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18#ifndef __XFS_RW_H__
19#define __XFS_RW_H__
20
21struct xfs_buf;
22struct xfs_inode;
23struct xfs_mount;
24
25/*
26 * Prototypes for functions in xfs_rw.c.
27 */
28extern xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
29
30#endif /* __XFS_RW_H__ */
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
index 7d69213848b7..743d7a5835f3 100644
--- a/fs/xfs/xfs_trans_buf.c
+++ b/fs/xfs/xfs_trans_buf.c
@@ -32,7 +32,6 @@
32#include "xfs_buf_item.h" 32#include "xfs_buf_item.h"
33#include "xfs_trans_priv.h" 33#include "xfs_trans_priv.h"
34#include "xfs_error.h" 34#include "xfs_error.h"
35#include "xfs_rw.h"
36#include "xfs_trace.h" 35#include "xfs_trace.h"
37 36
38/* 37/*
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 9e8266981f47..5b3f5b13a008 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -38,7 +38,6 @@
38#include "xfs_bmap.h" 38#include "xfs_bmap.h"
39#include "xfs_acl.h" 39#include "xfs_acl.h"
40#include "xfs_attr.h" 40#include "xfs_attr.h"
41#include "xfs_rw.h"
42#include "xfs_error.h" 41#include "xfs_error.h"
43#include "xfs_quota.h" 42#include "xfs_quota.h"
44#include "xfs_utils.h" 43#include "xfs_utils.h"