nfs_fs_i.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. #ifndef _NFS_FS_I
  2. #define _NFS_FS_I
  3. #include <asm/types.h>
  4. #include <linux/list.h>
  5. #include <linux/nfs.h>
  6. /*
  7.  * nfs fs inode data in memory
  8.  */
  9. struct nfs_inode_info {
  10. /*
  11.  * The 64bit 'inode number'
  12.  */
  13. __u64 fileid;
  14. /*
  15.  * NFS file handle
  16.  */
  17. struct nfs_fh fh;
  18. /*
  19.  * Various flags
  20.  */
  21. unsigned short flags;
  22. /*
  23.  * read_cache_jiffies is when we started read-caching this inode,
  24.  * and read_cache_mtime is the mtime of the inode at that time.
  25.  * attrtimeo is for how long the cached information is assumed
  26.  * to be valid. A successful attribute revalidation doubles
  27.  * attrtimeo (up to acregmax/acdirmax), a failure resets it to
  28.  * acregmin/acdirmin.
  29.  *
  30.  * We need to revalidate the cached attrs for this inode if
  31.  *
  32.  * jiffies - read_cache_jiffies > attrtimeo
  33.  *
  34.  * and invalidate any cached data/flush out any dirty pages if
  35.  * we find that
  36.  *
  37.  * mtime != read_cache_mtime
  38.  */
  39. unsigned long read_cache_jiffies;
  40. __u64 read_cache_ctime;
  41. __u64 read_cache_mtime;
  42. __u64 read_cache_isize;
  43. unsigned long attrtimeo;
  44. unsigned long attrtimeo_timestamp;
  45. /*
  46.  * Timestamp that dates the change made to read_cache_mtime.
  47.  * This is of use for dentry revalidation
  48.  */
  49. unsigned long cache_mtime_jiffies;
  50. /*
  51.  * This is the cookie verifier used for NFSv3 readdir
  52.  * operations
  53.  */
  54. __u32 cookieverf[2];
  55. /*
  56.  * This is the list of dirty unwritten pages.
  57.  */
  58. struct list_head read;
  59. struct list_head dirty;
  60. struct list_head commit;
  61. struct list_head writeback;
  62. unsigned int nread,
  63. ndirty,
  64. ncommit,
  65. npages;
  66. /* Credentials for shared mmap */
  67. struct rpc_cred *mm_cred;
  68. };
  69. /*
  70.  * Legal inode flag values
  71.  */
  72. #define NFS_INO_STALE 0x0001 /* possible stale inode */
  73. #define NFS_INO_ADVISE_RDPLUS   0x0002          /* advise readdirplus */
  74. #define NFS_INO_REVALIDATING 0x0004 /* revalidating attrs */
  75. #define NFS_IS_SNAPSHOT 0x0010 /* a snapshot file */
  76. #define NFS_INO_FLUSH 0x0020 /* inode is due for flushing */
  77. /*
  78.  * NFS lock info
  79.  */
  80. struct nfs_lock_info {
  81. u32 state;
  82. u32 flags;
  83. struct nlm_host *host;
  84. };
  85. /*
  86.  * Lock flag values
  87.  */
  88. #define NFS_LCK_GRANTED 0x0001 /* lock has been granted */
  89. #define NFS_LCK_RECLAIM 0x0002 /* lock marked for reclaiming */
  90. #endif