nfs_fs_i.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:2k
源码类别:

嵌入式Linux

开发平台:

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 fsid;
  14. __u64 fileid;
  15. /*
  16.  * NFS file handle
  17.  */
  18. struct nfs_fh fh;
  19. /*
  20.  * Various flags
  21.  */
  22. unsigned short flags;
  23. /*
  24.  * read_cache_jiffies is when we started read-caching this inode,
  25.  * and read_cache_mtime is the mtime of the inode at that time.
  26.  * attrtimeo is for how long the cached information is assumed
  27.  * to be valid. A successful attribute revalidation doubles
  28.  * attrtimeo (up to acregmax/acdirmax), a failure resets it to
  29.  * acregmin/acdirmin.
  30.  *
  31.  * We need to revalidate the cached attrs for this inode if
  32.  *
  33.  * jiffies - read_cache_jiffies > attrtimeo
  34.  *
  35.  * and invalidate any cached data/flush out any dirty pages if
  36.  * we find that
  37.  *
  38.  * mtime != read_cache_mtime
  39.  */
  40. unsigned long read_cache_jiffies;
  41. __u64 read_cache_ctime;
  42. __u64 read_cache_mtime;
  43. __u64 read_cache_isize;
  44. unsigned long attrtimeo;
  45. unsigned long attrtimeo_timestamp;
  46. /*
  47.  * This is the cookie verifier used for NFSv3 readdir
  48.  * operations
  49.  */
  50. __u32 cookieverf[2];
  51. /*
  52.  * This is the list of dirty unwritten pages.
  53.  */
  54. struct list_head read;
  55. struct list_head dirty;
  56. struct list_head commit;
  57. struct list_head writeback;
  58. unsigned int nread,
  59. ndirty,
  60. ncommit,
  61. npages;
  62. /* Flush daemon info */
  63. struct inode *hash_next,
  64. *hash_prev;
  65. unsigned long nextscan;
  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