xref: /OK3568_Linux_fs/kernel/fs/incfs/vfs.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Copyright 2018 Google LLC
4*4882a593Smuzhiyun  */
5*4882a593Smuzhiyun 
6*4882a593Smuzhiyun #ifndef _INCFS_VFS_H
7*4882a593Smuzhiyun #define _INCFS_VFS_H
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun extern const struct file_operations incfs_file_ops;
10*4882a593Smuzhiyun extern const struct inode_operations incfs_file_inode_ops;
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun void incfs_kill_sb(struct super_block *sb);
13*4882a593Smuzhiyun struct dentry *incfs_mount_fs(struct file_system_type *type, int flags,
14*4882a593Smuzhiyun 			      const char *dev_name, void *data);
15*4882a593Smuzhiyun int incfs_link(struct dentry *what, struct dentry *where);
16*4882a593Smuzhiyun int incfs_unlink(struct dentry *dentry);
17*4882a593Smuzhiyun 
get_mount_info(struct super_block * sb)18*4882a593Smuzhiyun static inline struct mount_info *get_mount_info(struct super_block *sb)
19*4882a593Smuzhiyun {
20*4882a593Smuzhiyun 	struct mount_info *result = sb->s_fs_info;
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun 	WARN_ON(!result);
23*4882a593Smuzhiyun 	return result;
24*4882a593Smuzhiyun }
25*4882a593Smuzhiyun 
file_superblock(struct file * f)26*4882a593Smuzhiyun static inline struct super_block *file_superblock(struct file *f)
27*4882a593Smuzhiyun {
28*4882a593Smuzhiyun 	struct inode *inode = file_inode(f);
29*4882a593Smuzhiyun 
30*4882a593Smuzhiyun 	return inode->i_sb;
31*4882a593Smuzhiyun }
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun #endif
34