Lustre compat code removal
cover Lustre compat code removal
From: Oleg Drokin <[email protected]>
This is take two for the compat stuff removal.
Oleg Drokin (6):
staging/lustre: Drop SEEK_* definition checks staging/lustre: remove unused ll_quota_on and ll_quota_off staging/lustre: Drop FMODE_UNSIGNED_OFFSET define staging/lustre: Use hlist primitives directly staging/lustre: Get rid of ll_pagevec_ macros staging/lustre: Get rid of inode_dio_write_done and inode_dio_read
.../lustre/lustre/include/linux/lustre_compat25.h | 61 ---------------------- drivers/staging/lustre/lustre/llite/dcache.c | 3 +- drivers/staging/lustre/lustre/llite/dir.c | 4 -- drivers/staging/lustre/lustre/llite/llite_lib.c | 5 +- drivers/staging/lustre/lustre/llite/namei.c | 10 ++-- drivers/staging/lustre/lustre/llite/vvp_io.c | 5 +- 6 files changed, 8 insertions(+), 80 deletions(-)
Signature · 1 line
2.1.0
PATCH 1/6 staging/lustre: Drop SEEK_* definition checks
From: Oleg Drokin <[email protected]>
SEEK_DATA and SEEK_HOLE are always defined in the kernel, drop the definition checks
--- drivers/staging/lustre/lustre/include/linux/lustre_compat25.h | 7 ------- 1 file changed, 7 deletions(-)
drivers/staging/lustre/lustre/include/linux/lustre_compat25.h +0 -7
@@ -121,13 +121,6 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount)# define NO_QUOTA (-EDQUOT)#endif -#ifndef SEEK_DATA -#define SEEK_DATA 3/* seek to the next data */ -#endif -#ifndef SEEK_HOLE -#define SEEK_HOLE 4/* seek to the next hole */ -#endif -#ifndef FMODE_UNSIGNED_OFFSET #define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000)#endif
Signature · 1 line
2.1.0
PATCH 2/6 staging/lustre: remove unused ll_quota_on and ll_quota_off
In reply to [email protected]From: Oleg Drokin <[email protected]>
They are not used anywhere, so safe to drop.
--- .../lustre/lustre/include/linux/lustre_compat25.h | 31 ---------------------- 1 file changed, 31 deletions(-)
drivers/staging/lustre/lustre/include/linux/lustre_compat25.h +0 -31
@@ -69,37 +69,6 @@# define inode_dio_read (i) atomic_inc(&(i)->i_dio_count)/* inode_dio_done(i) use as-is for read unlock */ -static inline int -ll_quota_on (struct super_block *sb,int off,int ver,char *name,int remount) -{ -int rc; - -if (sb->s_qcop->quota_on) { -struct path path; - - rc =kern_path (name,LOOKUP_FOLLOW , &path); -if (!rc) -return rc; - rc = sb->s_qcop->quota_on (sb, off, ver - , &path - ); -path_put (&path); -return rc; - }else -return -ENOSYS ; -} - -static inline int ll_quota_off (struct super_block *sb,int off,int remount) -{ -if (sb->s_qcop->quota_off) { -return sb->s_qcop->quota_off (sb, off - ); - }else -return -ENOSYS ; -} - - -#define ll_d_hlist_node hlist_node#define ll_d_hlist_empty (list) hlist_empty(list)#define ll_d_hlist_entry (ptr, type, name) hlist_entry(ptr.first, type, name)
Signature · 1 line
2.1.0
PATCH 3/6 staging/lustre: Drop FMODE_UNSIGNED_OFFSET define
In reply to [email protected]From: Oleg Drokin <[email protected]>
It's not really used anywhere.
--- drivers/staging/lustre/lustre/include/linux/lustre_compat25.h | 4 ---- 1 file changed, 4 deletions(-)
drivers/staging/lustre/lustre/include/linux/lustre_compat25.h +0 -4
@@ -90,10 +90,6 @@# define NO_QUOTA (-EDQUOT)#endif -#ifndef FMODE_UNSIGNED_OFFSET -#define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000) -#endif -#if !defined(_ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_) && !defined(ext2_set_bit)# define ext2_set_bit __test_and_set_bit_le# define ext2_clear_bit __test_and_clear_bit_le
Signature · 1 line
2.1.0
PATCH 4/6 staging/lustre: Use hlist primitives directly
In reply to [email protected]From: Oleg Drokin <[email protected]>
Get rid of ll_d_hlist* compat defines.
--- drivers/staging/lustre/lustre/include/linux/lustre_compat25.h | 9 --------- drivers/staging/lustre/lustre/llite/dcache.c | 3 +-- drivers/staging/lustre/lustre/llite/namei.c | 10 ++++------ 3 files changed, 5 insertions(+), 17 deletions(-)
drivers/staging/lustre/lustre/include/linux/lustre_compat25.h +0 -9
@@ -69,15 +69,6 @@# define inode_dio_read (i) atomic_inc(&(i)->i_dio_count)/* inode_dio_done(i) use as-is for read unlock */ -#define ll_d_hlist_node hlist_node -#define ll_d_hlist_empty (list) hlist_empty(list) -#define ll_d_hlist_entry (ptr, type, name) hlist_entry(ptr.first, type, name) -#define ll_d_hlist_for_each (tmp, i_dentry) hlist_for_each(tmp, i_dentry) -#define ll_d_hlist_for_each_entry (dentry, p, i_dentry, alias) \ - p = NULL; hlist_for_each_entry(dentry, i_dentry, alias) - - -#define ll_pagevec_init (pv, cold) do {} while (0)#define ll_pagevec_add (pv, pg) (0)#define ll_pagevec_lru_add_file (pv) do {} while (0)
drivers/staging/lustre/lustre/llite/dcache.c +1 -2
@@ -250,7 +250,6 @@ void ll_intent_release(struct lookup_intent *it)void ll_invalidate_aliases (struct inode *inode) {struct dentry *dentry; -struct ll_d_hlist_node *p;LASSERT (inode !=NULL );
@@ -258,7 +257,7 @@ void ll_invalidate_aliases(struct inode *inode) inode->i_ino, inode->i_generation, inode);ll_lock_dcache (inode); -ll_d_hlist_for_each_entry (dentry, p, &inode->i_dentry, d_u.d_alias) { +hlist_for_each_entry (dentry, &inode->i_dentry, d_u.d_alias) {CDEBUG (D_DENTRY ,"dentry in drop %pd (%p) parent %p inode %p flags %d\n" , dentry, dentry, dentry->d_parent,d_inode (dentry), dentry->d_flags);
drivers/staging/lustre/lustre/llite/namei.c +4 -6
@@ -144,10 +144,9 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash,static void ll_invalidate_negative_children (struct inode *dir) {struct dentry *dentry, *tmp_subdir; -struct ll_d_hlist_node *p;ll_lock_dcache (dir); -ll_d_hlist_for_each_entry (dentry, p, &dir->i_dentry, d_u.d_alias) { +hlist_for_each_entry (dentry, &dir->i_dentry, d_u.d_alias) {spin_lock (&dentry->d_lock);if (!list_empty (&dentry->d_subdirs)) {struct dentry *child;
@@ -334,15 +333,14 @@ void ll_i2gids(__u32 *suppgids, struct inode *i1, struct inode *i2)static struct dentry *ll_find_alias (struct inode *inode,struct dentry *dentry) {struct dentry *alias, *discon_alias, *invalid_alias; -struct ll_d_hlist_node *p; -if (ll_d_hlist_empty (&inode->i_dentry)) +if (hlist_empty (&inode->i_dentry))return NULL ; discon_alias = invalid_alias =NULL ;ll_lock_dcache (inode); -ll_d_hlist_for_each_entry (alias, p, &inode->i_dentry, d_u.d_alias) { +hlist_for_each_entry (alias, &inode->i_dentry, d_u.d_alias) {LASSERT (alias != dentry);spin_lock (&alias->d_lock);
@@ -690,7 +688,7 @@ static struct inode *ll_create_node(struct inode *dir, struct lookup_intent *it) goto out; } -LASSERT (ll_d_hlist_empty (&inode->i_dentry)); +LASSERT (hlist_empty (&inode->i_dentry));/* We asked for a lock on the directory, but were granted a * lock on the inode. Since we finally have an inode pointer,
Signature · 1 line
2.1.0
PATCH 5/6 staging/lustre: Get rid of ll_pagevec_ macros
In reply to [email protected]From: Oleg Drokin <[email protected]>
They are noop anyways.
--- drivers/staging/lustre/lustre/include/linux/lustre_compat25.h | 5 ----- drivers/staging/lustre/lustre/llite/dir.c | 4 ---- 2 files changed, 9 deletions(-)
drivers/staging/lustre/lustre/include/linux/lustre_compat25.h +0 -5
@@ -69,11 +69,6 @@# define inode_dio_read (i) atomic_inc(&(i)->i_dio_count)/* inode_dio_done(i) use as-is for read unlock */ -#define ll_pagevec_init (pv, cold) do {} while (0) -#define ll_pagevec_add (pv, pg) (0) -#define ll_pagevec_lru_add_file (pv) do {} while (0) - -#ifndef QUOTA_OK # define QUOTA_OK 0#endif
drivers/staging/lustre/lustre/llite/dir.c +0 -4
@@ -203,7 +203,6 @@ static int ll_dir_filler(void *_hash, struct page *page0)CDEBUG (D_VFSTRACE ,"read %d/%d pages\n" , nrdpgs, npages); -ll_pagevec_init (&lru_pvec,0 );for (i =1 ; i < npages; i++) {unsigned long offset;int ret;
@@ -228,15 +227,12 @@ static int ll_dir_filler(void *_hash, struct page *page0) GFP_KERNEL);if (ret ==0 ) {unlock_page (page); -if (ll_pagevec_add (&lru_pvec, page) ==0 ) -ll_pagevec_lru_add_file (&lru_pvec); }else {CDEBUG (D_VFSTRACE ,"page %lu add to page cache failed: %d\n" , offset, ret); }page_cache_release (page); } -ll_pagevec_lru_add_file (&lru_pvec);if (page_pool != &page0)kfree (page_pool);
Signature · 1 line
2.1.0
PATCH 6/6 staging/lustre: Get rid of inode_dio_write_done and inode_dio_read
In reply to [email protected]From: Oleg Drokin <[email protected]>
These primitives are long deprecated and unused.
--- drivers/staging/lustre/lustre/include/linux/lustre_compat25.h | 5 ----- drivers/staging/lustre/lustre/llite/llite_lib.c | 5 +---- drivers/staging/lustre/lustre/llite/vvp_io.c | 5 ++--- 3 files changed, 3 insertions(+), 12 deletions(-)
drivers/staging/lustre/lustre/include/linux/lustre_compat25.h +0 -5
@@ -64,11 +64,6 @@#define LTIME_S (time) (time.tv_sec) -/* inode_dio_wait(i) use as-is for write lock */ -# define inode_dio_write_done (i) do {} while (0)/* for write unlock */ -# define inode_dio_read (i) atomic_inc(&(i)->i_dio_count) -/* inode_dio_done(i) use as-is for read unlock */ -#ifndef QUOTA_OK # define QUOTA_OK 0#endif
drivers/staging/lustre/lustre/llite/llite_lib.c +1 -4
@@ -1356,11 +1356,8 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)if (!op_data)return -ENOMEM ; -if (!S_ISDIR (inode->i_mode)) { -if (attr->ia_valid &ATTR_SIZE ) -inode_dio_write_done (inode); +if (!S_ISDIR (inode->i_mode))mutex_unlock (&inode->i_mutex); - }memcpy (&op_data->op_attr, attr,sizeof (*attr));
drivers/staging/lustre/lustre/llite/vvp_io.c +2 -3
@@ -455,12 +455,11 @@ static void vvp_io_setattr_end(const struct lu_env *env,struct cl_io *io = ios->cis_io;struct inode *inode =ccc_object_inode (io->ci_obj); -if (cl_io_is_trunc (io)) { +if (cl_io_is_trunc (io))/* Truncate in memory pages - they must be clean pages * because osc has already notified to destroy osc_extents. */ vvp_do_vmtruncate (inode, io->u.ci_setattr.sa_attr.lvb_size); -inode_dio_write_done (inode); - } +mutex_unlock (&inode->i_mutex); }
Signature · 1 line
2.1.0