All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] fs: ufs: Remove unused pointer
@ 2014-02-11  0:20 Christian Engelmayer
  2014-02-11  0:22 ` [PATCH 1/3] fs: ufs: Remove unused ufs_super_block_first pointer Christian Engelmayer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christian Engelmayer @ 2014-02-11  0:20 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Evgeniy Dushistov, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1135 bytes --]

This is a cleanup throughout ufs regarding pointers that are set up, but no
longer used in the affected functions. The ubh_get_usb_(first|second|third)
macros found in the changesets all resolve to 

   static inline void *get_usb_offset(struct ufs_sb_private_info *uspi,
                                      unsigned int offset)
   {
           unsigned int index;

           index = offset >> uspi->s_fshift;
           offset &= ~uspi->s_fmask;
           return uspi->s_ubh.bh[index]->b_data + offset;
   }

and differ in the passed offset value. get_usb_offset() does not alter the
passed ufs_sb_private_info struct. Those calls can be thus removed safely
where the return value is not further used.

The series applies against v3.14-rc2 and is compile tested.

Christian Engelmayer (3):
  fs: ufs: Remove unused ufs_super_block_first pointer.
  fs: ufs: Remove unused ufs_super_block_second pointer.
  fs: ufs: Remove unused ufs_super_block_third pointer.

 fs/ufs/balloc.c | 12 ------------
 fs/ufs/ialloc.c |  4 ----
 fs/ufs/super.c  |  6 ------
 3 files changed, 22 deletions(-)

-- 
1.8.3.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] fs: ufs: Remove unused ufs_super_block_first pointer
  2014-02-11  0:20 [PATCH 0/3] fs: ufs: Remove unused pointer Christian Engelmayer
@ 2014-02-11  0:22 ` Christian Engelmayer
  2014-02-11  0:23 ` [PATCH 2/3] fs: ufs: Remove unused ufs_super_block_second pointer Christian Engelmayer
  2014-02-11  0:24 ` [PATCH 3/3] fs: ufs: Remove unused ufs_super_block_third pointer Christian Engelmayer
  2 siblings, 0 replies; 4+ messages in thread
From: Christian Engelmayer @ 2014-02-11  0:22 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Evgeniy Dushistov, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 5632 bytes --]

Remove occurences of unused pointers to struct ufs_super_block_first that were
acquired via ubh_get_usb_first().

Detected by Coverity: CID 139929 - CID 139936, CID 139940.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
---
 fs/ufs/balloc.c | 12 ------------
 fs/ufs/ialloc.c |  4 ----
 fs/ufs/super.c  |  2 --
 3 files changed, 18 deletions(-)

diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c
index a7ea492..0ab1de4 100644
--- a/fs/ufs/balloc.c
+++ b/fs/ufs/balloc.c
@@ -38,7 +38,6 @@ void ufs_free_fragments(struct inode *inode, u64 fragment, unsigned count)
 {
 	struct super_block * sb;
 	struct ufs_sb_private_info * uspi;
-	struct ufs_super_block_first * usb1;
 	struct ufs_cg_private_info * ucpi;
 	struct ufs_cylinder_group * ucg;
 	unsigned cgno, bit, end_bit, bbase, blkmap, i;
@@ -46,7 +45,6 @@ void ufs_free_fragments(struct inode *inode, u64 fragment, unsigned count)
 	
 	sb = inode->i_sb;
 	uspi = UFS_SB(sb)->s_uspi;
-	usb1 = ubh_get_usb_first(uspi);
 	
 	UFSD("ENTER, fragment %llu, count %u\n",
 	     (unsigned long long)fragment, count);
@@ -135,7 +133,6 @@ void ufs_free_blocks(struct inode *inode, u64 fragment, unsigned count)
 {
 	struct super_block * sb;
 	struct ufs_sb_private_info * uspi;
-	struct ufs_super_block_first * usb1;
 	struct ufs_cg_private_info * ucpi;
 	struct ufs_cylinder_group * ucg;
 	unsigned overflow, cgno, bit, end_bit, i;
@@ -143,7 +140,6 @@ void ufs_free_blocks(struct inode *inode, u64 fragment, unsigned count)
 	
 	sb = inode->i_sb;
 	uspi = UFS_SB(sb)->s_uspi;
-	usb1 = ubh_get_usb_first(uspi);
 
 	UFSD("ENTER, fragment %llu, count %u\n",
 	     (unsigned long long)fragment, count);
@@ -499,7 +495,6 @@ static u64 ufs_add_fragments(struct inode *inode, u64 fragment,
 {
 	struct super_block * sb;
 	struct ufs_sb_private_info * uspi;
-	struct ufs_super_block_first * usb1;
 	struct ufs_cg_private_info * ucpi;
 	struct ufs_cylinder_group * ucg;
 	unsigned cgno, fragno, fragoff, count, fragsize, i;
@@ -509,7 +504,6 @@ static u64 ufs_add_fragments(struct inode *inode, u64 fragment,
 	
 	sb = inode->i_sb;
 	uspi = UFS_SB(sb)->s_uspi;
-	usb1 = ubh_get_usb_first (uspi);
 	count = newcount - oldcount;
 	
 	cgno = ufs_dtog(uspi, fragment);
@@ -577,7 +571,6 @@ static u64 ufs_alloc_fragments(struct inode *inode, unsigned cgno,
 {
 	struct super_block * sb;
 	struct ufs_sb_private_info * uspi;
-	struct ufs_super_block_first * usb1;
 	struct ufs_cg_private_info * ucpi;
 	struct ufs_cylinder_group * ucg;
 	unsigned oldcg, i, j, k, allocsize;
@@ -588,7 +581,6 @@ static u64 ufs_alloc_fragments(struct inode *inode, unsigned cgno,
 
 	sb = inode->i_sb;
 	uspi = UFS_SB(sb)->s_uspi;
-	usb1 = ubh_get_usb_first(uspi);
 	oldcg = cgno;
 	
 	/*
@@ -690,7 +682,6 @@ static u64 ufs_alloccg_block(struct inode *inode,
 {
 	struct super_block * sb;
 	struct ufs_sb_private_info * uspi;
-	struct ufs_super_block_first * usb1;
 	struct ufs_cylinder_group * ucg;
 	u64 result, blkno;
 
@@ -698,7 +689,6 @@ static u64 ufs_alloccg_block(struct inode *inode,
 
 	sb = inode->i_sb;
 	uspi = UFS_SB(sb)->s_uspi;
-	usb1 = ubh_get_usb_first(uspi);
 	ucg = ubh_get_ucg(UCPI_UBH(ucpi));
 
 	if (goal == 0) {
@@ -794,7 +784,6 @@ static u64 ufs_bitmap_search(struct super_block *sb,
 		0x0, 0x2, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe
 	};
 	struct ufs_sb_private_info *uspi = UFS_SB(sb)->s_uspi;
-	struct ufs_super_block_first *usb1;
 	struct ufs_cylinder_group *ucg;
 	unsigned start, length, loc;
 	unsigned pos, want, blockmap, mask, end;
@@ -803,7 +792,6 @@ static u64 ufs_bitmap_search(struct super_block *sb,
 	UFSD("ENTER, cg %u, goal %llu, count %u\n", ucpi->c_cgx,
 	     (unsigned long long)goal, count);
 
-	usb1 = ubh_get_usb_first (uspi);
 	ucg = ubh_get_ucg(UCPI_UBH(ucpi));
 
 	if (goal)
diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c
index d0426d7..98f7211 100644
--- a/fs/ufs/ialloc.c
+++ b/fs/ufs/ialloc.c
@@ -57,7 +57,6 @@ void ufs_free_inode (struct inode * inode)
 {
 	struct super_block * sb;
 	struct ufs_sb_private_info * uspi;
-	struct ufs_super_block_first * usb1;
 	struct ufs_cg_private_info * ucpi;
 	struct ufs_cylinder_group * ucg;
 	int is_directory;
@@ -67,7 +66,6 @@ void ufs_free_inode (struct inode * inode)
 
 	sb = inode->i_sb;
 	uspi = UFS_SB(sb)->s_uspi;
-	usb1 = ubh_get_usb_first(uspi);
 	
 	ino = inode->i_ino;
 
@@ -175,7 +173,6 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode)
 	struct super_block * sb;
 	struct ufs_sb_info * sbi;
 	struct ufs_sb_private_info * uspi;
-	struct ufs_super_block_first * usb1;
 	struct ufs_cg_private_info * ucpi;
 	struct ufs_cylinder_group * ucg;
 	struct inode * inode;
@@ -195,7 +192,6 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode)
 	ufsi = UFS_I(inode);
 	sbi = UFS_SB(sb);
 	uspi = sbi->s_uspi;
-	usb1 = ubh_get_usb_first(uspi);
 
 	mutex_lock(&sbi->s_lock);
 
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 329f2f5..3f2c086 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1389,14 +1389,12 @@ static int ufs_statfs(struct dentry *dentry, struct kstatfs *buf)
 	struct super_block *sb = dentry->d_sb;
 	struct ufs_sb_private_info *uspi= UFS_SB(sb)->s_uspi;
 	unsigned  flags = UFS_SB(sb)->s_flags;
-	struct ufs_super_block_first *usb1;
 	struct ufs_super_block_second *usb2;
 	struct ufs_super_block_third *usb3;
 	u64 id = huge_encode_dev(sb->s_bdev->bd_dev);
 
 	lock_ufs(sb);
 
-	usb1 = ubh_get_usb_first(uspi);
 	usb2 = ubh_get_usb_second(uspi);
 	usb3 = ubh_get_usb_third(uspi);
 	
-- 
1.8.3.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] fs: ufs: Remove unused ufs_super_block_second pointer
  2014-02-11  0:20 [PATCH 0/3] fs: ufs: Remove unused pointer Christian Engelmayer
  2014-02-11  0:22 ` [PATCH 1/3] fs: ufs: Remove unused ufs_super_block_first pointer Christian Engelmayer
@ 2014-02-11  0:23 ` Christian Engelmayer
  2014-02-11  0:24 ` [PATCH 3/3] fs: ufs: Remove unused ufs_super_block_third pointer Christian Engelmayer
  2 siblings, 0 replies; 4+ messages in thread
From: Christian Engelmayer @ 2014-02-11  0:23 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Evgeniy Dushistov, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

Pointer 'usb2' to struct ufs_super_block_second acquired via
ubh_get_usb_second() is never used in function ufs_statfs().
Thus remove it.

Detected by Coverity: CID 139940.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
---
 fs/ufs/super.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 3f2c086..53ce1af 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1389,13 +1389,11 @@ static int ufs_statfs(struct dentry *dentry, struct kstatfs *buf)
 	struct super_block *sb = dentry->d_sb;
 	struct ufs_sb_private_info *uspi= UFS_SB(sb)->s_uspi;
 	unsigned  flags = UFS_SB(sb)->s_flags;
-	struct ufs_super_block_second *usb2;
 	struct ufs_super_block_third *usb3;
 	u64 id = huge_encode_dev(sb->s_bdev->bd_dev);
 
 	lock_ufs(sb);
 
-	usb2 = ubh_get_usb_second(uspi);
 	usb3 = ubh_get_usb_third(uspi);
 	
 	if ((flags & UFS_TYPE_MASK) == UFS_TYPE_UFS2) {
-- 
1.8.3.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] fs: ufs: Remove unused ufs_super_block_third pointer
  2014-02-11  0:20 [PATCH 0/3] fs: ufs: Remove unused pointer Christian Engelmayer
  2014-02-11  0:22 ` [PATCH 1/3] fs: ufs: Remove unused ufs_super_block_first pointer Christian Engelmayer
  2014-02-11  0:23 ` [PATCH 2/3] fs: ufs: Remove unused ufs_super_block_second pointer Christian Engelmayer
@ 2014-02-11  0:24 ` Christian Engelmayer
  2 siblings, 0 replies; 4+ messages in thread
From: Christian Engelmayer @ 2014-02-11  0:24 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Evgeniy Dushistov, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 815 bytes --]

Pointer 'usb3' to struct ufs_super_block_third acquired via
ubh_get_usb_third() is never used in function ufs_read_cylinder_structures().
Thus remove it.

Detected by Coverity: CID 139939.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
---
 fs/ufs/super.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 53ce1af..deae93e 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -524,11 +524,9 @@ static int ufs_read_cylinder_structures(struct super_block *sb)
 	struct ufs_buffer_head * ubh;
 	unsigned char * base, * space;
 	unsigned size, blks, i;
-	struct ufs_super_block_third *usb3;
 
 	UFSD("ENTER\n");
 
-	usb3 = ubh_get_usb_third(uspi);
 	/*
 	 * Read cs structures from (usually) first data block
 	 * on the device. 
-- 
1.8.3.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-11  0:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-11  0:20 [PATCH 0/3] fs: ufs: Remove unused pointer Christian Engelmayer
2014-02-11  0:22 ` [PATCH 1/3] fs: ufs: Remove unused ufs_super_block_first pointer Christian Engelmayer
2014-02-11  0:23 ` [PATCH 2/3] fs: ufs: Remove unused ufs_super_block_second pointer Christian Engelmayer
2014-02-11  0:24 ` [PATCH 3/3] fs: ufs: Remove unused ufs_super_block_third pointer Christian Engelmayer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.