| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
| Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 2 | * Copyright (c) 2005 Silicon Graphics, Inc. | 
|  | 3 | * All Rights Reserved. | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * | 
| Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 5 | * This program is free software; you can redistribute it and/or | 
|  | 6 | * modify it under the terms of the GNU General Public License as | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * published by the Free Software Foundation. | 
|  | 8 | * | 
| Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 9 | * This program is distributed in the hope that it would be useful, | 
|  | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|  | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|  | 12 | * GNU General Public License for more details. | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | * | 
| Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 14 | * You should have received a copy of the GNU General Public License | 
|  | 15 | * along with this program; if not, write the Free Software Foundation, | 
|  | 16 | * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | */ | 
|  | 18 | #ifndef __XFS_EXPORT_H__ | 
|  | 19 | #define __XFS_EXPORT_H__ | 
|  | 20 |  | 
|  | 21 | /* | 
|  | 22 | * Common defines for code related to exporting XFS filesystems over NFS. | 
|  | 23 | * | 
|  | 24 | * The NFS fileid goes out on the wire as an array of | 
|  | 25 | * 32bit unsigned ints in host order.  There are 5 possible | 
|  | 26 | * formats. | 
|  | 27 | * | 
|  | 28 | * (1)	fileid_type=0x00 | 
|  | 29 | *	(no fileid data; handled by the generic code) | 
|  | 30 | * | 
|  | 31 | * (2)	fileid_type=0x01 | 
|  | 32 | *	inode-num | 
|  | 33 | *	generation | 
|  | 34 | * | 
|  | 35 | * (3)	fileid_type=0x02 | 
|  | 36 | *	inode-num | 
|  | 37 | *	generation | 
|  | 38 | *	parent-inode-num | 
|  | 39 | *	parent-generation | 
|  | 40 | * | 
|  | 41 | * (4)	fileid_type=0x81 | 
|  | 42 | *	inode-num-lo32 | 
|  | 43 | *	inode-num-hi32 | 
|  | 44 | *	generation | 
|  | 45 | * | 
|  | 46 | * (5)	fileid_type=0x82 | 
|  | 47 | *	inode-num-lo32 | 
|  | 48 | *	inode-num-hi32 | 
|  | 49 | *	generation | 
|  | 50 | *	parent-inode-num-lo32 | 
|  | 51 | *	parent-inode-num-hi32 | 
|  | 52 | *	parent-generation | 
|  | 53 | * | 
|  | 54 | * Note, the NFS filehandle also includes an fsid portion which | 
|  | 55 | * may have an inode number in it.  That number is hardcoded to | 
|  | 56 | * 32bits and there is no way for XFS to intercept it.  In | 
| Nathan Scott | c41564b | 2006-03-29 08:55:14 +1000 | [diff] [blame] | 57 | * practice this means when exporting an XFS filesystem with 64bit | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | * inodes you should either export the mountpoint (rather than | 
|  | 59 | * a subdirectory) or use the "fsid" export option. | 
|  | 60 | */ | 
|  | 61 |  | 
| Christoph Hellwig | c38344f | 2007-10-21 16:42:11 -0700 | [diff] [blame] | 62 | struct xfs_fid64 { | 
|  | 63 | u64 ino; | 
|  | 64 | u32 gen; | 
|  | 65 | u64 parent_ino; | 
|  | 66 | u32 parent_gen; | 
|  | 67 | } __attribute__((packed)); | 
|  | 68 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | /* This flag goes on the wire.  Don't play with it. */ | 
|  | 70 | #define XFS_FILEID_TYPE_64FLAG	0x80	/* NFS fileid has 64bit inodes */ | 
|  | 71 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | #endif	/* __XFS_EXPORT_H__ */ |