/* * Copyright (c) 2000-2001,2005 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_DIR2_PRIV_H__#define __XFS_DIR2_PRIV_H__/* xfs_dir2.c */externintxfs_dir_ino_validate(struct xfs_mount *mp, xfs_ino_t ino);externintxfs_dir2_isblock(struct xfs_trans *tp,struct
aboutsummaryrefslogtreecommitdiffstats
-rw-r--r--include/linux/fs.h49
1 files changed, 49 insertions, 0 deletions
externintxfs_dir2_leaf_trim_data(struct xfs_da_args *argsstruct xfs_dabuf *lbp, xfs_dir2_db_t db);externstruct xfs_dir2_leaf_entry *xfs_dir2_leaf_find_entry(struct xfs_dir2_leaf *leaf,int index,int compact,int lowstale,int highstale,int*lfloglow,int*lfloghigh);externintxfs_dir2_node_to_leaf(struct xfs_da_state *state);/* xfs_dir2_node.c */externintxfs_dir2_leaf_to_node(struct xfs_da_args *args,struct xfs_dabuf *lbp);extern xfs_dahash_t xfs_dir2_leafn_lasthash(struct xfs_dabuf *bp,int*count);externintxfs_dir2_leafn_lookup_int(struct xfs_dabuf *bp,struct xfs_da_args *args,int*indexp,struct xfs_da_state *state);externintxfs_dir2_leafn_order(struct xfs_dabuf *leaf1_bp,struct xfs_dabuf *leaf2_bp);externintxfs_dir2_leafn_split(struct xfs_da_state *state,struct xfs_da_state_blk *oldblk,struct xfs_da_state_blk *newblk);td>
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 013b9c2b88e6..d1eeea669d2c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -776,6 +776,9 @@ static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index)
776 index < ra->start + ra->size); 776 index < ra->start + ra->size);
777} 777}
778 778
779#define FILE_MNT_WRITE_TAKEN 1
780#define FILE_MNT_WRITE_RELEASED 2
781
779struct file { 782struct file {
780 /* 783 /*
781 * fu_list becomes invalid after file_free is called and queued via 784 * fu_list becomes invalid after file_free is called and queued via
@@ -810,6 +813,9 @@ struct file {
810 spinlock_t f_ep_lock; 813 spinlock_t f_ep_lock;
811#endif /* #ifdef CONFIG_EPOLL */ 814#endif /* #ifdef CONFIG_EPOLL */
812 struct address_space *f_mapping; 815 struct address_space *f_mapping;
816#ifdef CONFIG_DEBUG_WRITECOUNT
817 unsigned long f_mnt_write_state;
818#endif
813}; 819};
814extern spinlock_t files_lock; 820extern spinlock_t files_lock;
815#define file_list_lock() spin_lock(&files_lock); 821#define file_list_lock() spin_lock(&files_lock);
@@ -818,6 +824,49 @@ extern spinlock_t files_lock;
818#define get_file(x) atomic_inc(&(x)->f_count) 824#define get_file(x) atomic_inc(&(x)->f_count)
819#define file_count(x) atomic_read(&(x)->f_count) 825#define file_count(x) atomic_read(&(x)->f_count)
820 826
827#ifdef CONFIG_DEBUG_WRITECOUNT
828static inline void file_take_write(struct file *f)
829{
830 WARN_ON(f->f_mnt_write_state != 0);
831 f->f_mnt_write_state = FILE_MNT_WRITE_TAKEN;
832}
833static inline void file_release_write(struct file *f)
834{
835 f->f_mnt_write_state |= FILE_MNT_WRITE_RELEASED;
836}
837static inline void file_reset_write(struct file *f)
838{
839 f->f_mnt_write_state = 0;
840}
841static inline void file_check_state(struct file *f)
842{
843 /*
844 * At this point, either both or neither of these bits
859#else /* !CONFIG_DEBUG_WRITECOUNT */
860static inline void file_take_write(struct file *filp) {}
861static inline void file_release_write(struct file *filp) {}
862static inline void file_reset_write(struct file *filp) {}
863static inline void file_check_state(struct file *filp) {}
864static inline int file_check_writeable(struct file *filp)
865{
866 return 0;
867}
868#endif /* CONFIG_DEBUG_WRITECOUNT */
869
821#define MAX_NON_LFS ((1UL<<31) - 1) 870#define MAX_NON_LFS ((1UL<<31) - 1)
822 871
823/* Page cache limit. The filesystems should put that into their s_maxbytes 872/* Page cache limit. The filesystems should put that into their s_maxbytes