mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-30 21:46:31 +00:00
075fe10286
xfs_sync_inodes is used to write back either file data or inode metadata. In general we always do these separately, except for one fishy case in xfs_fs_put_super that does both. So separate xfs_sync_inodes into separate xfs_sync_data and xfs_sync_attr functions. In xfs_fs_put_super we first call the data sync and then the attr sync as that was the previous order. The moved log force in that path doesn't make a difference because we will force the log again as part of the real unmount process. The filesystem readonly checks are not performed by the new function but instead moved into the callers, given that most callers alredy have it further up in the stack. Also add debug checks that we do not pass in incorrect flags in the new xfs_sync_data and xfs_sync_attr function and fix the one place that did pass in a wrong flag. Also remove a comment mentioning xfs_sync_inodes that has been incorrect for a while because we always take either the iolock or ilock in the sync path these days. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
63 lines
2.2 KiB
C
63 lines
2.2 KiB
C
/*
|
|
* Copyright (c) 2000-2006 Silicon Graphics, Inc.
|
|
* All Rights Reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it would be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write the Free Software Foundation,
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
#ifndef XFS_SYNC_H
|
|
#define XFS_SYNC_H 1
|
|
|
|
struct xfs_mount;
|
|
struct xfs_perag;
|
|
|
|
typedef struct xfs_sync_work {
|
|
struct list_head w_list;
|
|
struct xfs_mount *w_mount;
|
|
void *w_data; /* syncer routine argument */
|
|
void (*w_syncer)(struct xfs_mount *, void *);
|
|
struct completion *w_completion;
|
|
} xfs_sync_work_t;
|
|
|
|
#define SYNC_WAIT 0x0004 /* wait for i/o to complete */
|
|
#define SYNC_BDFLUSH 0x0008 /* BDFLUSH is calling -- don't block */
|
|
#define SYNC_IOWAIT 0x0010 /* wait for all I/O to complete */
|
|
#define SYNC_TRYLOCK 0x0020 /* only try to lock inodes */
|
|
|
|
int xfs_syncd_init(struct xfs_mount *mp);
|
|
void xfs_syncd_stop(struct xfs_mount *mp);
|
|
|
|
int xfs_sync_attr(struct xfs_mount *mp, int flags);
|
|
int xfs_sync_data(struct xfs_mount *mp, int flags);
|
|
int xfs_sync_fsdata(struct xfs_mount *mp, int flags);
|
|
|
|
int xfs_quiesce_data(struct xfs_mount *mp);
|
|
void xfs_quiesce_attr(struct xfs_mount *mp);
|
|
|
|
void xfs_flush_inodes(struct xfs_inode *ip);
|
|
|
|
int xfs_reclaim_inode(struct xfs_inode *ip, int locked, int sync_mode);
|
|
int xfs_reclaim_inodes(struct xfs_mount *mp, int mode);
|
|
|
|
void xfs_inode_set_reclaim_tag(struct xfs_inode *ip);
|
|
void xfs_inode_clear_reclaim_tag(struct xfs_inode *ip);
|
|
void __xfs_inode_clear_reclaim_tag(struct xfs_mount *mp, struct xfs_perag *pag,
|
|
struct xfs_inode *ip);
|
|
|
|
int xfs_sync_inode_valid(struct xfs_inode *ip, struct xfs_perag *pag);
|
|
int xfs_inode_ag_iterator(struct xfs_mount *mp,
|
|
int (*execute)(struct xfs_inode *ip, struct xfs_perag *pag, int flags),
|
|
int flags, int tag);
|
|
|
|
#endif
|