Commit f53bd331 authored by Nathan Scott's avatar Nathan Scott

[XFS] Minor header reorg to get xfs_lrw.h back into line with the other linux

headers.  Allows us to not repeat the xfs_stratcb declaration in several
places.  Also rename linvfs_set_inode_ops to xfs_set_inodeops since its
an auxillary routine not a linvfs method.

SGI Modid: 2.5.x-xfs:slinx:130573a
parent a92169ce
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
#include <linux/xfs_super.h> #include <linux/xfs_super.h>
#include <linux/xfs_globals.h> #include <linux/xfs_globals.h>
#include <linux/xfs_fs_subr.h> #include <linux/xfs_fs_subr.h>
#include <linux/xfs_lrw.h>
#include <pagebuf/page_buf.h> #include <pagebuf/page_buf.h>
......
...@@ -29,41 +29,39 @@ ...@@ -29,41 +29,39 @@
* *
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*/ */
#ifndef __XFS_LRW_H__ #ifndef __XFS_LRW_H__
#define __XFS_LRW_H__ #define __XFS_LRW_H__
struct vnode;
struct bhv_desc;
struct xfs_mount;
struct xfs_iocore;
struct page_buf_s;
struct page_buf_bmap_s;
#define XFS_IOMAP_READ_ENTER 3 #define XFS_IOMAP_READ_ENTER 3
/* /*
* Maximum count of bmaps used by read and write paths. * Maximum count of bmaps used by read and write paths.
*/ */
#define XFS_MAX_RW_NBMAPS 4 #define XFS_MAX_RW_NBMAPS 4
extern int xfs_bmap (bhv_desc_t *, xfs_off_t, ssize_t, int, page_buf_bmap_t *, int *); extern int xfs_bmap (struct bhv_desc *, xfs_off_t, ssize_t, int,
extern int xfsbdstrat (struct xfs_mount *, struct xfs_buf *); struct page_buf_bmap_s *, int *);
extern int xfs_bdstrat_cb (struct xfs_buf *); extern int xfsbdstrat (struct xfs_mount *, struct page_buf_s *);
extern int xfs_bdstrat_cb (struct page_buf_s *);
extern int xfs_zero_eof (vnode_t *, struct xfs_iocore *, xfs_off_t, extern int xfs_zero_eof (struct vnode *, struct xfs_iocore *, xfs_off_t,
xfs_fsize_t, xfs_fsize_t); xfs_fsize_t, xfs_fsize_t);
extern ssize_t xfs_read ( extern ssize_t xfs_read (struct bhv_desc *, struct file *,
struct bhv_desc *bdp, const struct iovec *, unsigned long,
struct file *filp, loff_t *, struct cred *);
const struct iovec *iovp, extern ssize_t xfs_write (struct bhv_desc *, struct file *,
unsigned long segs, const struct iovec *, unsigned long,
loff_t *offp, loff_t *, struct cred *);
struct cred *credp);
extern ssize_t xfs_write (
struct bhv_desc *bdp,
struct file *filp,
const struct iovec *iovp,
unsigned long segs,
loff_t *offp,
struct cred *credp);
extern int xfs_dev_is_read_only(xfs_mount_t *, char *); extern int xfs_dev_is_read_only (struct xfs_mount *, char *);
extern void XFS_log_write_unmount_ro (bhv_desc_t *); extern void XFS_log_write_unmount_ro (struct bhv_desc *);
#define XFS_FSB_TO_DB_IO(io,fsb) \ #define XFS_FSB_TO_DB_IO(io,fsb) \
(((io)->io_flags & XFS_IOCORE_RT) ? \ (((io)->io_flags & XFS_IOCORE_RT) ? \
......
...@@ -371,6 +371,32 @@ xfs_showargs( ...@@ -371,6 +371,32 @@ xfs_showargs(
return 0; return 0;
} }
void
xfs_set_inodeops(
struct inode *inode)
{
vnode_t *vp = LINVFS_GET_VP(inode);
if (vp->v_type == VNON) {
make_bad_inode(inode);
} else if (S_ISREG(inode->i_mode)) {
inode->i_op = &linvfs_file_inode_operations;
inode->i_fop = &linvfs_file_operations;
inode->i_mapping->a_ops = &linvfs_aops;
} else if (S_ISDIR(inode->i_mode)) {
inode->i_op = &linvfs_dir_inode_operations;
inode->i_fop = &linvfs_dir_operations;
} else if (S_ISLNK(inode->i_mode)) {
inode->i_op = &linvfs_symlink_inode_operations;
if (inode->i_blocks)
inode->i_mapping->a_ops = &linvfs_aops;
} else {
inode->i_op = &linvfs_file_inode_operations;
init_special_inode(inode, inode->i_mode,
kdev_t_to_nr(inode->i_rdev));
}
}
STATIC kmem_cache_t * linvfs_inode_cachep; STATIC kmem_cache_t * linvfs_inode_cachep;
...@@ -544,32 +570,6 @@ linvfs_fill_super( ...@@ -544,32 +570,6 @@ linvfs_fill_super(
return -error; return -error;
} }
void
linvfs_set_inode_ops(
struct inode *inode)
{
vnode_t *vp = LINVFS_GET_VP(inode);
if (vp->v_type == VNON) {
make_bad_inode(inode);
} else if (S_ISREG(inode->i_mode)) {
inode->i_op = &linvfs_file_inode_operations;
inode->i_fop = &linvfs_file_operations;
inode->i_mapping->a_ops = &linvfs_aops;
} else if (S_ISDIR(inode->i_mode)) {
inode->i_op = &linvfs_dir_inode_operations;
inode->i_fop = &linvfs_dir_operations;
} else if (S_ISLNK(inode->i_mode)) {
inode->i_op = &linvfs_symlink_inode_operations;
if (inode->i_blocks)
inode->i_mapping->a_ops = &linvfs_aops;
} else {
inode->i_op = &linvfs_file_inode_operations;
init_special_inode(inode, inode->i_mode,
kdev_t_to_nr(inode->i_rdev));
}
}
/* /*
* We do not actually write the inode here, just mark the * We do not actually write the inode here, just mark the
* super block dirty so that sync_supers calls us and * super block dirty so that sync_supers calls us and
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
extern void extern void
linvfs_set_inode_ops( xfs_set_inodeops(
struct inode *inode); struct inode *inode);
#endif /* __XFS_SUPER_H__ */ #endif /* __XFS_SUPER_H__ */
...@@ -109,6 +109,4 @@ ...@@ -109,6 +109,4 @@
#include <xfs_utils.h> #include <xfs_utils.h>
#include <xfs_dmapi.h> #include <xfs_dmapi.h>
#include <linux/xfs_lrw.h>
#endif /* __XFS_H__ */ #endif /* __XFS_H__ */
...@@ -203,7 +203,6 @@ extern inline xfs_caddr_t xfs_buf_offset(page_buf_t *bp, off_t offset) ...@@ -203,7 +203,6 @@ extern inline xfs_caddr_t xfs_buf_offset(page_buf_t *bp, off_t offset)
static inline int xfs_bawrite(void *mp, page_buf_t *bp) static inline int xfs_bawrite(void *mp, page_buf_t *bp)
{ {
extern int xfs_bdstrat_cb(struct xfs_buf *);
int ret; int ret;
bp->pb_fspriv3 = mp; bp->pb_fspriv3 = mp;
...@@ -278,8 +277,6 @@ static inline int XFS_bwrite(page_buf_t *pb) ...@@ -278,8 +277,6 @@ static inline int XFS_bwrite(page_buf_t *pb)
static inline int xfs_bdwrite(void *mp, page_buf_t *bp) static inline int xfs_bdwrite(void *mp, page_buf_t *bp)
{ {
extern int xfs_bdstrat_cb(struct xfs_buf *);
bp->pb_strat = xfs_bdstrat_cb; bp->pb_strat = xfs_bdstrat_cb;
bp->pb_fspriv3 = mp; bp->pb_fspriv3 = mp;
......
...@@ -1596,7 +1596,7 @@ xfs_initialize_vnode( ...@@ -1596,7 +1596,7 @@ xfs_initialize_vnode(
* and unlock the inode. * and unlock the inode.
*/ */
if (unlock && (inode->i_state & I_NEW)) { if (unlock && (inode->i_state & I_NEW)) {
linvfs_set_inode_ops(inode); xfs_set_inodeops(inode);
unlock_new_inode(inode); unlock_new_inode(inode);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment