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)  * Copyright (c) 2004-2005 Silicon Graphics, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * All Rights Reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) #include "xfs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #include "xfs_shared.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include "xfs_format.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include "xfs_log_format.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include "xfs_trans_resv.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include "xfs_mount.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include "xfs_dir2.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include "xfs_export.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include "xfs_inode.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include "xfs_trans.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include "xfs_inode_item.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include "xfs_icache.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include "xfs_pnfs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * Note that we only accept fileids which are long enough rather than allow
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  * the parent generation number to default to zero.  XFS considers zero a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  * valid generation number not an invalid/wildcard value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) static int xfs_fileid_length(int fileid_type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	switch (fileid_type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	case FILEID_INO32_GEN:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 		return 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	case FILEID_INO32_GEN_PARENT:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 		return 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	case FILEID_INO32_GEN | XFS_FILEID_TYPE_64FLAG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 		return 3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	case FILEID_INO32_GEN_PARENT | XFS_FILEID_TYPE_64FLAG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 		return 6;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	return FILEID_INVALID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) STATIC int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) xfs_fs_encode_fh(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	struct inode	*inode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	__u32		*fh,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	int		*max_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	struct inode	*parent)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	struct fid		*fid = (struct fid *)fh;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	struct xfs_fid64	*fid64 = (struct xfs_fid64 *)fh;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	int			fileid_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	int			len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	/* Directories don't need their parent encoded, they have ".." */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	if (!parent)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 		fileid_type = FILEID_INO32_GEN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 		fileid_type = FILEID_INO32_GEN_PARENT;
^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) 	 * If the filesystem may contain 64bit inode numbers, we need
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	 * to use larger file handles that can represent them.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	 * While we only allocate inodes that do not fit into 32 bits any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	 * large enough filesystem may contain them, thus the slightly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	 * confusing looking conditional below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	if (!(XFS_M(inode->i_sb)->m_flags & XFS_MOUNT_SMALL_INUMS) ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	    (XFS_M(inode->i_sb)->m_flags & XFS_MOUNT_32BITINODES))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 		fileid_type |= XFS_FILEID_TYPE_64FLAG;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	 * Only encode if there is enough space given.  In practice
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	 * this means we can't export a filesystem with 64bit inodes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	 * over NFSv2 with the subtree_check export option; the other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	 * seven combinations work.  The real answer is "don't use v2".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	len = xfs_fileid_length(fileid_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	if (*max_len < len) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 		*max_len = len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 		return FILEID_INVALID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	*max_len = len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	switch (fileid_type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	case FILEID_INO32_GEN_PARENT:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 		fid->i32.parent_ino = XFS_I(parent)->i_ino;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		fid->i32.parent_gen = parent->i_generation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 		/*FALLTHRU*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	case FILEID_INO32_GEN:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 		fid->i32.ino = XFS_I(inode)->i_ino;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		fid->i32.gen = inode->i_generation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	case FILEID_INO32_GEN_PARENT | XFS_FILEID_TYPE_64FLAG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 		fid64->parent_ino = XFS_I(parent)->i_ino;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		fid64->parent_gen = parent->i_generation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		/*FALLTHRU*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	case FILEID_INO32_GEN | XFS_FILEID_TYPE_64FLAG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		fid64->ino = XFS_I(inode)->i_ino;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		fid64->gen = inode->i_generation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	return fileid_type;
^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 struct inode *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) xfs_nfs_get_inode(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	struct super_block	*sb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	u64			ino,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	u32			generation)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)  	xfs_mount_t		*mp = XFS_M(sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	xfs_inode_t		*ip;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	int			error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	 * NFS can sometimes send requests for ino 0.  Fail them gracefully.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	if (ino == 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 		return ERR_PTR(-ESTALE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	 * The XFS_IGET_UNTRUSTED means that an invalid inode number is just
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	 * fine and not an indication of a corrupted filesystem as clients can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	 * send invalid file handles and we have to handle it gracefully..
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	error = xfs_iget(mp, NULL, ino, XFS_IGET_UNTRUSTED, 0, &ip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	if (error) {
^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) 		 * EINVAL means the inode cluster doesn't exist anymore.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		 * EFSCORRUPTED means the metadata pointing to the inode cluster
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 		 * or the inode cluster itself is corrupt.  This implies the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		 * filehandle is stale, so we should translate it here.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		 * We don't use ESTALE directly down the chain to not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 		 * confuse applications using bulkstat that expect EINVAL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 		switch (error) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		case -EINVAL:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		case -ENOENT:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 		case -EFSCORRUPTED:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 			error = -ESTALE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 		return ERR_PTR(error);
^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) 	if (VFS_I(ip)->i_generation != generation) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		xfs_irele(ip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		return ERR_PTR(-ESTALE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	return VFS_I(ip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) STATIC struct dentry *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) xfs_fs_fh_to_dentry(struct super_block *sb, struct fid *fid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 		 int fh_len, int fileid_type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	struct xfs_fid64	*fid64 = (struct xfs_fid64 *)fid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	struct inode		*inode = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	if (fh_len < xfs_fileid_length(fileid_type))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	switch (fileid_type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	case FILEID_INO32_GEN_PARENT:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	case FILEID_INO32_GEN:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 		inode = xfs_nfs_get_inode(sb, fid->i32.ino, fid->i32.gen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	case FILEID_INO32_GEN_PARENT | XFS_FILEID_TYPE_64FLAG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	case FILEID_INO32_GEN | XFS_FILEID_TYPE_64FLAG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 		inode = xfs_nfs_get_inode(sb, fid64->ino, fid64->gen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	return d_obtain_alias(inode);
^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) STATIC struct dentry *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) xfs_fs_fh_to_parent(struct super_block *sb, struct fid *fid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		 int fh_len, int fileid_type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	struct xfs_fid64	*fid64 = (struct xfs_fid64 *)fid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	struct inode		*inode = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	if (fh_len < xfs_fileid_length(fileid_type))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 		return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	switch (fileid_type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	case FILEID_INO32_GEN_PARENT:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		inode = xfs_nfs_get_inode(sb, fid->i32.parent_ino,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 					      fid->i32.parent_gen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	case FILEID_INO32_GEN_PARENT | XFS_FILEID_TYPE_64FLAG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 		inode = xfs_nfs_get_inode(sb, fid64->parent_ino,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 					      fid64->parent_gen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	return d_obtain_alias(inode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) STATIC struct dentry *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) xfs_fs_get_parent(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	struct dentry		*child)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	int			error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	struct xfs_inode	*cip;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	error = xfs_lookup(XFS_I(d_inode(child)), &xfs_name_dotdot, &cip, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	if (unlikely(error))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 		return ERR_PTR(error);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	return d_obtain_alias(VFS_I(cip));
^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) STATIC int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) xfs_fs_nfs_commit_metadata(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	struct inode		*inode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	return xfs_log_force_inode(XFS_I(inode));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) const struct export_operations xfs_export_operations = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	.encode_fh		= xfs_fs_encode_fh,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	.fh_to_dentry		= xfs_fs_fh_to_dentry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	.fh_to_parent		= xfs_fs_fh_to_parent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	.get_parent		= xfs_fs_get_parent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	.commit_metadata	= xfs_fs_nfs_commit_metadata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) #ifdef CONFIG_EXPORTFS_BLOCK_OPS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	.get_uuid		= xfs_fs_get_uuid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	.map_blocks		= xfs_fs_map_blocks,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	.commit_blocks		= xfs_fs_commit_blocks,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) };