blob: 4832cbceba5b9f3af6f8c0e195daed8af1f1be62 [file] [log] [blame]
Thomas Gleixner328970d2019-05-24 12:04:05 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Mark Fashehccd979b2005-12-15 14:31:24 -08002/* -*- mode: c; c-basic-offset: 8; -*-
3 * vim: noexpandtab sw=8 ts=8 sts=0:
4 *
5 * file.h
6 *
7 * Function prototypes
8 *
9 * Copyright (C) 2002, 2004 Oracle. All rights reserved.
Mark Fashehccd979b2005-12-15 14:31:24 -080010 */
11
12#ifndef OCFS2_FILE_H
13#define OCFS2_FILE_H
14
Arjan van de Ven4b6f5d22006-03-28 01:56:42 -080015extern const struct file_operations ocfs2_fops;
16extern const struct file_operations ocfs2_dops;
Mark Fasheh53da4932008-07-21 14:29:16 -070017extern const struct file_operations ocfs2_fops_no_plocks;
18extern const struct file_operations ocfs2_dops_no_plocks;
Arjan van de Ven92e1d5b2007-02-12 00:55:39 -080019extern const struct inode_operations ocfs2_file_iops;
20extern const struct inode_operations ocfs2_special_file_iops;
Mark Fashehccd979b2005-12-15 14:31:24 -080021struct ocfs2_alloc_context;
Tao Ma0eb8d47e2008-08-18 17:38:45 +080022enum ocfs2_alloc_restarted;
Mark Fashehccd979b2005-12-15 14:31:24 -080023
Mark Fashehcf8e06f2007-12-20 16:43:10 -080024struct ocfs2_file_private {
25 struct file *fp_file;
26 struct mutex fp_mutex;
27 struct ocfs2_lock_res fp_flock;
28};
29
Tao Ma0eb8d47e2008-08-18 17:38:45 +080030int ocfs2_add_inode_data(struct ocfs2_super *osb,
31 struct inode *inode,
32 u32 *logical_offset,
33 u32 clusters_to_add,
34 int mark_unwritten,
35 struct buffer_head *fe_bh,
36 handle_t *handle,
37 struct ocfs2_alloc_context *data_ac,
38 struct ocfs2_alloc_context *meta_ac,
39 enum ocfs2_alloc_restarted *reason_ret);
Joseph Qi026749a2015-02-16 15:59:50 -080040int ocfs2_set_inode_size(handle_t *handle,
41 struct inode *inode,
42 struct buffer_head *fe_bh,
43 u64 new_i_size);
Jan Kara9e33d692008-08-25 19:56:50 +020044int ocfs2_simple_size_update(struct inode *inode,
45 struct buffer_head *di_bh,
46 u64 new_i_size);
Joseph Qi026749a2015-02-16 15:59:50 -080047int ocfs2_truncate_file(struct inode *inode,
48 struct buffer_head *di_bh,
49 u64 new_i_size);
Joel Becker56934862010-07-01 15:13:31 -070050int ocfs2_extend_no_holes(struct inode *inode, struct buffer_head *di_bh,
51 u64 new_i_size, u64 zero_to);
52int ocfs2_zero_extend(struct inode *inode, struct buffer_head *di_bh,
53 loff_t zero_to);
Mark Fashehccd979b2005-12-15 14:31:24 -080054int ocfs2_setattr(struct dentry *dentry, struct iattr *attr);
David Howellsa528d352017-01-31 16:46:22 +000055int ocfs2_getattr(const struct path *path, struct kstat *stat,
56 u32 request_mask, unsigned int flags);
Al Viro10556cb22011-06-20 19:28:19 -040057int ocfs2_permission(struct inode *inode, int mask);
Mark Fashehccd979b2005-12-15 14:31:24 -080058
Tiger Yang7f1a37e2006-11-15 15:48:42 +080059int ocfs2_should_update_atime(struct inode *inode,
60 struct vfsmount *vfsmnt);
61int ocfs2_update_inode_atime(struct inode *inode,
62 struct buffer_head *bh);
63
Mark Fashehb2580102007-03-09 16:53:21 -080064int ocfs2_change_file_space(struct file *file, unsigned int cmd,
65 struct ocfs2_space_resv *sr);
66
Tao Ma293b2f72009-08-25 08:02:48 +080067int ocfs2_check_range_for_refcount(struct inode *inode, loff_t pos,
68 size_t count);
Darrick J. Wong29ac8e82016-11-09 14:13:11 -080069int ocfs2_remove_inode_range(struct inode *inode,
70 struct buffer_head *di_bh, u64 byte_start,
71 u64 byte_len);
Mark Fashehccd979b2005-12-15 14:31:24 -080072#endif /* OCFS2_FILE_H */