Whamcloud - gitweb
LU-2675 llite: remove dead code 67/9767/4
authorJohn L. Hammond <john.hammond@intel.com>
Mon, 24 Mar 2014 20:24:35 +0000 (15:24 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 18 Apr 2014 05:41:20 +0000 (05:41 +0000)
In llite remove unused declarations, parameters, types, and unused,
get-only, or set-only structure members. Add static and const
qualifiers to declarations where possible.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: If710247d11debd748d2efe80e400f208066cbafa
Reviewed-on: http://review.whamcloud.com/9767
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
21 files changed:
lustre/lclient/lcommon_cl.c
lustre/llite/dcache.c
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_capa.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/llite_mmap.c
lustre/llite/lloop.c
lustre/llite/lproc_llite.c
lustre/llite/namei.c
lustre/llite/remote_perm.c
lustre/llite/rw.c
lustre/llite/rw26.c
lustre/llite/statahead.c
lustre/llite/super25.c
lustre/llite/vvp_dev.c
lustre/llite/vvp_internal.h
lustre/llite/vvp_io.c
lustre/llite/vvp_object.c
lustre/llite/xattr_cache.c

index 79ecc03..22adcc4 100644 (file)
@@ -79,7 +79,7 @@
 #include "../liblustre/llite_lib.h"
 #endif
 
-const struct cl_req_operations ccc_req_ops;
+static const struct cl_req_operations ccc_req_ops;
 
 /*
  * ccc_ prefix stands for "Common Client Code".
@@ -961,7 +961,7 @@ void ccc_req_attr_set(const struct lu_env *env,
 #endif
 }
 
-const struct cl_req_operations ccc_req_ops = {
+static const struct cl_req_operations ccc_req_ops = {
         .cro_attr_set   = ccc_req_attr_set,
         .cro_completion = ccc_req_completion
 };
index 8a8c100..2d3d2f7 100644 (file)
@@ -70,8 +70,7 @@ static void ll_release(struct dentry *de)
                 ll_intent_release(lld->lld_it);
                 OBD_FREE(lld->lld_it, sizeof(*lld->lld_it));
         }
-       LASSERT(lld->lld_cwd_count == 0);
-       LASSERT(lld->lld_mnt_count == 0);
+
        de->d_fsdata = NULL;
        call_rcu(&lld->lld_rcu_head, free_dentry_data);
 
@@ -86,14 +85,17 @@ static void ll_release(struct dentry *de)
  * INVALID) so d_lookup() matches it, but we have no lock on it (so
  * lock_match() fails) and we spin around real_lookup(). */
 #ifdef HAVE_D_COMPARE_7ARGS
-int ll_dcompare(const struct dentry *parent, const struct inode *pinode,
-               const struct dentry *dentry, const struct inode *inode,
-               unsigned int len, const char *str, const struct qstr *name)
+static int ll_dcompare(const struct dentry *parent, const struct inode *pinode,
+                      const struct dentry *dentry, const struct inode *inode,
+                      unsigned int len, const char *str,
+                      const struct qstr *name)
 #elif defined(HAVE_D_COMPARE_5ARGS)
-int ll_dcompare(const struct dentry *parent, const struct dentry *dentry,
-               unsigned int len, const char *str, const struct qstr *name)
+static int ll_dcompare(const struct dentry *parent, const struct dentry *dentry,
+                      unsigned int len, const char *str,
+                      const struct qstr *name)
 #else
-int ll_dcompare(struct dentry *parent, struct qstr *d_name, struct qstr *name)
+static int ll_dcompare(struct dentry *parent, struct qstr *d_name,
+                      struct qstr *name)
 #endif
 {
 #if !defined(HAVE_D_COMPARE_7ARGS) && !defined(HAVE_D_COMPARE_5ARGS)
@@ -144,8 +146,8 @@ static int find_cbdata(struct inode *inode)
         LASSERT(inode);
         rc = md_find_cbdata(sbi->ll_md_exp, ll_inode2fid(inode),
                             return_if_equal, NULL);
-        if (rc != 0)
-                 RETURN(rc);
+       if (rc != 0)
+               RETURN(rc);
 
        lsm = ccc_inode_lsm_get(inode);
        if (lsm == NULL)
@@ -267,7 +269,8 @@ void ll_intent_release(struct lookup_intent *it)
         ll_intent_drop_lock(it);
         /* We are still holding extra reference on a request, need to free it */
         if (it_disposition(it, DISP_ENQ_OPEN_REF))
-                 ptlrpc_req_finished(it->d.lustre.it_data); /* ll_file_open */
+               ptlrpc_req_finished(it->d.lustre.it_data); /* ll_file_open */
+
         if (it_disposition(it, DISP_ENQ_CREATE_REF)) /* create rec */
                 ptlrpc_req_finished(it->d.lustre.it_data);
 
@@ -350,15 +353,6 @@ void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry)
         }
 }
 
