Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *  linux/fs/bad_inode.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *  Copyright (C) 1997, Stephen Tweedie
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *  Provide stub functions for unreadable inodes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  *  Fabian Frederick : August 2003 - All file operations assigned to EIO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/export.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/stat.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/time.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/namei.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/poll.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/fiemap.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) static int bad_file_open(struct inode *inode, struct file *filp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) static const struct file_operations bad_file_ops =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	.open		= bad_file_open,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) static int bad_inode_create (struct inode *dir, struct dentry *dentry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 		umode_t mode, bool excl)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) static struct dentry *bad_inode_lookup(struct inode *dir,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 			struct dentry *dentry, unsigned int flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	return ERR_PTR(-EIO);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) static int bad_inode_link (struct dentry *old_dentry, struct inode *dir,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 		struct dentry *dentry)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) static int bad_inode_unlink(struct inode *dir, struct dentry *dentry)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) static int bad_inode_symlink (struct inode *dir, struct dentry *dentry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 		const char *symname)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) static int bad_inode_mkdir(struct inode *dir, struct dentry *dentry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 			umode_t mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) static int bad_inode_rmdir (struct inode *dir, struct dentry *dentry)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) static int bad_inode_mknod (struct inode *dir, struct dentry *dentry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 			umode_t mode, dev_t rdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) static int bad_inode_rename2(struct inode *old_dir, struct dentry *old_dentry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 			     struct inode *new_dir, struct dentry *new_dentry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 			     unsigned int flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) static int bad_inode_readlink(struct dentry *dentry, char __user *buffer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 		int buflen)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) static int bad_inode_permission(struct inode *inode, int mask)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) static int bad_inode_getattr(const struct path *path, struct kstat *stat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 			     u32 request_mask, unsigned int query_flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) static int bad_inode_setattr(struct dentry *direntry, struct iattr *attrs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) static ssize_t bad_inode_listxattr(struct dentry *dentry, char *buffer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 			size_t buffer_size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) static const char *bad_inode_get_link(struct dentry *dentry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 				      struct inode *inode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 				      struct delayed_call *done)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	return ERR_PTR(-EIO);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) static struct posix_acl *bad_inode_get_acl(struct inode *inode, int type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	return ERR_PTR(-EIO);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) static int bad_inode_fiemap(struct inode *inode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 			    struct fiemap_extent_info *fieinfo, u64 start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 			    u64 len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) static int bad_inode_update_time(struct inode *inode, struct timespec64 *time,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 				 int flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) static int bad_inode_atomic_open(struct inode *inode, struct dentry *dentry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 				 struct file *file, unsigned int open_flag,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 				 umode_t create_mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) static int bad_inode_tmpfile(struct inode *inode, struct dentry *dentry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 			     umode_t mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) static int bad_inode_set_acl(struct inode *inode, struct posix_acl *acl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 			     int type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) static const struct inode_operations bad_inode_ops =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	.create		= bad_inode_create,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	.lookup		= bad_inode_lookup,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	.link		= bad_inode_link,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	.unlink		= bad_inode_unlink,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	.symlink	= bad_inode_symlink,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	.mkdir		= bad_inode_mkdir,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	.rmdir		= bad_inode_rmdir,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	.mknod		= bad_inode_mknod,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	.rename		= bad_inode_rename2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	.readlink	= bad_inode_readlink,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	.permission	= bad_inode_permission,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	.getattr	= bad_inode_getattr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	.setattr	= bad_inode_setattr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	.listxattr	= bad_inode_listxattr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	.get_link	= bad_inode_get_link,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	.get_acl	= bad_inode_get_acl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	.fiemap		= bad_inode_fiemap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	.update_time	= bad_inode_update_time,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	.atomic_open	= bad_inode_atomic_open,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	.tmpfile	= bad_inode_tmpfile,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	.set_acl	= bad_inode_set_acl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)  * When a filesystem is unable to read an inode due to an I/O error in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)  * its read_inode() function, it can call make_bad_inode() to return a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)  * set of stubs which will return EIO errors as required. 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)  * We only need to do limited initialisation: all other fields are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)  * preinitialised to zero automatically.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)  
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)  *	make_bad_inode - mark an inode bad due to an I/O error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)  *	@inode: Inode to mark bad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)  *	When an inode cannot be read due to a media or remote network
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)  *	failure this function makes the inode "bad" and causes I/O operations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)  *	on it to fail from this point on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)  
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) void make_bad_inode(struct inode *inode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	remove_inode_hash(inode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	inode->i_mode = S_IFREG;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	inode->i_atime = inode->i_mtime = inode->i_ctime =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 		current_time(inode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	inode->i_op = &bad_inode_ops;	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	inode->i_opflags &= ~IOP_XATTR;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	inode->i_fop = &bad_file_ops;	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) EXPORT_SYMBOL_NS(make_bad_inode, ANDROID_GKI_VFS_EXPORT_ONLY);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)  * This tests whether an inode has been flagged as bad. The test uses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)  * &bad_inode_ops to cover the case of invalidated inodes as well as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)  * those created by make_bad_inode() above.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)  
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)  *	is_bad_inode - is an inode errored
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)  *	@inode: inode to test
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)  *	Returns true if the inode in question has been marked as bad.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)  
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) bool is_bad_inode(struct inode *inode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	return (inode->i_op == &bad_inode_ops);	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) EXPORT_SYMBOL_NS(is_bad_inode, ANDROID_GKI_VFS_EXPORT_ONLY);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)  * iget_failed - Mark an under-construction inode as dead and release it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)  * @inode: The inode to discard
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236)  * Mark an under-construction inode as dead and release it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) void iget_failed(struct inode *inode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	make_bad_inode(inode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	unlock_new_inode(inode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	iput(inode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) EXPORT_SYMBOL(iget_failed);