Whamcloud - gitweb
LU-4603 lmv: a few fixes about readdir of striped dir.
[fs/lustre-release.git] / lustre / llite / llite_internal.h
index de06b82..cb6a254 100644 (file)
@@ -96,7 +96,7 @@ struct ll_getname_data {
 
 /* llite setxid/access permission for user on remote client */
 struct ll_remote_perm {
-        cfs_hlist_node_t        lrp_list;
+       struct hlist_node       lrp_list;
         uid_t                   lrp_uid;
         gid_t                   lrp_gid;
         uid_t                   lrp_fsuid;
@@ -132,8 +132,8 @@ struct ll_inode_info {
        spinlock_t                      lli_lock;
        struct posix_acl                *lli_posix_acl;
 
-       cfs_hlist_head_t                *lli_remote_perms;
-       struct mutex                            lli_rmtperm_mutex;
+       struct hlist_head               *lli_remote_perms;
+       struct mutex                    lli_rmtperm_mutex;
 
         /* identifying fields for both metadata and data stacks. */
         struct lu_fid                   lli_fid;
@@ -225,7 +225,7 @@ struct ll_inode_info {
 
                        struct rw_semaphore             f_glimpse_sem;
                        cfs_time_t                      f_glimpse_time;
-                       cfs_list_t                      f_agl_list;
+                       struct list_head                        f_agl_list;
                        __u64                           f_agl_index;
 
                        /* for writepage() only to communicate to fsync */
@@ -429,6 +429,7 @@ enum stats_track_type {
 #define LL_SBI_LAYOUT_LOCK    0x20000 /* layout lock support */
 #define LL_SBI_USER_FID2PATH  0x40000 /* allow fid2path by unprivileged users */
 #define LL_SBI_XATTR_CACHE    0x80000 /* support for xattr cache */
+#define LL_SBI_NOROOTSQUASH  0x100000 /* do not apply root squash */
 
 #define LL_SBI_FLAGS {         \
        "nolck",        \
@@ -451,25 +452,26 @@ enum stats_track_type {
        "layout",       \
        "user_fid2path",\
        "xattr",        \
+       "norootsquash", \
 }
 
 #define RCE_HASHES      32
 
 struct rmtacl_ctl_entry {
-        cfs_list_t       rce_list;
+       struct list_head       rce_list;
         pid_t            rce_key; /* hash key */
         int              rce_ops; /* acl operation type */
 };
 
 struct rmtacl_ctl_table {
        spinlock_t      rct_lock;
-       cfs_list_t      rct_entries[RCE_HASHES];
+       struct list_head        rct_entries[RCE_HASHES];
 };
 
 #define EE_HASHES       32
 
 struct eacl_entry {
-        cfs_list_t            ee_list;
+       struct list_head            ee_list;
         pid_t                 ee_key; /* hash key */
         struct lu_fid         ee_fid;
         int                   ee_type; /* ACL type for ACCESS or DEFAULT */
@@ -478,11 +480,11 @@ struct eacl_entry {
 
 struct eacl_table {
        spinlock_t      et_lock;
-       cfs_list_t      et_entries[EE_HASHES];
+       struct list_head        et_entries[EE_HASHES];
 };
 
 struct ll_sb_info {
-       cfs_list_t                ll_list;
+       struct list_head                  ll_list;
        /* this protects pglist and ra_info.  It isn't safe to
         * grab from interrupt contexts */
        spinlock_t                ll_lock;
@@ -497,10 +499,12 @@ struct ll_sb_info {
         int                       ll_flags;
        unsigned int              ll_umounting:1,
                                  ll_xattr_cache_enabled:1;
-        cfs_list_t                ll_conn_chain; /* per-conn chain of SBs */
+       /* per-conn chain of SBs */
+       struct list_head                ll_conn_chain;
         struct lustre_client_ocd  ll_lco;
 
-        cfs_list_t                ll_orphan_dentry_list; /*please don't ask -p*/
+       /*please don't ask -p*/
+       struct list_head        ll_orphan_dentry_list;
         struct ll_close_queue    *ll_lcq;
 
         struct lprocfs_stats     *ll_stats; /* lprocfs stats counter */
@@ -520,7 +524,7 @@ struct ll_sb_info {
         /* =0 - hold lock over whole read/write
          * >0 - max. chunk to be read/written w/o lock re-acquiring */
         unsigned long             ll_max_rw_chunk;
-        unsigned int              ll_md_brw_size; /* used by readdir */
+       unsigned int              ll_md_brw_pages; /* readdir pages per RPC */
 
         struct lu_site           *ll_site;
         struct cl_device         *ll_cl;
@@ -547,6 +551,9 @@ struct ll_sb_info {
                                                 * clustred nfs */
        struct rmtacl_ctl_table   ll_rct;
        struct eacl_table         ll_et;
+
+       /* root squash */
+       struct root_squash_info   ll_squash;
 };
 
 #define LL_DEFAULT_MAX_RW_CHUNK      (32 * 1024 * 1024)
@@ -555,7 +562,7 @@ struct ll_ra_read {
         pgoff_t             lrr_start;
         pgoff_t             lrr_count;
         struct task_struct *lrr_reader;
-        cfs_list_t          lrr_linkage;
+       struct list_head          lrr_linkage;
 };
 
 /*
@@ -620,7 +627,7 @@ struct ll_readahead_state {
          * progress against this file descriptor. Used by read-ahead code,
          * protected by ->ras_lock.
          */
-        cfs_list_t      ras_read_beads;
+       struct list_head      ras_read_beads;
         /*
          * The following 3 items are used for detecting the stride I/O
          * mode.
@@ -883,12 +890,14 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data,
 void ll_finish_md_op_data(struct md_op_data *op_data);
 int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg);
 char *ll_get_fsname(struct super_block *sb, char *buf, int buflen);
+void ll_compute_rootsquash_state(struct ll_sb_info *sbi);
 
 /* llite/llite_nfs.c */
 extern struct export_operations lustre_export_operations;
 __u32 get_uuid2int(const char *name, int len);
 struct inode *search_inode_for_lustre(struct super_block *sb,
                                      const struct lu_fid *fid);
+int ll_dir_get_parent_fid(struct inode *dir, struct lu_fid *parent_fid);
 
 /* llite/symlink.c */
 extern struct inode_operations ll_fast_symlink_inode_operations;
@@ -896,7 +905,7 @@ extern struct inode_operations ll_fast_symlink_inode_operations;
 /* llite/llite_close.c */
 struct ll_close_queue {
        spinlock_t              lcq_lock;
-       cfs_list_t              lcq_head;
+       struct list_head                lcq_head;
        wait_queue_head_t       lcq_waitq;
        struct completion       lcq_comp;
        atomic_t                lcq_stop;
@@ -1132,7 +1141,7 @@ int ll_removexattr(struct dentry *dentry, const char *name);
 extern struct kmem_cache *ll_remote_perm_cachep;
 extern struct kmem_cache *ll_rmtperm_hash_cachep;
 
-void free_rmtperm_hash(cfs_hlist_head_t *hash);
+void free_rmtperm_hash(struct hlist_head *hash);
 int ll_update_remote_perm(struct inode *inode, struct mdt_remote_perm *perm);
 int lustre_check_remote_perm(struct inode *inode, int mask);