-void ll_frob_intent(struct lookup_intent **itp, struct lookup_intent *deft)
-{
-        struct lookup_intent *it = *itp;
-
-        if (!it || it->it_op == IT_GETXATTR)
-                it = *itp = deft;
-
-}
-
 static int ll_revalidate_dentry(struct dentry *dentry,
                                unsigned int lookup_flags)
 {
@@ -393,7 +387,7 @@ static int ll_revalidate_dentry(struct dentry *dentry,
  * Always trust cached dentries. Update statahead window if necessary.
  */
 #ifdef HAVE_IOP_ATOMIC_OPEN
-int ll_revalidate_nd(struct dentry *dentry, unsigned int flags)
+static int ll_revalidate_nd(struct dentry *dentry, unsigned int flags)
 {
        int rc;
        ENTRY;
@@ -405,7 +399,7 @@ int ll_revalidate_nd(struct dentry *dentry, unsigned int flags)
        RETURN(rc);
 }
 #else
-int ll_revalidate_nd(struct dentry *dentry, struct nameidata *nd)
+static int ll_revalidate_nd(struct dentry *dentry, struct nameidata *nd)
 {
        int rc;
        ENTRY;
@@ -425,7 +419,7 @@ int ll_revalidate_nd(struct dentry *dentry, struct nameidata *nd)
 }
 #endif
 
-void ll_d_iput(struct dentry *de, struct inode *inode)
+static void ll_d_iput(struct dentry *de, struct inode *inode)
 {
        LASSERT(inode);
        if (!find_cbdata(inode))
@@ -433,7 +427,7 @@ void ll_d_iput(struct dentry *de, struct inode *inode)
        iput(inode);
 }
 
-struct dentry_operations ll_d_ops = {
+const struct dentry_operations ll_d_ops = {
         .d_revalidate = ll_revalidate_nd,
         .d_release = ll_release,
         .d_delete  = ll_ddelete,
index 9189cbd..fa720f6 100644 (file)
@@ -353,7 +353,7 @@ out:
        RETURN(rc);
 }
 
-int ll_send_mgc_param(struct obd_export *mgc, char *string)
+static int ll_send_mgc_param(struct obd_export *mgc, char *string)
 {
         struct mgs_send_param *msp;
         int rc = 0;
@@ -1833,19 +1833,19 @@ out:
         return ret;
 }
 
-int ll_dir_open(struct inode *inode, struct file *file)
+static int ll_dir_open(struct inode *inode, struct file *file)
 {
         ENTRY;
         RETURN(ll_file_open(inode, file));
 }
 
-int ll_dir_release(struct inode *inode, struct file *file)
+static int ll_dir_release(struct inode *inode, struct file *file)
 {
         ENTRY;
         RETURN(ll_file_release(inode, file));
 }
 
-struct file_operations ll_dir_operations = {
+const struct file_operations ll_dir_operations = {
        .llseek         = ll_dir_seek,
        .open           = ll_dir_open,
        .release        = ll_dir_release,
index e92a510..cc3ecaa 100644 (file)
 
 #include "cl_object.h"
 
-struct ll_file_data *ll_file_data_get(void)
+static int
+ll_put_grouplock(struct inode *inode, struct file *file, unsigned long arg);
+
+static int ll_lease_close(struct obd_client_handle *och, struct inode *inode,
+                         bool *lease_broken);
+
+static enum llioc_iter
+ll_iocontrol_call(struct inode *inode, struct file *file,
+                 unsigned int cmd, unsigned long arg, int *rcp);
+
+static struct ll_file_data *ll_file_data_get(void)
 {
        struct ll_file_data *fd;
 
@@ -261,8 +271,8 @@ int ll_md_real_close(struct inode *inode, fmode_t fmode)
        RETURN(rc);
 }
 
-int ll_md_close(struct obd_export *md_exp, struct inode *inode,
-                struct file *file)
+static int ll_md_close(struct obd_export *md_exp, struct inode *inode,
+                      struct file *file)
 {
         struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
         struct ll_inode_info *lli = ll_i2info(inode);
@@ -500,8 +510,8 @@ static int ll_och_fill(struct obd_export *md_exp, struct lookup_intent *it,
        return md_set_open_replay_data(md_exp, och, it);
 }
 
-int ll_local_open(struct file *file, struct lookup_intent *it,
-                  struct ll_file_data *fd, struct obd_client_handle *och)
+static int ll_local_open(struct file *file, struct lookup_intent *it,
+                        struct ll_file_data *fd, struct obd_client_handle *och)
 {
         struct inode *inode = file->f_dentry->d_inode;
         struct ll_inode_info *lli = ll_i2info(inode);
@@ -757,8 +767,9 @@ static int ll_md_blocking_lease_ast(struct ldlm_lock *lock,
 /**
  * Acquire a lease and open the file.
  */
-struct obd_client_handle *ll_lease_open(struct inode *inode, struct file *file,
-                                       fmode_t fmode, __u64 open_flags)
+static struct obd_client_handle *
+ll_lease_open(struct inode *inode, struct file *file, fmode_t fmode,
+             __u64 open_flags)
 {
        struct lookup_intent it = { .it_op = IT_OPEN };
        struct ll_sb_info *sbi = ll_i2sbi(inode);
@@ -891,14 +902,13 @@ out:
                OBD_FREE_PTR(och);
        RETURN(ERR_PTR(rc));
 }
-EXPORT_SYMBOL(ll_lease_open);
 
 /**
  * Release lease and close the file.
  * It will check if the lease has ever broken.
  */
-int ll_lease_close(struct obd_client_handle *och, struct inode *inode,
-                       bool *lease_broken)
+static int ll_lease_close(struct obd_client_handle *och, struct inode *inode,
+                         bool *lease_broken)
 {
        struct ldlm_lock *lock;
        bool cancelled = true;
@@ -925,7 +935,6 @@ int ll_lease_close(struct obd_client_handle *och, struct inode *inode,
                                       NULL);
        RETURN(rc);
 }
-EXPORT_SYMBOL(ll_lease_close);
 
 /* Fills the obdo with the attributes for the lsm */
 static int ll_lsm_getattr(struct lov_stripe_md *lsm, struct obd_export *exp,
@@ -1100,7 +1109,7 @@ static bool file_is_noatime(const struct file *file)
        return false;
 }
 
-void ll_io_init(struct cl_io *io, const struct file *file, int write)
+static void ll_io_init(struct cl_io *io, const struct file *file, int write)
 {
         struct inode *inode = file->f_dentry->d_inode;
 
@@ -1688,7 +1697,8 @@ static int ll_lov_getstripe(struct inode *inode, unsigned long arg)
        RETURN(rc);
 }
 
-int ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg)
+static int
+ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg)
 {
         struct ll_inode_info   *lli = ll_i2info(inode);
         struct ll_file_data    *fd = LUSTRE_FPRIVATE(file);
@@ -1811,8 +1821,8 @@ out:
  * Get size for inode for which FIEMAP mapping is requested.
  * Make the FIEMAP get_info call and returns the result.
  */
-int ll_do_fiemap(struct inode *inode, struct ll_user_fiemap *fiemap,
-              int num_bytes)
+static int ll_do_fiemap(struct inode *inode, struct ll_user_fiemap *fiemap,
+                       int num_bytes)
 {
        struct obd_export *exp = ll_i2dtexp(inode);
        struct lov_stripe_md *lsm = NULL;
@@ -2296,7 +2306,8 @@ out:
        RETURN(rc);
 }
 
-long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+static long
+ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        struct inode            *inode = file->f_dentry->d_inode;
        struct ll_file_data     *fd = LUSTRE_FPRIVATE(file);
@@ -2682,7 +2693,7 @@ generic_file_llseek_size(struct file *file, loff_t offset, int origin,
 }
 #endif
 
-loff_t ll_file_seek(struct file *file, loff_t offset, int origin)
+static loff_t ll_file_seek(struct file *file, loff_t offset, int origin)
 {
        struct inode *inode = file->f_dentry->d_inode;
        loff_t retval, eof = 0;
@@ -2707,7 +2718,7 @@ loff_t ll_file_seek(struct file *file, loff_t offset, int origin)
        RETURN(retval);
 }
 
-int ll_flush(struct file *file, fl_owner_t id)
+static int ll_flush(struct file *file, fl_owner_t id)
 {
        struct inode *inode = file->f_dentry->d_inode;
        struct ll_inode_info *lli = ll_i2info(inode);
@@ -2865,7 +2876,8 @@ int ll_fsync(struct file *file, struct dentry *dentry, int datasync)
        RETURN(rc);
 }
 
-int ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
+static int
+ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
 {
        struct inode *inode = file->f_dentry->d_inode;
        struct ll_sb_info *sbi = ll_i2sbi(inode);
@@ -3102,7 +3114,8 @@ out_free:
        RETURN(rc);
 }
 
-int ll_file_noflock(struct file *file, int cmd, struct file_lock *file_lock)
+static int
+ll_file_noflock(struct file *file, int cmd, struct file_lock *file_lock)
 {
         ENTRY;
 
@@ -3198,8 +3211,7 @@ static int ll_inode_revalidate_fini(struct inode *inode, int rc)
        return rc;
 }
 
-int __ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
-                             __u64 ibits)
+static int __ll_inode_revalidate(struct dentry *dentry, __u64 ibits)
 {
         struct inode *inode = dentry->d_inode;
         struct ptlrpc_request *req = NULL;
@@ -3316,14 +3328,14 @@ static int ll_merge_md_attr(struct inode *inode)
        RETURN(0);
 }
 
-int ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
-                          __u64 ibits)
+static int
+ll_inode_revalidate(struct dentry *dentry, __u64 ibits)
 {
        struct inode    *inode = dentry->d_inode;
        int              rc;
        ENTRY;
 
-       rc = __ll_inode_revalidate_it(dentry, it, ibits);
+       rc = __ll_inode_revalidate(dentry, ibits);
        if (rc != 0)
                RETURN(rc);
 
@@ -3353,16 +3365,15 @@ int ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
        RETURN(rc);
 }
 
-int ll_getattr_it(struct vfsmount *mnt, struct dentry *de,
-                  struct lookup_intent *it, struct kstat *stat)
+int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat)
 {
         struct inode *inode = de->d_inode;
         struct ll_sb_info *sbi = ll_i2sbi(inode);
         struct ll_inode_info *lli = ll_i2info(inode);
         int res = 0;
 
-        res = ll_inode_revalidate_it(de, it, MDS_INODELOCK_UPDATE |
-                                             MDS_INODELOCK_LOOKUP);
+       res = ll_inode_revalidate(de, MDS_INODELOCK_UPDATE |
+                                     MDS_INODELOCK_LOOKUP);
         ll_stats_ops_tally(sbi, LPROC_LL_GETATTR, 1);
 
         if (res)
@@ -3394,15 +3405,9 @@ int ll_getattr_it(struct vfsmount *mnt, struct dentry *de,
 
         return 0;
 }
-int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat)
-{
-        struct lookup_intent it = { .it_op = IT_GETATTR };
 
-        return ll_getattr_it(mnt, de, &it, stat);
-}
-
-int ll_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
-                __u64 start, __u64 len)
+static int ll_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
+                    __u64 start, __u64 len)
 {
         int rc;
         size_t num_bytes;
@@ -3434,7 +3439,7 @@ int ll_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
         return rc;
 }
 
-struct posix_acl * ll_get_acl(struct inode *inode, int type)
+struct posix_acl *ll_get_acl(struct inode *inode, int type)
 {
        struct ll_inode_info *lli = ll_i2info(inode);
        struct posix_acl *acl = NULL;
@@ -3505,10 +3510,8 @@ int ll_inode_permission(struct inode *inode, int mask, struct nameidata *nd)
         * need to do it before permission check. */
 
         if (inode == inode->i_sb->s_root->d_inode) {
-                struct lookup_intent it = { .it_op = IT_LOOKUP };
-
-                rc = __ll_inode_revalidate_it(inode->i_sb->s_root, &it,
-                                              MDS_INODELOCK_LOOKUP);
+               rc = __ll_inode_revalidate(inode->i_sb->s_root,
+                                          MDS_INODELOCK_LOOKUP);
                 if (rc)
                         RETURN(rc);
         }
@@ -3663,8 +3666,9 @@ void ll_iocontrol_unregister(void *magic)
 EXPORT_SYMBOL(ll_iocontrol_register);
 EXPORT_SYMBOL(ll_iocontrol_unregister);
 
-enum llioc_iter ll_iocontrol_call(struct inode *inode, struct file *file,
-                        unsigned int cmd, unsigned long arg, int *rcp)
+static enum llioc_iter
+ll_iocontrol_call(struct inode *inode, struct file *file,
+                 unsigned int cmd, unsigned long arg, int *rcp)
 {
         enum llioc_iter ret = LLIOC_CONT;
         struct llioc_data *data;
index 3b76920..e5effcf 100644 (file)
@@ -69,6 +69,8 @@ static unsigned long long ll_capa_renewal_noent = 0;
 static unsigned long long ll_capa_renewal_failed = 0;
 static unsigned long long ll_capa_renewal_retries = 0;
 
+static int ll_update_capa(struct obd_capa *ocapa, struct lustre_capa *capa);
+
 static inline void update_capa_timer(struct obd_capa *ocapa, cfs_time_t expiry)
 {
         if (cfs_time_before(expiry, ll_capa_timer.expires) ||
@@ -521,7 +523,7 @@ static inline void delay_capa_renew(struct obd_capa *oc, cfs_time_t delay)
         oc->c_expiry = cfs_time_add(oc->c_expiry, cfs_time_seconds(delay));
 }
 
-int ll_update_capa(struct obd_capa *ocapa, struct lustre_capa *capa)
+static int ll_update_capa(struct obd_capa *ocapa, struct lustre_capa *capa)
 {
         struct inode *inode = ocapa->u.cli.inode;
         int rc = 0;
index 89ee6b0..b9bef76 100644 (file)
 #define LUSTRE_FPRIVATE(file) ((file)->private_data)
 
 struct ll_dentry_data {
-       int                             lld_cwd_count;
-       int                             lld_mnt_count;
-       struct obd_client_handle        lld_cwd_och;
-       struct obd_client_handle        lld_mnt_och;
        struct lookup_intent            *lld_it;
        unsigned int                    lld_sa_generation;
        unsigned int                    lld_invalid:1;
@@ -83,8 +79,6 @@ struct ll_dentry_data {
 
 #define ll_d2d(de) ((struct ll_dentry_data*)((de)->d_fsdata))
 
-extern struct file_operations ll_pgcache_seq_fops;
-
 #define LLI_INODE_MAGIC                 0x111d0de5
 #define LLI_INODE_DEAD                  0xdeadd00d
 
@@ -122,16 +116,12 @@ enum lli_flags {
         /* Sizeon-on-MDS attributes are changed. An attribute update needs to
          * be sent to MDS. */
         LLIF_SOM_DIRTY          = (1 << 3),
-        /* File is contented */
-        LLIF_CONTENDED          = (1 << 4),
-        /* Truncate uses server lock for this file */
-        LLIF_SRVLOCK            = (1 << 5),
        /* File data is modified. */
-       LLIF_DATA_MODIFIED      = (1 << 6),
+       LLIF_DATA_MODIFIED      = (1 << 4),
        /* File is being restored */
-       LLIF_FILE_RESTORING     = (1 << 7),
+       LLIF_FILE_RESTORING     = (1 << 5),
        /* Xattr cache is attached to the file */
-       LLIF_XATTR_CACHE        = (1 << 8),
+       LLIF_XATTR_CACHE        = (1 << 6),
 };
 
 struct ll_inode_info {
@@ -196,7 +186,6 @@ struct ll_inode_info {
                          * cleanup the dir readahead. */
                         void                           *d_opendir_key;
                         struct ll_statahead_info       *d_sai;
-                        struct posix_acl               *d_def_acl;
                         /* protect statahead stuff. */
                        spinlock_t                      d_sa_lock;
                        /* "opendir_pid" is the token when lookup/revalid
@@ -213,7 +202,6 @@ struct ll_inode_info {
 #define lli_readdir_mutex       u.d.d_readdir_mutex
 #define lli_opendir_key         u.d.d_opendir_key
 #define lli_sai                 u.d.d_sai
-#define lli_def_acl             u.d.d_def_acl
 #define lli_sa_lock             u.d.d_sa_lock
 #define lli_opendir_pid         u.d.d_opendir_pid
 #define lli_lsm_md             u.d.d_lsm_md
@@ -243,11 +231,6 @@ struct ll_inode_info {
                        /* for writepage() only to communicate to fsync */
                        int                             f_async_rc;
 
-                       /* volatile file criteria is based on file name, this
-                        * flag is used to keep the test result, so the strcmp
-                        * is done only once
-                        */
-                       bool                            f_volatile;
                        /*
                         * whenever a process try to read/write the file, the
                         * jobid of the process will be saved here, and it'll
@@ -270,7 +253,6 @@ struct ll_inode_info {
 #define lli_agl_index          u.f.f_agl_index
 #define lli_async_rc           u.f.f_async_rc
 #define lli_jobid              u.f.f_jobid
-#define lli_volatile           u.f.f_volatile
 
        } u;
 
@@ -471,10 +453,6 @@ enum stats_track_type {
        "xattr",        \
 }
 
-/* default value for ll_sb_info->contention_time */
-#define SBI_DEFAULT_CONTENTION_SECONDS     60
-/* default value for lockless_truncate_enable */
-#define SBI_DEFAULT_LOCKLESS_TRUNCATE_ENABLE 1
 #define RCE_HASHES      32
 
 struct rmtacl_ctl_entry {
@@ -696,34 +674,20 @@ static inline struct inode *ll_info2i(struct ll_inode_info *lli)
         return &lli->lli_vfs_inode;
 }
 
-struct it_cb_data {
-        struct inode  *icbd_parent;
-        struct dentry **icbd_childp;
-        obd_id        hash;
-};
-
 __u32 ll_i2suppgid(struct inode *i);
 void ll_i2gids(__u32 *suppgids, struct inode *i1,struct inode *i2);
 
 static inline int ll_need_32bit_api(struct ll_sb_info *sbi)
 {
 #if BITS_PER_LONG == 32
-        return 1;
+       return 1;
+#elif defined(CONFIG_COMPAT)
+       return unlikely(is_compat_task() || (sbi->ll_flags & LL_SBI_32BIT_API));
 #else
-       return unlikely(
-#ifdef CONFIG_COMPAT
-               is_compat_task() ||
-#endif
-               (sbi->ll_flags & LL_SBI_32BIT_API)
-       );
+       return unlikely(sbi->ll_flags & LL_SBI_32BIT_API);
 #endif
 }
 
-#define LLAP_MAGIC 98764321
-
-extern struct kmem_cache *ll_async_page_slab;
-extern size_t ll_async_page_slab_size;
-
 void ll_ra_read_in(struct file *f, struct ll_ra_read *rar);
 void ll_ra_read_ex(struct file *f, struct ll_ra_read *rar);
 struct ll_ra_read *ll_ra_read_get(struct file *f);
@@ -744,8 +708,8 @@ static void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count) {}
 
 
 /* llite/dir.c */
-extern struct file_operations ll_dir_operations;
-extern struct inode_operations ll_dir_inode_operations;
+extern const struct file_operations ll_dir_operations;
+extern const struct inode_operations ll_dir_inode_operations;
 #ifdef HAVE_DIR_CONTEXT
 int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
                struct dir_context *ctx);
@@ -765,6 +729,8 @@ struct lu_dirent *ll_dir_entry_next(struct inode *dir,
                                    struct lu_dirent *ent,
                                    struct page **ppage);
 /* llite/namei.c */
+extern const struct inode_operations ll_special_inode_operations;
+
 int ll_objects_destroy(struct ptlrpc_request *request,
                        struct inode *dir);
 struct inode *ll_iget(struct super_block *sb, ino_t hash,
@@ -772,26 +738,15 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash,
 int ll_test_inode_by_fid(struct inode *inode, void *opaque);
 int ll_md_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *,
                        void *data, int flag);
-#ifndef HAVE_IOP_ATOMIC_OPEN
-struct lookup_intent *ll_convert_intent(struct open_intent *oit,
-                                        int lookup_flags);
-#endif
 struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de);
 int ll_rmdir_entry(struct inode *dir, char *name, int namelen);
-int ll_d_mountpoint(struct dentry *dparent, struct dentry *dchild,
-                   struct qstr *name);
 void ll_update_times(struct ptlrpc_request *request, struct inode *inode);
 
 /* llite/rw.c */
 int ll_writepage(struct page *page, struct writeback_control *wbc);
 int ll_writepages(struct address_space *, struct writeback_control *wbc);
-void ll_removepage(struct page *page);
 int ll_readpage(struct file *file, struct page *page);
 void ll_readahead_init(struct inode *inode, struct ll_readahead_state *ras);
-int ll_file_punch(struct inode *, loff_t, int);
-ssize_t ll_file_lockless_io(struct file *, char *, size_t, loff_t *, int);
-void ll_clear_file_contended(struct inode*);
-int ll_sync_page_range(struct inode *, struct address_space *, loff_t, size_t);
 int ll_readahead(const struct lu_env *env, struct cl_io *io,
                 struct cl_page_list *queue, struct ll_readahead_state *ras,
                 bool hit);
@@ -799,36 +754,29 @@ int vvp_io_write_commit(const struct lu_env *env, struct cl_io *io);
 struct ll_cl_context *ll_cl_init(struct file *file, struct page *vmpage);
 void ll_cl_fini(struct ll_cl_context *lcc);
 
+#ifndef MS_HAS_NEW_AOPS
+extern const struct address_space_operations ll_aops;
+#else
+extern const struct address_space_operations_ext ll_aops;
+#endif
+
 /* llite/file.c */
 extern struct file_operations ll_file_operations;
 extern struct file_operations ll_file_operations_flock;
 extern struct file_operations ll_file_operations_noflock;
 extern struct inode_operations ll_file_inode_operations;
-extern int ll_inode_revalidate_it(struct dentry *, struct lookup_intent *,
-                                  __u64);
 extern int ll_have_md_lock(struct inode *inode, __u64 *bits,
                            ldlm_mode_t l_req_mode);
 extern ldlm_mode_t ll_take_md_lock(struct inode *inode, __u64 bits,
                                   struct lustre_handle *lockh, __u64 flags,
                                   ldlm_mode_t mode);
-int __ll_inode_revalidate_it(struct dentry *, struct lookup_intent *,
-                             __u64 bits);
-#ifdef HAVE_IOP_ATOMIC_OPEN
-int ll_revalidate_nd(struct dentry *dentry, unsigned int flags);
-#else
-int ll_revalidate_nd(struct dentry *dentry, struct nameidata *nd);
-#endif
+
 int ll_file_open(struct inode *inode, struct file *file);
 int ll_file_release(struct inode *inode, struct file *file);
 int ll_glimpse_ioctl(struct ll_sb_info *sbi,
                      struct lov_stripe_md *lsm, lstat_t *st);
 void ll_ioepoch_open(struct ll_inode_info *lli, __u64 ioepoch);
-int ll_local_open(struct file *file,
-                  struct lookup_intent *it, struct ll_file_data *fd,
-                  struct obd_client_handle *och);
 int ll_release_openhandle(struct dentry *, struct lookup_intent *);
-int ll_md_close(struct obd_export *md_exp, struct inode *inode,
-                struct file *file);
 int ll_md_real_close(struct inode *inode, fmode_t fmode);
 void ll_ioepoch_close(struct inode *inode, struct md_op_data *op_data,
                       struct obd_client_handle **och, unsigned long flags);
@@ -836,18 +784,13 @@ void ll_done_writing_attr(struct inode *inode, struct md_op_data *op_data);
 int ll_som_update(struct inode *inode, struct md_op_data *op_data);
 int ll_inode_getattr(struct inode *inode, struct obdo *obdo,
                      __u64 ioepoch, int sync);
-int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
-                  struct md_open_data **mod);
 void ll_pack_inode2opdata(struct inode *inode, struct md_op_data *op_data,
                           struct lustre_handle *fh);
 extern void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
                               struct ll_file_data *file, loff_t pos,
                               size_t count, int rw);
-int ll_getattr_it(struct vfsmount *mnt, struct dentry *de,
-               struct lookup_intent *it, struct kstat *stat);
 int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat);
-struct ll_file_data *ll_file_data_get(void);
-struct posix_acl * ll_get_acl(struct inode *inode, int type);
+struct posix_acl *ll_get_acl(struct inode *inode, int type);
 int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
               const char *name, int namelen);
 int ll_get_fid_by_name(struct inode *parent, const char *name,
@@ -880,28 +823,18 @@ int ll_fsync(struct file *file, int data);
 #else
 int ll_fsync(struct file *file, struct dentry *dentry, int data);
 #endif
-int ll_do_fiemap(struct inode *inode, struct ll_user_fiemap *fiemap,
-              int num_bytes);
 int ll_merge_lvb(const struct lu_env *env, struct inode *inode);
-int ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg);
-int ll_put_grouplock(struct inode *inode, struct file *file, unsigned long arg);
 int ll_fid2path(struct inode *inode, void *arg);
 int ll_data_version(struct inode *inode, __u64 *data_version, int flags);
 int ll_hsm_release(struct inode *inode);
 
-struct obd_client_handle *ll_lease_open(struct inode *inode, struct file *file,
-                                       fmode_t mode, __u64 flags);
-int ll_lease_close(struct obd_client_handle *och, struct inode *inode,
-                  bool *lease_broken);
-
 /* llite/dcache.c */
 
 int ll_d_init(struct dentry *de);
-extern struct dentry_operations ll_d_ops;
+extern const struct dentry_operations ll_d_ops;
 void ll_intent_drop_lock(struct lookup_intent *);
 void ll_intent_release(struct lookup_intent *);
 void ll_invalidate_aliases(struct inode *);
-void ll_frob_intent(struct lookup_intent **itp, struct lookup_intent *deft);
 void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry);
 int ll_revalidate_it_finish(struct ptlrpc_request *request,
                             struct lookup_intent *it, struct dentry *de);
@@ -909,13 +842,11 @@ int ll_revalidate_it_finish(struct ptlrpc_request *request,
 /* llite/llite_lib.c */
 extern struct super_operations lustre_super_operations;
 
-char *ll_read_opt(const char *opt, char *data);
 void ll_lli_init(struct ll_inode_info *lli);
 int ll_fill_super(struct super_block *sb, struct vfsmount *mnt);
 void ll_put_super(struct super_block *sb);
 void ll_kill_super(struct super_block *sb);
 struct inode *ll_inode_from_resource_lock(struct ldlm_lock *lock);
-struct inode *ll_inode_from_lock(struct ldlm_lock *lock);
 void ll_clear_inode(struct inode *inode);
 int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import);
 int ll_setattr(struct dentry *de, struct iattr *attr);
@@ -939,7 +870,6 @@ void ll_dirty_page_discard_warn(struct page *page, int ioret);
 int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
                  struct super_block *, struct lookup_intent *);
 void lustre_dump_dentry(struct dentry *, int recur);
-void lustre_dump_inode(struct inode *);
 int ll_obd_statfs(struct inode *inode, void *arg);
 int ll_get_max_mdsize(struct ll_sb_info *sbi, int *max_mdsize);
 int ll_get_default_mdsize(struct ll_sb_info *sbi, int *default_mdsize);
@@ -960,15 +890,6 @@ __u32 get_uuid2int(const char *name, int len);
 struct inode *search_inode_for_lustre(struct super_block *sb,
                                      const struct lu_fid *fid);
 
-/* llite/special.c */
-extern struct inode_operations ll_special_inode_operations;
-extern struct file_operations ll_special_chr_inode_fops;
-extern struct file_operations ll_special_chr_file_fops;
-extern struct file_operations ll_special_blk_inode_fops;
-extern struct file_operations ll_special_fifo_inode_fops;
-extern struct file_operations ll_special_fifo_file_fops;
-extern struct file_operations ll_special_sock_inode_fops;
-
 /* llite/symlink.c */
 extern struct inode_operations ll_fast_symlink_inode_operations;
 
@@ -1036,11 +957,6 @@ struct vvp_io {
          * Set when cui_bead has been initialized.
          */
         int                  cui_ra_window_set;
-        /**
-         * Partially truncated page, that vvp_io_trunc_start() keeps locked
-         * across truncate.
-         */
-        struct cl_page      *cui_partpage;
 };
 
 /**
@@ -1069,12 +985,9 @@ struct ll_cl_context {
         struct cl_page *lcc_page;
         struct lu_env  *lcc_env;
         int             lcc_refcheck;
-        int             lcc_created;
 };
 
 struct vvp_thread_info {
-        struct ost_lvb       vti_lvb;
-        struct cl_2queue     vti_queue;
         struct iovec         vti_local_iov;
         struct vvp_io_args   vti_args;
         struct ra_io_arg     vti_ria;
@@ -1121,25 +1034,17 @@ static inline struct vvp_io *vvp_env_io(const struct lu_env *env)
         return &vvp_env_session(env)->vs_ios;
 }
 
+int vvp_global_init(void);
+void vvp_global_fini(void);
+
 void ll_queue_done_writing(struct inode *inode, unsigned long flags);
 void ll_close_thread_shutdown(struct ll_close_queue *lcq);
 int ll_close_thread_start(struct ll_close_queue **lcq_ret);
 
 /* llite/llite_mmap.c */
-typedef struct rb_root  rb_root_t;
-typedef struct rb_node  rb_node_t;
-
-struct ll_lock_tree_node;
-struct ll_lock_tree {
-        rb_root_t                       lt_root;
-        cfs_list_t                      lt_locked_list;
-        struct ll_file_data            *lt_fd;
-};
 
 int ll_teardown_mmaps(struct address_space *mapping, __u64 first, __u64 last);
 int ll_file_mmap(struct file * file, struct vm_area_struct * vma);
-struct ll_lock_tree_node * ll_node_from_inode(struct inode *inode, __u64 start,
-                                              __u64 end, ldlm_mode_t mode);
 void policy_from_vma(ldlm_policy_data_t *policy,
                 struct vm_area_struct *vma, unsigned long addr, size_t count);
 struct vm_area_struct *our_vma(struct mm_struct *mm, unsigned long addr,
@@ -1227,7 +1132,6 @@ 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;
 
-cfs_hlist_head_t *alloc_rmtperm_hash(void);
 void free_rmtperm_hash(cfs_hlist_head_t *hash);
 int ll_update_remote_perm(struct inode *inode, struct mdt_remote_perm *perm);
 int lustre_check_remote_perm(struct inode *inode, int mask);
@@ -1240,7 +1144,6 @@ void ll_capa_thread_stop(void);
 void ll_capa_timer_callback(unsigned long unused);
 
 struct obd_capa *ll_add_capa(struct inode *inode, struct obd_capa *ocapa);
-int ll_update_capa(struct obd_capa *ocapa, struct lustre_capa *capa);
 
 void ll_capa_open(struct inode *inode);
 void ll_capa_close(struct inode *inode);
@@ -1260,14 +1163,11 @@ extern struct lu_device_type vvp_device_type;
  */
 int cl_sb_init(struct super_block *sb);
 int cl_sb_fini(struct super_block *sb);
-enum cl_lock_mode  vvp_mode_from_vma(struct vm_area_struct *vma);
-void ll_io_init(struct cl_io *io, const struct file *file, int write);
 
 void ras_update(struct ll_sb_info *sbi, struct inode *inode,
                 struct ll_readahead_state *ras, unsigned long index,
                 unsigned hit);
 void ll_ra_count_put(struct ll_sb_info *sbi, unsigned long len);
-int ll_is_file_contended(struct file *file);
 void ll_ra_stats_inc(struct inode *inode, enum ra_stat which);
 
 /* llite/llite_rmtacl.c */
@@ -1327,7 +1227,6 @@ struct ll_statahead_info {
         unsigned int            sai_skip_hidden;/* skipped hidden dentry count */
        unsigned int            sai_ls_all:1,   /* "ls -al", do stat-ahead for
                                                 * hidden entries */
-                               sai_in_readpage:1,/* statahead is in readdir()*/
                                sai_agl_valid:1;/* AGL is valid for the dir */
        wait_queue_head_t       sai_waitq;      /* stat-ahead wait queue */
        struct ptlrpc_thread    sai_thread;     /* stat-ahead thread */
@@ -1453,9 +1352,6 @@ typedef enum llioc_iter (*llioc_callback_t)(struct inode *inode,
                 struct file *file, unsigned int cmd, unsigned long arg,
                 void *magic, int *rcp);
 
-enum llioc_iter ll_iocontrol_call(struct inode *inode, struct file *file,
-                unsigned int cmd, unsigned long arg, int *rcp);
-
 /* export functions */
 /* Register ioctl block dynamatically for a regular file.
  *
index b32d795..40961da 100644 (file)
 
 struct kmem_cache *ll_file_data_slab;
 
-CFS_LIST_HEAD(ll_super_blocks);
-DEFINE_SPINLOCK(ll_sb_lock);
-
-#ifndef MS_HAS_NEW_AOPS
-extern struct address_space_operations ll_aops;
-#else
-extern struct address_space_operations_ext ll_aops;
-#endif
+static LIST_HEAD(ll_super_blocks);
+static DEFINE_SPINLOCK(ll_sb_lock);
 
 #ifndef log2
 #define log2(n) ffz(~(n))
@@ -147,7 +141,7 @@ static struct ll_sb_info *ll_init_sbi(void)
        RETURN(sbi);
 }
 
-void ll_free_sbi(struct super_block *sb)
+static void ll_free_sbi(struct super_block *sb)
 {
        struct ll_sb_info *sbi = ll_s2sbi(sb);
        ENTRY;
@@ -683,7 +677,7 @@ int ll_get_default_cookiesize(struct ll_sb_info *sbi, int *lmmsize)
        RETURN(rc);
 }
 
-void ll_dump_inode(struct inode *inode)
+static void ll_dump_inode(struct inode *inode)
 {
        struct ll_d_hlist_node *tmp;
        int dentry_count = 0;
@@ -728,7 +722,7 @@ void lustre_dump_dentry(struct dentry *dentry, int recur)
        }
 }
 
-void client_common_put_super(struct super_block *sb)
+static void client_common_put_super(struct super_block *sb)
 {
         struct ll_sb_info *sbi = ll_s2sbi(sb);
         ENTRY;
@@ -783,30 +777,6 @@ void ll_kill_super(struct super_block *sb)
        EXIT;
 }
 
-char *ll_read_opt(const char *opt, char *data)
-{
-        char *value;
-        char *retval;
-        ENTRY;
-
-        CDEBUG(D_SUPER, "option: %s, data %s\n", opt, data);
-        if (strncmp(opt, data, strlen(opt)))
-                RETURN(NULL);
-        if ((value = strchr(data, '=')) == NULL)
-                RETURN(NULL);
-
-        value++;
-        OBD_ALLOC(retval, strlen(value) + 1);
-        if (!retval) {
-                CERROR("out of memory!\n");
-                RETURN(NULL);
-        }
-
-        memcpy(retval, value, strlen(value)+1);
-        CDEBUG(D_SUPER, "Assigned option: %s, value %s\n", opt, retval);
-        RETURN(retval);
-}
-
 static inline int ll_set_opt(const char *opt, char *data, int fl)
 {
         if (strncmp(opt, data, strlen(opt)) != 0)
@@ -997,7 +967,6 @@ void ll_lli_init(struct ll_inode_info *lli)
                mutex_init(&lli->lli_readdir_mutex);
                lli->lli_opendir_key = NULL;
                lli->lli_sai = NULL;
-               lli->lli_def_acl = NULL;
                spin_lock_init(&lli->lli_sa_lock);
                lli->lli_opendir_pid = 0;
        } else {
@@ -1010,7 +979,6 @@ void ll_lli_init(struct ll_inode_info *lli)
                CFS_INIT_LIST_HEAD(&lli->lli_agl_list);
                lli->lli_agl_index = 0;
                lli->lli_async_rc = 0;
-               lli->lli_volatile = false;
        }
        mutex_init(&lli->lli_layout_mutex);
 }
@@ -1121,9 +1089,6 @@ out_free:
         RETURN(err);
 } /* ll_fill_super */
 
-
-void lu_context_keys_dump(void);
-
 void ll_put_super(struct super_block *sb)
 {
        struct config_llog_instance cfg, params_cfg;
@@ -1231,28 +1196,6 @@ struct inode *ll_inode_from_resource_lock(struct ldlm_lock *lock)
        return inode;
 }
 
-struct inode *ll_inode_from_lock(struct ldlm_lock *lock)
-{
-        struct inode *inode = NULL;
-        /* NOTE: we depend on atomic igrab() -bzzz */
-        lock_res_and_lock(lock);
-        if (lock->l_ast_data) {
-                struct ll_inode_info *lli = ll_i2info(lock->l_ast_data);
-                if (lli->lli_inode_magic == LLI_INODE_MAGIC) {
-                        inode = igrab(lock->l_ast_data);
-                } else {
-                        inode = lock->l_ast_data;
-                        LDLM_DEBUG_LIMIT(inode->i_state & I_FREEING ?  D_INFO :
-                                         D_WARNING, lock, "l_ast_data %p is "
-                                         "bogus: magic %08x", lock->l_ast_data,
-                                         lli->lli_inode_magic);
-                        inode = NULL;
-                }
-        }
-        unlock_res_and_lock(lock);
-        return inode;
-}
-
 static void ll_dir_clear_lsm_md(struct inode *inode)
 {
        struct ll_inode_info *lli = ll_i2info(inode);
index 085dc7e..3a24076 100644 (file)
 #include "llite_internal.h"
 #include <linux/lustre_compat25.h>
 
-struct page *ll_nopage(struct vm_area_struct *vma, unsigned long address,
-                       int *type);
-
-static struct vm_operations_struct ll_file_vm_ops;
+static const struct vm_operations_struct ll_file_vm_ops;
 
 void policy_from_vma(ldlm_policy_data_t *policy,
                             struct vm_area_struct *vma, unsigned long addr,
@@ -102,10 +99,10 @@ struct vm_area_struct *our_vma(struct mm_struct *mm, unsigned long addr,
  * \retval EINVAL if env can't allocated
  * \return other error codes from cl_io_init.
  */
-struct cl_io *ll_fault_io_init(struct vm_area_struct *vma,
-                              struct lu_env **env_ret,
-                              struct cl_env_nest *nest,
-                              pgoff_t index, unsigned long *ra_flags)
+static struct cl_io *
+ll_fault_io_init(struct vm_area_struct *vma, struct lu_env **env_ret,
+                struct cl_env_nest *nest, pgoff_t index,
+                unsigned long *ra_flags)
 {
        struct file            *file = vma->vm_file;
        struct inode           *inode = file->f_dentry->d_inode;
@@ -457,14 +454,6 @@ static void ll_vm_close(struct vm_area_struct *vma)
        EXIT;
 }
 
-/* return the user space pointer that maps to a file offset via a vma */
-static inline unsigned long file_to_user(struct vm_area_struct *vma, __u64 byte)
-{
-       return vma->vm_start +
-              (byte - ((__u64)vma->vm_pgoff << PAGE_CACHE_SHIFT));
-
-}
-
 /* XXX put nice comment here.  talk about __free_pte -> dirty pages and
  * nopage's reference passing to the pte */
 int ll_teardown_mmaps(struct address_space *mapping, __u64 first, __u64 last)
@@ -482,7 +471,7 @@ int ll_teardown_mmaps(struct address_space *mapping, __u64 first, __u64 last)
         RETURN(rc);
 }
 
-static struct vm_operations_struct ll_file_vm_ops = {
+static const struct vm_operations_struct ll_file_vm_ops = {
        .fault                  = ll_fault,
        .page_mkwrite           = ll_page_mkwrite,
        .open                   = ll_vm_open,
index 0e5c38f..55e3e6b 100644 (file)
@@ -123,9 +123,6 @@ struct lloop_device {
        loff_t               lo_offset;
        loff_t               lo_sizelimit;
        int                  lo_flags;
-       int                (*ioctl)(struct lloop_device *, int cmd,
-                                   unsigned long arg);
-
        struct file         *lo_backing_file;
        struct block_device *lo_device;
        unsigned             lo_blocksize;
@@ -522,7 +519,6 @@ static int loop_set_fd(struct lloop_device *lo, struct file *unused,
         lo->lo_device = bdev;
         lo->lo_flags = lo_flags;
         lo->lo_backing_file = file;
-        lo->ioctl = NULL;
         lo->lo_sizelimit = 0;
         lo->old_gfp_mask = mapping_gfp_mask(mapping);
         mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
@@ -581,7 +577,6 @@ static int loop_clr_fd(struct lloop_device *lo, struct block_device *bdev,
 
        down(&lo->lo_sem);
         lo->lo_backing_file = NULL;
-        lo->ioctl = NULL;
         lo->lo_device = NULL;
         lo->lo_offset = 0;
         lo->lo_sizelimit = 0;
index c716538..9937cdf 100644 (file)
 #include <obd_support.h>
 
 #include "llite_internal.h"
+#include "vvp_internal.h"
 
 struct proc_dir_entry *proc_lustre_fs_root;
 
 #ifdef LPROCFS
 /* /proc/lustre/llite mount point registration */
-extern struct file_operations vvp_dump_pgcache_file_ops;
 struct file_operations ll_rw_extents_stats_fops;
 struct file_operations ll_rw_extents_stats_pp_fops;
 struct file_operations ll_rw_offset_stats_fops;
@@ -888,7 +888,7 @@ struct lprocfs_seq_vars lprocfs_llite_obd_vars[] = {
 
 #define MAX_STRING_SIZE 128
 
-struct llite_file_opcode {
+static const struct llite_file_opcode {
         __u32       opcode;
         __u32       type;
         const char *opname;
index b47df73..d041fea 100644 (file)
@@ -58,8 +58,8 @@ static int ll_create_it(struct inode *, struct dentry *,
  * Check if we have something mounted at the named dchild.
  * In such a case there would always be dentry present.
  */
-int ll_d_mountpoint(struct dentry *dparent, struct dentry *dchild,
-                   struct qstr *name)
+static int ll_d_mountpoint(struct dentry *dparent, struct dentry *dchild,
+                          struct qstr *name)
 {
         int mounted = 0;
 
@@ -75,16 +75,6 @@ int ll_d_mountpoint(struct dentry *dparent, struct dentry *dchild,
         return mounted;
 }
 
-int ll_unlock(__u32 mode, struct lustre_handle *lockh)
-{
-        ENTRY;
-
-        ldlm_lock_decref(lockh, mode);
-
-        RETURN(0);
-}
-
-
 /* called from iget5_locked->find_inode() under inode_lock spinlock */
 static int ll_test_inode(struct inode *inode, void *opaque)
 {
@@ -454,12 +444,10 @@ struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de)
         return de;
 }
 
-int ll_lookup_it_finish(struct ptlrpc_request *request,
-                        struct lookup_intent *it, void *data)
+static int ll_lookup_it_finish(struct ptlrpc_request *request,
+                              struct lookup_intent *it,
+                              struct inode *parent, struct dentry **de)
 {
-       struct it_cb_data        *icbd = data;
-       struct dentry           **de = icbd->icbd_childp;
-       struct inode             *parent = icbd->icbd_parent;
        struct inode             *inode = NULL;
        __u64                     bits = 0;
        int                       rc;
@@ -535,7 +523,6 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
         struct dentry *save = dentry, *retval;
         struct ptlrpc_request *req = NULL;
         struct md_op_data *op_data;
-        struct it_cb_data icbd;
         __u32 opc;
         int rc;
         ENTRY;
@@ -550,7 +537,8 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
         if (d_mountpoint(dentry))
                 CERROR("Tell Peter, lookup on mtpt, it %s\n", LL_IT2STR(it));
 
-        ll_frob_intent(&it, &lookup_it);
+       if (it == NULL || it->it_op == IT_GETXATTR)
+               it = &lookup_it;
 
         if (it->it_op == IT_GETATTR) {
                 rc = ll_statahead_enter(parent, &dentry, 0);
@@ -561,9 +549,6 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
                 }
         }
 
-        icbd.icbd_childp = &dentry;
-        icbd.icbd_parent = parent;
-
        if (it->it_op & IT_CREAT)
                opc = LUSTRE_OPC_CREATE;
        else
@@ -585,7 +570,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
         if (rc < 0)
                 GOTO(out, retval = ERR_PTR(rc));
 
-        rc = ll_lookup_it_finish(req, it, &icbd);
+       rc = ll_lookup_it_finish(req, it, parent, &dentry);
         if (rc != 0) {
                 ll_intent_release(it);
                 GOTO(out, retval = ERR_PTR(rc));
@@ -721,8 +706,8 @@ out_release:
 }
 
 #else /* !HAVE_IOP_ATOMIC_OPEN */
-struct lookup_intent *ll_convert_intent(struct open_intent *oit,
-                                        int lookup_flags)
+static struct lookup_intent *
+ll_convert_intent(struct open_intent *oit, int lookup_flags)
 {
        struct lookup_intent *it;
 
@@ -814,10 +799,7 @@ static struct dentry *ll_lookup_nd(struct inode *parent, struct dentry *dentry,
 #endif /* HAVE_IOP_ATOMIC_OPEN */
 
 /* We depend on "mode" being set with the proper file type/umask by now */
-static struct inode *ll_create_node(struct inode *dir, const char *name,
-                                    int namelen, const void *data, int datalen,
-                                    int mode, __u64 extra,
-                                    struct lookup_intent *it)
+static struct inode *ll_create_node(struct inode *dir, struct lookup_intent *it)
 {
         struct inode *inode = NULL;
         struct ptlrpc_request *request = NULL;
@@ -877,14 +859,10 @@ static int ll_create_it(struct inode *dir, struct dentry *dentry, int mode,
        if (rc)
                RETURN(rc);
 
-       inode = ll_create_node(dir, dentry->d_name.name, dentry->d_name.len,
-                              NULL, 0, mode, 0, it);
+       inode = ll_create_node(dir, it);
        if (IS_ERR(inode))
                RETURN(PTR_ERR(inode));
 
-       if (filename_is_volatile(dentry->d_name.name, dentry->d_name.len, NULL))
-               ll_i2info(inode)->lli_volatile = true;
-
        d_instantiate(dentry, inode);
        RETURN(0);
 }
@@ -1401,7 +1379,7 @@ static int ll_rename(struct inode *old_dir, struct dentry *old_dentry,
         return err;
 }
 
-struct inode_operations ll_dir_inode_operations = {
+const struct inode_operations ll_dir_inode_operations = {
        .mknod              = ll_mknod,
 #ifdef HAVE_IOP_ATOMIC_OPEN
        .atomic_open        = ll_atomic_open,
@@ -1427,7 +1405,7 @@ struct inode_operations ll_dir_inode_operations = {
 #endif
 };
 
-struct inode_operations ll_special_inode_operations = {
+const struct inode_operations ll_special_inode_operations = {
        .setattr        = ll_setattr,
        .getattr        = ll_getattr,
        .permission     = ll_inode_permission,
index 038a766..d155960 100644 (file)
@@ -78,7 +78,7 @@ static inline void free_ll_remote_perm(struct ll_remote_perm *lrp)
         OBD_SLAB_FREE(lrp, ll_remote_perm_cachep, sizeof(*lrp));
 }
 
-cfs_hlist_head_t *alloc_rmtperm_hash(void)
+static struct hlist_head *alloc_rmtperm_hash(void)
 {
         cfs_hlist_head_t *hash;
         int i;
index 361dfca..da6bd6d 100644 (file)
@@ -80,12 +80,6 @@ void ll_cl_fini(struct ll_cl_context *lcc)
                 cl_page_put(env, page);
         }
 
-        if (io && lcc->lcc_created) {
-                cl_io_end(env, io);
-                cl_io_unlock(env, io);
-                cl_io_iter_fini(env, io);
-                cl_io_fini(env, io);
-        }
         cl_env_put(env, &lcc->lcc_refcheck);
 }
 
index 64a06f9..24414c9 100644 (file)
@@ -687,12 +687,12 @@ static int ll_write_end(struct file *file, struct address_space *mapping,
 }
 
 #ifdef CONFIG_MIGRATION
-int ll_migratepage(struct address_space *mapping,
-               struct page *newpage, struct page *page
+static int ll_migratepage(struct address_space *mapping,
+                         struct page *newpage, struct page *page
 #ifdef HAVE_MIGRATEPAGE_4ARGS
-               , enum migrate_mode mode
+                         , enum migrate_mode mode
 #endif
-               )
+       )
 {
         /* Always fail page migration until we have a proper implementation */
         return -EIO;
@@ -700,9 +700,8 @@ int ll_migratepage(struct address_space *mapping,
 #endif
 
 #ifndef MS_HAS_NEW_AOPS
-struct address_space_operations ll_aops = {
-        .readpage       = ll_readpage,
-//        .readpages      = ll_readpages,
+const struct address_space_operations ll_aops = {
+       .readpage       = ll_readpage,
         .direct_IO      = ll_direct_IO_26,
         .writepage      = ll_writepage,
        .writepages     = ll_writepages,
@@ -714,10 +713,9 @@ struct address_space_operations ll_aops = {
 #ifdef CONFIG_MIGRATION
         .migratepage    = ll_migratepage,
 #endif
-        .bmap           = NULL
 };
 #else
-struct address_space_operations_ext ll_aops = {
+const struct address_space_operations_ext ll_aops = {
        .orig_aops.readpage             = ll_readpage,
        .orig_aops.direct_IO            = ll_direct_IO_26,
        .orig_aops.writepage            = ll_writepage,
@@ -728,7 +726,6 @@ struct address_space_operations_ext ll_aops = {
 #ifdef CONFIG_MIGRATION
        .orig_aops.migratepage          = ll_migratepage,
 #endif
-       .orig_aops.bmap                 = NULL,
        .write_begin                    = ll_write_begin,
        .write_end                      = ll_write_end
 };
index 9668c3c..49cd27c 100644 (file)
@@ -1546,12 +1546,6 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,
                         RETURN(entry ? 1 : -EAGAIN);
                 }
 
-               /* if statahead is busy in readdir, help it do post-work */
-                while (!ll_sa_entry_stated(entry) &&
-                       sai->sai_in_readpage &&
-                       !sa_received_empty(sai))
-                       ll_post_statahead(sai);
-
                 if (!ll_sa_entry_stated(entry)) {
                         sai->sai_index_wait = entry->se_index;
                         lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(30), NULL,
index 47d5163..0a354c8 100644 (file)
@@ -81,7 +81,7 @@ static void ll_destroy_inode(struct inode *inode)
 }
 #endif
 
-int ll_init_inodecache(void)
+static int ll_init_inodecache(void)
 {
        ll_inode_cachep = kmem_cache_create("lustre_inode_cache",
                                            sizeof(struct ll_inode_info),
@@ -91,7 +91,7 @@ int ll_init_inodecache(void)
        return 0;
 }
 
-void ll_destroy_inodecache(void)
+static void ll_destroy_inodecache(void)
 {
        kmem_cache_destroy(ll_inode_cachep);
 }
@@ -117,9 +117,6 @@ struct super_operations lustre_super_operations =
 
 void lustre_register_client_process_config(int (*cpc)(struct lustre_cfg *lcfg));
 
-int vvp_global_init(void);
-void vvp_global_fini(void);
-
 static int __init init_lustre_lite(void)
 {
        int i, rc, seed[2];
index e4cda52..6a36808 100644 (file)
@@ -47,7 +47,7 @@
 
 #include <obd.h>
 #include <lustre_lite.h>
-
+#include "llite_internal.h"
 #include "vvp_internal.h"
 
 /*****************************************************************************
@@ -61,7 +61,7 @@
  * "llite_" (var. "ll_") prefix.
  */
 
-struct kmem_cache *vvp_thread_kmem;
+static struct kmem_cache *vvp_thread_kmem;
 static struct kmem_cache *vvp_session_kmem;
 static struct lu_kmem_descr vvp_caches[] = {
         {
@@ -537,7 +537,7 @@ static int vvp_dump_pgcache_seq_open(struct inode *inode, struct file *filp)
        return result;
 }
 
-struct file_operations vvp_dump_pgcache_file_ops = {
+const struct file_operations vvp_dump_pgcache_file_ops = {
         .owner   = THIS_MODULE,
         .open    = vvp_dump_pgcache_seq_open,
         .read    = seq_read,
index 4b907b1..b6b749e 100644 (file)
@@ -59,6 +59,6 @@ struct lu_object *vvp_object_alloc(const struct lu_env *env,
                                   struct lu_device *dev);
 struct ccc_object *cl_inode2ccc(struct inode *inode);
 
-extern struct kmem_cache *vvp_thread_kmem;
+extern const struct file_operations vvp_dump_pgcache_file_ops;
 
 #endif /* VVP_INTERNAL_H */
index 724a3f5..9a464f2 100644 (file)
@@ -215,7 +215,7 @@ static void vvp_io_fault_fini(const struct lu_env *env,
         vvp_io_fini(env, ios);
 }
 
-enum cl_lock_mode vvp_mode_from_vma(struct vm_area_struct *vma)
+static enum cl_lock_mode vvp_mode_from_vma(struct vm_area_struct *vma)
 {
         /*
          * we only want to hold PW locks if the mmap() can generate
index 9ee04b7..35262e1 100644 (file)
@@ -123,8 +123,8 @@ static int vvp_attr_set(const struct lu_env *env, struct cl_object *obj,
        return 0;
 }
 
-int vvp_conf_set(const struct lu_env *env, struct cl_object *obj,
-               const struct cl_object_conf *conf)
+static int vvp_conf_set(const struct lu_env *env, struct cl_object *obj,
+                       const struct cl_object_conf *conf)
 {
        struct ll_inode_info *lli = ll_i2info(conf->coc_inode);
 
index fd32da0..9ef62c5 100644 (file)
@@ -255,7 +255,7 @@ static int ll_xattr_cache_list(struct list_head *cache,
  * \retval 0 @cache is not initialized
  * \retval 1 @cache is initialized
  */
-int ll_xattr_cache_valid(struct ll_inode_info *lli)
+static int ll_xattr_cache_valid(struct ll_inode_info *lli)
 {
        return !!(lli->lli_flags & LLIF_XATTR_CACHE);
 }