Commit acda5261 authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman

staging/lustre/lov: remove unused OBD methods

Remove the unused OBD device methods:
    lov_brw()
    lov_cancel()
    lov_cancel_unused()
    lov_change_cbdata()
    lov_enqueue()
    lov_extent_calc()
    lov_getattr()
    lov_merge_lvb()
    lov_punch()
    lov_setattr()
    lov_sync()
and their supporting functions.

In lov_iocontrol() remove the unused cases LL_IOC_LOV_SETSTRIPE and
LL_IOC_LOV_SETEA and their supporting functions.
Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8fa74ef2
...@@ -168,8 +168,6 @@ static inline void lov_llh_put(struct lov_lock_handles *llh) ...@@ -168,8 +168,6 @@ static inline void lov_llh_put(struct lov_lock_handles *llh)
/* lov_merge.c */ /* lov_merge.c */
void lov_merge_attrs(struct obdo *tgt, struct obdo *src, u64 valid, void lov_merge_attrs(struct obdo *tgt, struct obdo *src, u64 valid,
struct lov_stripe_md *lsm, int stripeno, int *set); struct lov_stripe_md *lsm, int stripeno, int *set);
int lov_merge_lvb(struct obd_export *exp, struct lov_stripe_md *lsm,
struct ost_lvb *lvb, int kms_only);
int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm, int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm,
u64 size, int shrink); u64 size, int shrink);
int lov_merge_lvb_kms(struct lov_stripe_md *lsm, int lov_merge_lvb_kms(struct lov_stripe_md *lsm,
...@@ -207,17 +205,6 @@ void lov_update_set(struct lov_request_set *set, ...@@ -207,17 +205,6 @@ void lov_update_set(struct lov_request_set *set,
int lov_update_common_set(struct lov_request_set *set, int lov_update_common_set(struct lov_request_set *set,
struct lov_request *req, int rc); struct lov_request *req, int rc);
int lov_check_and_wait_active(struct lov_obd *lov, int ost_idx); int lov_check_and_wait_active(struct lov_obd *lov, int ost_idx);
int lov_prep_create_set(struct obd_export *exp, struct obd_info *oifo,
struct lov_stripe_md **ea, struct obdo *src_oa,
struct obd_trans_info *oti,
struct lov_request_set **reqset);
int cb_create_update(void *cookie, int rc);
int lov_fini_create_set(struct lov_request_set *set, struct lov_stripe_md **ea);
int lov_prep_brw_set(struct obd_export *exp, struct obd_info *oinfo,
u32 oa_bufs, struct brw_page *pga,
struct obd_trans_info *oti,
struct lov_request_set **reqset);
int lov_fini_brw_set(struct lov_request_set *set);
int lov_prep_getattr_set(struct obd_export *exp, struct obd_info *oinfo, int lov_prep_getattr_set(struct obd_export *exp, struct obd_info *oinfo,
struct lov_request_set **reqset); struct lov_request_set **reqset);
int lov_fini_getattr_set(struct lov_request_set *set); int lov_fini_getattr_set(struct lov_request_set *set);
...@@ -225,8 +212,6 @@ int lov_prep_destroy_set(struct obd_export *exp, struct obd_info *oinfo, ...@@ -225,8 +212,6 @@ int lov_prep_destroy_set(struct obd_export *exp, struct obd_info *oinfo,
struct obdo *src_oa, struct lov_stripe_md *lsm, struct obdo *src_oa, struct lov_stripe_md *lsm,
struct obd_trans_info *oti, struct obd_trans_info *oti,
struct lov_request_set **reqset); struct lov_request_set **reqset);
int lov_update_destroy_set(struct lov_request_set *set,
struct lov_request *req, int rc);
int lov_fini_destroy_set(struct lov_request_set *set); int lov_fini_destroy_set(struct lov_request_set *set);
int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo, int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo,
struct obd_trans_info *oti, struct obd_trans_info *oti,
...@@ -234,30 +219,6 @@ int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo, ...@@ -234,30 +219,6 @@ int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo,
int lov_update_setattr_set(struct lov_request_set *set, int lov_update_setattr_set(struct lov_request_set *set,
struct lov_request *req, int rc); struct lov_request *req, int rc);
int lov_fini_setattr_set(struct lov_request_set *set); int lov_fini_setattr_set(struct lov_request_set *set);
int lov_prep_punch_set(struct obd_export *exp, struct obd_info *oinfo,
struct obd_trans_info *oti,
struct lov_request_set **reqset);
int lov_fini_punch_set(struct lov_request_set *set);
int lov_prep_sync_set(struct obd_export *exp, struct obd_info *obd_info,
u64 start, u64 end,
struct lov_request_set **reqset);
int lov_fini_sync_set(struct lov_request_set *set);
int lov_prep_enqueue_set(struct obd_export *exp, struct obd_info *oinfo,
struct ldlm_enqueue_info *einfo,
struct lov_request_set **reqset);
int lov_fini_enqueue_set(struct lov_request_set *set, __u32 mode, int rc,
struct ptlrpc_request_set *rqset);
int lov_prep_match_set(struct obd_export *exp, struct obd_info *oinfo,
struct lov_stripe_md *lsm,
ldlm_policy_data_t *policy, __u32 mode,
struct lustre_handle *lockh,
struct lov_request_set **reqset);
int lov_fini_match_set(struct lov_request_set *set, __u32 mode, __u64 flags);
int lov_prep_cancel_set(struct obd_export *exp, struct obd_info *oinfo,
struct lov_stripe_md *lsm,
__u32 mode, struct lustre_handle *lockh,
struct lov_request_set **reqset);
int lov_fini_cancel_set(struct lov_request_set *set);
int lov_prep_statfs_set(struct obd_device *obd, struct obd_info *oinfo, int lov_prep_statfs_set(struct obd_device *obd, struct obd_info *oinfo,
struct lov_request_set **reqset); struct lov_request_set **reqset);
void lov_update_statfs(struct obd_statfs *osfs, struct obd_statfs *lov_sfs, void lov_update_statfs(struct obd_statfs *osfs, struct obd_statfs *lov_sfs,
...@@ -287,10 +248,6 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmm, ...@@ -287,10 +248,6 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmm,
struct lov_stripe_md *lsm); struct lov_stripe_md *lsm);
int lov_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp, int lov_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
struct lov_mds_md *lmm, int lmm_bytes); struct lov_mds_md *lmm, int lmm_bytes);
int lov_setstripe(struct obd_export *exp, int max_lmm_size,
struct lov_stripe_md **lsmp, struct lov_user_md *lump);
int lov_setea(struct obd_export *exp, struct lov_stripe_md **lsmp,
struct lov_user_md *lump);
int lov_getstripe(struct obd_export *exp, int lov_getstripe(struct obd_export *exp,
struct lov_stripe_md *lsm, struct lov_user_md *lump); struct lov_stripe_md *lsm, struct lov_user_md *lump);
int lov_alloc_memmd(struct lov_stripe_md **lsmp, __u16 stripe_count, int lov_alloc_memmd(struct lov_stripe_md **lsmp, __u16 stripe_count,
...@@ -307,8 +264,6 @@ struct lov_stripe_md *lsm_alloc_plain(__u16 stripe_count, int *size); ...@@ -307,8 +264,6 @@ struct lov_stripe_md *lsm_alloc_plain(__u16 stripe_count, int *size);
void lsm_free_plain(struct lov_stripe_md *lsm); void lsm_free_plain(struct lov_stripe_md *lsm);
void dump_lsm(unsigned int level, const struct lov_stripe_md *lsm); void dump_lsm(unsigned int level, const struct lov_stripe_md *lsm);
int lovea_destroy_object(struct lov_obd *lov, struct lov_stripe_md *lsm,
struct obdo *oa, void *data);
/* lproc_lov.c */ /* lproc_lov.c */
#if defined (CONFIG_PROC_FS) #if defined (CONFIG_PROC_FS)
extern const struct file_operations lov_proc_target_fops; extern const struct file_operations lov_proc_target_fops;
......
...@@ -109,33 +109,6 @@ int lov_merge_lvb_kms(struct lov_stripe_md *lsm, ...@@ -109,33 +109,6 @@ int lov_merge_lvb_kms(struct lov_stripe_md *lsm,
return rc; return rc;
} }
/** Merge the lock value block(&lvb) attributes from each of the stripes in a
* file into a single lvb. It is expected that the caller initializes the
* current atime, mtime, ctime to avoid regressing a more uptodate time on
* the local client.
*
* If \a kms_only is set then we do not consider the recently seen size (rss)
* when updating the known minimum size (kms). Even when merging RSS, we will
* take the KMS value if it's larger. This prevents getattr from stomping on
* dirty cached pages which extend the file size. */
int lov_merge_lvb(struct obd_export *exp,
struct lov_stripe_md *lsm, struct ost_lvb *lvb, int kms_only)
{
int rc;
__u64 kms;
lov_stripe_lock(lsm);
rc = lov_merge_lvb_kms(lsm, lvb, &kms);
lov_stripe_unlock(lsm);
if (kms_only)
lvb->lvb_size = kms;
CDEBUG(D_INODE, "merged for ID "DOSTID" s=%llu m=%llu a=%llu c=%llu b=%llu\n",
POSTID(&lsm->lsm_oi), lvb->lvb_size, lvb->lvb_mtime,
lvb->lvb_atime, lvb->lvb_ctime, lvb->lvb_blocks);
return rc;
}
/* Must be called under the lov_stripe_lock() */ /* Must be called under the lov_stripe_lock() */
int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm, int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm,
u64 size, int shrink) u64 size, int shrink)
......
This diff is collapsed.
...@@ -403,178 +403,6 @@ int lov_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp, ...@@ -403,178 +403,6 @@ int lov_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
return lsm_size; return lsm_size;
} }
static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
struct lov_stripe_md **lsmp,
struct lov_user_md *lump)
{
struct obd_device *obd = class_exp2obd(exp);
struct lov_obd *lov = &obd->u.lov;
char buffer[sizeof(struct lov_user_md_v3)];
struct lov_user_md_v3 *lumv3 = (struct lov_user_md_v3 *)&buffer[0];
struct lov_user_md_v1 *lumv1 = (struct lov_user_md_v1 *)&buffer[0];
int lmm_magic;
__u16 stripe_count;
int rc;
int cplen = 0;
rc = lov_lum_swab_if_needed(lumv3, &lmm_magic, lump);
if (rc)
return rc;
/* in the rest of the tests, as *lumv1 and lumv3 have the same
* fields, we use lumv1 to avoid code duplication */
if (lumv1->lmm_pattern == 0) {
lumv1->lmm_pattern = lov->desc.ld_pattern ?
lov->desc.ld_pattern : LOV_PATTERN_RAID0;
}
if (lov_pattern(lumv1->lmm_pattern) != LOV_PATTERN_RAID0) {
CDEBUG(D_IOCTL, "bad userland stripe pattern: %#x\n",
lumv1->lmm_pattern);
return -EINVAL;
}
/* 64kB is the largest common page size we see (ia64), and matches the
* check in lfs */
if (lumv1->lmm_stripe_size & (LOV_MIN_STRIPE_SIZE - 1)) {
CDEBUG(D_IOCTL, "stripe size %u not multiple of %u, fixing\n",
lumv1->lmm_stripe_size, LOV_MIN_STRIPE_SIZE);
lumv1->lmm_stripe_size = LOV_MIN_STRIPE_SIZE;
}
if ((lumv1->lmm_stripe_offset >= lov->desc.ld_tgt_count) &&
(lumv1->lmm_stripe_offset !=
(typeof(lumv1->lmm_stripe_offset))(-1))) {
CDEBUG(D_IOCTL, "stripe offset %u > number of OSTs %u\n",
lumv1->lmm_stripe_offset, lov->desc.ld_tgt_count);
return -EINVAL;
}
stripe_count = lov_get_stripecnt(lov, lmm_magic,
lumv1->lmm_stripe_count);
if (max_lmm_size) {
int max_stripes = (max_lmm_size -
lov_mds_md_size(0, lmm_magic)) /
sizeof(struct lov_ost_data_v1);
if (unlikely(max_stripes < stripe_count)) {
CDEBUG(D_IOCTL, "stripe count reset from %d to %d\n",
stripe_count, max_stripes);
stripe_count = max_stripes;
}
}
if (lmm_magic == LOV_USER_MAGIC_V3) {
struct pool_desc *pool;
/* In the function below, .hs_keycmp resolves to
* pool_hashkey_keycmp() */
/* coverity[overrun-buffer-val] */
pool = lov_find_pool(lov, lumv3->lmm_pool_name);
if (pool != NULL) {
if (lumv3->lmm_stripe_offset !=
(typeof(lumv3->lmm_stripe_offset))(-1)) {
rc = lov_check_index_in_pool(
lumv3->lmm_stripe_offset, pool);
if (rc < 0) {
lov_pool_putref(pool);
return -EINVAL;
}
}
if (stripe_count > pool_tgt_count(pool))
stripe_count = pool_tgt_count(pool);
lov_pool_putref(pool);
}
}
if (lumv1->lmm_pattern & LOV_PATTERN_F_RELEASED)
stripe_count = 0;
rc = lov_alloc_memmd(lsmp, stripe_count, lumv1->lmm_pattern, lmm_magic);
if (rc >= 0) {
(*lsmp)->lsm_oinfo[0]->loi_ost_idx = lumv1->lmm_stripe_offset;
(*lsmp)->lsm_stripe_size = lumv1->lmm_stripe_size;
if (lmm_magic == LOV_USER_MAGIC_V3) {
cplen = strlcpy((*lsmp)->lsm_pool_name,
lumv3->lmm_pool_name,
sizeof((*lsmp)->lsm_pool_name));
if (cplen >= sizeof((*lsmp)->lsm_pool_name))
rc = -E2BIG;
}
rc = 0;
}
return rc;
}
/* Configure object striping information on a new file.
*
* @lmmu is a pointer to a user struct with one or more of the fields set to
* indicate the application preference: lmm_stripe_count, lmm_stripe_size,
* lmm_stripe_offset, and lmm_stripe_pattern. lmm_magic must be LOV_MAGIC.
* @lsmp is a pointer to an in-core stripe MD that needs to be filled in.
*/
int lov_setstripe(struct obd_export *exp, int max_lmm_size,
struct lov_stripe_md **lsmp, struct lov_user_md *lump)
{
int rc;
mm_segment_t seg;
seg = get_fs();
set_fs(KERNEL_DS);
rc = __lov_setstripe(exp, max_lmm_size, lsmp, lump);
set_fs(seg);
return rc;
}
int lov_setea(struct obd_export *exp, struct lov_stripe_md **lsmp,
struct lov_user_md *lump)
{
int i;
int rc;
struct obd_export *oexp;
struct lov_obd *lov = &exp->exp_obd->u.lov;
u64 last_id = 0;
struct lov_user_ost_data_v1 *lmm_objects;
if (lump->lmm_magic == LOV_USER_MAGIC_V3)
lmm_objects = ((struct lov_user_md_v3 *)lump)->lmm_objects;
else
lmm_objects = lump->lmm_objects;
for (i = 0; i < lump->lmm_stripe_count; i++) {
__u32 len = sizeof(last_id);
oexp = lov->lov_tgts[lmm_objects[i].l_ost_idx]->ltd_exp;
rc = obd_get_info(NULL, oexp, sizeof(KEY_LAST_ID), KEY_LAST_ID,
&len, &last_id, NULL);
if (rc)
return rc;
if (ostid_id(&lmm_objects[i].l_ost_oi) > last_id) {
CERROR("Setting EA for object > than last id on"
" ost idx %d "DOSTID" > %lld \n",
lmm_objects[i].l_ost_idx,
POSTID(&lmm_objects[i].l_ost_oi), last_id);
return -EINVAL;
}
}
rc = lov_setstripe(exp, 0, lsmp, lump);
if (rc)
return rc;
for (i = 0; i < lump->lmm_stripe_count; i++) {
(*lsmp)->lsm_oinfo[i]->loi_ost_idx =
lmm_objects[i].l_ost_idx;
(*lsmp)->lsm_oinfo[i]->loi_oi = lmm_objects[i].l_ost_oi;
}
return 0;
}
/* Retrieve object striping information. /* Retrieve object striping information.
* *
* @lump is a pointer to an in-core struct with lmm_ost_count indicating * @lump is a pointer to an in-core struct with lmm_ost_count indicating
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment