Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Copyright (c) 2005 Silicon Graphics, Inc.
0004  * All Rights Reserved.
0005  */
0006 #ifndef __XFS_EXPORT_H__
0007 #define __XFS_EXPORT_H__
0008 
0009 /*
0010  * Common defines for code related to exporting XFS filesystems over NFS.
0011  *
0012  * The NFS fileid goes out on the wire as an array of
0013  * 32bit unsigned ints in host order.  There are 5 possible
0014  * formats.
0015  *
0016  * (1)  fileid_type=0x00
0017  *  (no fileid data; handled by the generic code)
0018  *
0019  * (2)  fileid_type=0x01
0020  *  inode-num
0021  *  generation
0022  *
0023  * (3)  fileid_type=0x02
0024  *  inode-num
0025  *  generation
0026  *  parent-inode-num
0027  *  parent-generation
0028  *
0029  * (4)  fileid_type=0x81
0030  *  inode-num-lo32
0031  *  inode-num-hi32
0032  *  generation
0033  *
0034  * (5)  fileid_type=0x82
0035  *  inode-num-lo32
0036  *  inode-num-hi32
0037  *  generation
0038  *  parent-inode-num-lo32
0039  *  parent-inode-num-hi32
0040  *  parent-generation
0041  *
0042  * Note, the NFS filehandle also includes an fsid portion which
0043  * may have an inode number in it.  That number is hardcoded to
0044  * 32bits and there is no way for XFS to intercept it.  In
0045  * practice this means when exporting an XFS filesystem with 64bit
0046  * inodes you should either export the mountpoint (rather than
0047  * a subdirectory) or use the "fsid" export option.
0048  */
0049 
0050 struct xfs_fid64 {
0051     u64 ino;
0052     u32 gen;
0053     u64 parent_ino;
0054     u32 parent_gen;
0055 } __attribute__((packed));
0056 
0057 /* This flag goes on the wire.  Don't play with it. */
0058 #define XFS_FILEID_TYPE_64FLAG  0x80    /* NFS fileid has 64bit inodes */
0059 
0060 #endif  /* __XFS_EXPORT_H__ */