Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d95f10e authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman
Browse files

staging/lustre/llite: remove dead code



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: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-on: http://review.whamcloud.com/9767
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675


Reviewed-by: default avatarLai Siyao <lai.siyao@intel.com>
Reviewed-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2c580836
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@

#include "../llite/llite_internal.h"

const struct cl_req_operations ccc_req_ops;
static const struct cl_req_operations ccc_req_ops;

/*
 * ccc_ prefix stands for "Common Client Code".
@@ -962,7 +962,7 @@ void ccc_req_attr_set(const struct lu_env *env,
	       JOBSTATS_JOBID_SIZE);
}

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
};
+9 −17
Original line number Diff line number Diff line
@@ -69,8 +69,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);
}
@@ -82,8 +81,9 @@ static void ll_release(struct dentry *de)
 * an AST before calling d_revalidate_it().  The dentry still exists (marked
 * INVALID) so d_lookup() matches it, but we have no lock on it (so
 * lock_match() fails) and we spin around real_lookup(). */
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)
{
	if (len != name->len)
		return 1;
@@ -239,6 +239,7 @@ void ll_intent_release(struct lookup_intent *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 */

	if (it_disposition(it, DISP_ENQ_CREATE_REF)) /* create rec */
		ptlrpc_req_finished(it->d.lustre.it_data);

@@ -316,15 +317,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)
{
@@ -356,7 +348,7 @@ static int ll_revalidate_dentry(struct dentry *dentry,
/*
 * Always trust cached dentries. Update statahead window if necessary.
 */
int ll_revalidate_nd(struct dentry *dentry, unsigned int flags)
static int ll_revalidate_nd(struct dentry *dentry, unsigned int flags)
{
	int rc;

@@ -368,7 +360,7 @@ int ll_revalidate_nd(struct dentry *dentry, unsigned int flags)
}


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))
@@ -376,7 +368,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,
+4 −4
Original line number Diff line number Diff line
@@ -632,7 +632,7 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx)
	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;
@@ -1964,17 +1964,17 @@ static loff_t ll_dir_seek(struct file *file, loff_t offset, int origin)
	return ret;
}

int ll_dir_open(struct inode *inode, struct file *file)
static int ll_dir_open(struct inode *inode, struct file *file)
{
	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)
{
	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,
+46 −43
Original line number Diff line number Diff line
@@ -50,7 +50,17 @@

#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;

@@ -247,7 +257,7 @@ 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,
static int ll_md_close(struct obd_export *md_exp, struct inode *inode,
		       struct file *file)
{
	struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
@@ -482,7 +492,7 @@ 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,
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;
@@ -733,8 +743,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);
@@ -862,13 +873,12 @@ struct obd_client_handle *ll_lease_open(struct inode *inode, struct file *file,
	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,
static int ll_lease_close(struct obd_client_handle *och, struct inode *inode,
			  bool *lease_broken)
{
	struct ldlm_lock *lock;
@@ -895,7 +905,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,
@@ -1590,7 +1599,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);
@@ -1710,7 +1720,7 @@ int ll_release_openhandle(struct dentry *dentry, struct lookup_intent *it)
 * 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,
static int ll_do_fiemap(struct inode *inode, struct ll_user_fiemap *fiemap,
			int num_bytes)
{
	struct obd_export *exp = ll_i2dtexp(inode);
@@ -2190,7 +2200,8 @@ static int ll_hsm_import(struct inode *inode, struct file *file,
	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);
@@ -2509,7 +2520,7 @@ long ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
}


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;
@@ -2533,7 +2544,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);
@@ -2670,7 +2681,8 @@ int ll_fsync(struct file *file, loff_t start, loff_t end, 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);
@@ -2799,7 +2811,8 @@ int ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
	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)
{
	return -ENOSYS;
}
@@ -2891,8 +2904,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;
@@ -2987,13 +2999,12 @@ int __ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
	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;
	int rc;

	rc = __ll_inode_revalidate_it(dentry, it, ibits);
	rc = __ll_inode_revalidate(dentry, ibits);
	if (rc != 0)
		return rc;

@@ -3016,15 +3027,14 @@ 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 |
	res = ll_inode_revalidate(de, MDS_INODELOCK_UPDATE |
				      MDS_INODELOCK_LOOKUP);
	ll_stats_ops_tally(sbi, LPROC_LL_GETATTR, 1);

@@ -3051,14 +3061,8 @@ 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,
static int ll_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
		     __u64 start, __u64 len)
{
	int rc;
@@ -3118,9 +3122,7 @@ int ll_inode_permission(struct inode *inode, int mask)
	* 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,
		rc = __ll_inode_revalidate(inode->i_sb->s_root,
					   MDS_INODELOCK_LOOKUP);
		if (rc)
			return rc;
@@ -3273,7 +3275,8 @@ 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,
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;
+3 −1
Original line number Diff line number Diff line
@@ -68,6 +68,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) ||
@@ -515,7 +517,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;
Loading