From 4f7389646f60f5fe3cd030570d9ec803e4f749c4 Mon Sep 17 00:00:00 2001 From: yury Date: Mon, 15 Nov 2004 07:24:19 +0000 Subject: [PATCH] - fixes about lmv_delete_inode(). --- lustre/include/linux/obd.h | 2 +- lustre/include/linux/obd_class.h | 10 +++++----- lustre/llite/llite_internal.h | 2 +- lustre/llite/llite_lib.c | 19 +++++++------------ lustre/llite/namei.c | 4 ++-- lustre/llite/super.c | 2 +- lustre/lmv/lmv_obd.c | 12 +++--------- lustre/tests/createmany.c | 6 +++--- 8 files changed, 23 insertions(+), 34 deletions(-) diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index 9ba9ec6..96106d7 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -889,7 +889,7 @@ struct md_ops { int repoff); int (*m_set_lock_data)(struct obd_export *exp, __u64 *l, void *data); - int (*m_put_inode)(struct obd_export *, struct lustre_id *); + int (*m_delete_inode)(struct obd_export *, struct lustre_id *); /* NOTE: If adding ops, add another LPROCFS_OBD_OP_INIT() line to * lprocfs_alloc_obd_stats() in obdclass/lprocfs_status.c. Also, add a diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index 070e7d9..c1a0d5b 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -1213,17 +1213,17 @@ static inline int md_getstatus(struct obd_export *exp, struct lustre_id *id) RETURN(rc); } -static inline int md_put_inode(struct obd_export *exp, - struct lustre_id *id) +static inline int md_delete_inode(struct obd_export *exp, + struct lustre_id *id) { int rc; ENTRY; - if (MDP(exp->exp_obd, put_inode) == NULL) + if (MDP(exp->exp_obd, delete_inode) == NULL) RETURN(0); - MD_COUNTER_INCREMENT(exp->exp_obd, put_inode); - rc = MDP(exp->exp_obd, put_inode)(exp, id); + MD_COUNTER_INCREMENT(exp->exp_obd, delete_inode); + rc = MDP(exp->exp_obd, delete_inode)(exp, id); RETURN(rc); } diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 8bb7439..781d122 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -259,7 +259,7 @@ void ll_update_inode(struct inode *inode, struct lustre_md *); int it_disposition(struct lookup_intent *it, int flag); void it_set_disposition(struct lookup_intent *it, int flag); void ll_read_inode2(struct inode *inode, void *opaque); -void ll_put_inode(struct inode *inode); +void ll_delete_inode(struct inode *inode); int ll_iocontrol(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); void ll_umount_begin(struct super_block *sb); diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index fd5686c..ab0f300 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1374,27 +1374,22 @@ void ll_read_inode2(struct inode *inode, void *opaque) } } -void ll_put_inode(struct inode *inode) +void ll_delete_inode(struct inode *inode) { struct ll_sb_info *sbi = ll_i2sbi(inode); struct lustre_id id; int rc; ENTRY; - /* - * notifying metadata target that any in memory data assosiated - * with object @id should be removed. - */ - if (atomic_read(&inode->i_count) == 1) { - ll_inode2id(&id, inode); + ll_inode2id(&id, inode); - rc = md_put_inode(sbi->ll_lmv_exp, &id); - if (rc) { - CERROR("md_put_inode() failed, error %d\n", - rc); - } + rc = md_delete_inode(sbi->ll_lmv_exp, &id); + if (rc) { + CERROR("md_delete_inode() failed, error %d\n", + rc); } + clear_inode(inode); EXIT; } diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index f0e5ae1..00824b7 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -562,8 +562,8 @@ static int ll_mknod_raw(struct nameidata *nd, int mode, dev_t rdev) RETURN(err); } -static int ll_mknod(struct inode *dir, struct dentry *child, int mode, - ll_dev_t rdev) +static int ll_mknod(struct inode *dir, struct dentry *child, + int mode, ll_dev_t rdev) { struct ptlrpc_request *request = NULL; struct inode *inode = NULL; diff --git a/lustre/llite/super.c b/lustre/llite/super.c index 8598572..fcb89b0 100644 --- a/lustre/llite/super.c +++ b/lustre/llite/super.c @@ -80,7 +80,7 @@ struct super_operations lustre_super_operations = { .read_inode2 = ll_read_inode2, .clear_inode = ll_clear_inode, - .put_inode = ll_put_inode, + .delete_inode = ll_delete_inode, .put_super = lustre_put_super, .statfs = ll_statfs, .umount_begin = ll_umount_begin, diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index f9cd542..0e5bd5d 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -1467,16 +1467,10 @@ int lmv_unlink_slaves(struct obd_export *exp, struct mdc_op_data *data, RETURN(rc); } -/* - * commented for a while, as it will not work in the case when splitted dir is - * created from ll_mkdir_stripe(), because mds_reint_create() returns 0 inthis - * case even if there is created splitted dir with passed number of stripes. So - * mds_reint_create() and lmv_create() need to be fixed first. - */ -int lmv_put_inode(struct obd_export *exp, struct lustre_id *id) +int lmv_delete_inode(struct obd_export *exp, struct lustre_id *id) { ENTRY; -// lmv_delete_obj(exp, id); + lmv_delete_obj(exp, id); RETURN(0); } @@ -1952,7 +1946,7 @@ struct md_ops lmv_md_ops = { .m_unlink = lmv_unlink, .m_get_real_obd = lmv_get_real_obd, .m_valid_attrs = lmv_valid_attrs, - .m_put_inode = lmv_put_inode, + .m_delete_inode = lmv_delete_inode, }; int __init lmv_init(void) diff --git a/lustre/tests/createmany.c b/lustre/tests/createmany.c index 1d62b20..2bf9245 100644 --- a/lustre/tests/createmany.c +++ b/lustre/tests/createmany.c @@ -73,7 +73,7 @@ int main(int argc, char ** argv) for (i = 0; i < count && time(0) < end; i++, begin++) { sprintf(filename, fmt, begin); if (do_open) { - int fd = open(filename, O_CREAT|O_RDWR, 0644); + int fd = open(filename, O_CREAT | O_RDWR, 0644); if (fd < 0) { printf("open(%s) error: %s\n", filename, strerror(errno)); @@ -81,7 +81,7 @@ int main(int argc, char ** argv) break; } close(fd); - } else if (do_link) { + } else if (do_link) { rc = link(tgt, filename); if (rc) { printf("link(%s, %s) error: %s\n", @@ -90,7 +90,7 @@ int main(int argc, char ** argv) break; } } else { - rc = mknod(filename, S_IFREG| 0444, 0); + rc = mknod(filename, S_IFREG | 0444, 0); if (rc) { printf("mknod(%s) error: %s\n", filename, strerror(errno)); -- 1.8.3.1