Re: [PATCH] btrfs: remove unused parameter

2018-07-10 Thread David Sterba
On Mon, Jul 09, 2018 at 02:39:15PM +0800, Gu Jinxiang wrote:
> Since parameter flags is no more used since
> commit d7407606564c ("btrfs: split parse_early_options() in two"),
> remove it.

Please be more specific about the function whre you remove the argument,
something like

"remove unused parameter from btrfs_parse_subvol_options".

I'll fix that and add to misc-next, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] btrfs: remove unused parameter

2018-07-09 Thread Gu Jinxiang
Since parameter flags is no more used since
commit d7407606564c ("btrfs: split parse_early_options() in two"),
remove it.

Signed-off-by: Gu Jinxiang 
---
 fs/btrfs/super.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 81107ad49f3a..bf546d6c286c 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -935,8 +935,8 @@ static int btrfs_parse_early_options(const char *options, 
fmode_t flags,
  *
  * The value is later passed to mount_subvol()
  */
-static int btrfs_parse_subvol_options(const char *options, fmode_t flags,
-   char **subvol_name, u64 *subvol_objectid)
+static int btrfs_parse_subvol_options(const char *options, char **subvol_name,
+   u64 *subvol_objectid)
 {
substring_t args[MAX_OPT_ARGS];
char *opts, *orig, *p;
@@ -1650,8 +1650,8 @@ static struct dentry *btrfs_mount(struct file_system_type 
*fs_type, int flags,
if (!(flags & SB_RDONLY))
mode |= FMODE_WRITE;
 
-   error = btrfs_parse_subvol_options(data, mode,
- _name, _objectid);
+   error = btrfs_parse_subvol_options(data, _name,
+   _objectid);
if (error) {
kfree(subvol_name);
return ERR_PTR(error);
-- 
2.17.1



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] btrfs: Remove unused parameter name from btrfs_qgroup_create

2014-07-09 Thread Satoru Takeuchi

(2014/07/05 12:18), Kevin Brandstatter wrote:

in btrfs_qgruop_create a fourth parameter name exists.
however this parameter is not used anywhere in the function
the only other place this function is called is ioctl and the call
passes NULL as the name paremeter which would seem to indicate its
lack of necessity.

Signed-off-by: Kevin Brandstatter kjbrandstat...@gmail.com


Reviewed-by: Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com


---
  fs/btrfs/ioctl.c  | 3 +--
  fs/btrfs/qgroup.c | 2 +-
  fs/btrfs/qgroup.h | 3 +--
  3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 2a99f49..4b33d08 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -4709,8 +4709,7 @@ static long btrfs_ioctl_qgroup_create(struct file
*file, void __user *arg)

  /* FIXME: check if the IDs really exist */
  if (sa-create) {
-ret = btrfs_create_qgroup(trans, root-fs_info, sa-qgroupid,
-  NULL);
+ret = btrfs_create_qgroup(trans, root-fs_info, sa-qgroupid);
  } else {
  ret = btrfs_remove_qgroup(trans, root-fs_info, sa-qgroupid);
  }
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 98cb6b2..3d1c8be 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1091,7 +1091,7 @@ out:
  }

  int btrfs_create_qgroup(struct btrfs_trans_handle *trans,
-struct btrfs_fs_info *fs_info, u64 qgroupid, char *name)
+struct btrfs_fs_info *fs_info, u64 qgroupid)
  {
  struct btrfs_root *quota_root;
  struct btrfs_qgroup *qgroup;
diff --git a/fs/btrfs/qgroup.h b/fs/btrfs/qgroup.h
index 5952ff1..31403ca 100644
--- a/fs/btrfs/qgroup.h
+++ b/fs/btrfs/qgroup.h
@@ -69,8 +69,7 @@ int btrfs_add_qgroup_relation(struct
btrfs_trans_handle *trans,
  int btrfs_del_qgroup_relation(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info, u64 src, u64 dst);
  int btrfs_create_qgroup(struct btrfs_trans_handle *trans,
-struct btrfs_fs_info *fs_info, u64 qgroupid,
-char *name);
+struct btrfs_fs_info *fs_info, u64 qgroupid);
  int btrfs_remove_qgroup(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info, u64 qgroupid);
  int btrfs_limit_qgroup(struct btrfs_trans_handle *trans,



--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] btrfs: Remove unused parameter name from btrfs_qgroup_create

2014-07-04 Thread Kevin Brandstatter
in btrfs_qgruop_create a fourth parameter name exists.
however this parameter is not used anywhere in the function
the only other place this function is called is ioctl and the call
passes NULL as the name paremeter which would seem to indicate its
lack of necessity.

Signed-off-by: Kevin Brandstatter kjbrandstat...@gmail.com
---
 fs/btrfs/ioctl.c  | 3 +--
 fs/btrfs/qgroup.c | 2 +-
 fs/btrfs/qgroup.h | 3 +--
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 2a99f49..4b33d08 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -4709,8 +4709,7 @@ static long btrfs_ioctl_qgroup_create(struct file
*file, void __user *arg)
 
 /* FIXME: check if the IDs really exist */
 if (sa-create) {
-ret = btrfs_create_qgroup(trans, root-fs_info, sa-qgroupid,
-  NULL);
+ret = btrfs_create_qgroup(trans, root-fs_info, sa-qgroupid);
 } else {
 ret = btrfs_remove_qgroup(trans, root-fs_info, sa-qgroupid);
 }
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 98cb6b2..3d1c8be 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1091,7 +1091,7 @@ out:
 }
 
 int btrfs_create_qgroup(struct btrfs_trans_handle *trans,
-struct btrfs_fs_info *fs_info, u64 qgroupid, char *name)
+struct btrfs_fs_info *fs_info, u64 qgroupid)
 {
 struct btrfs_root *quota_root;
 struct btrfs_qgroup *qgroup;
diff --git a/fs/btrfs/qgroup.h b/fs/btrfs/qgroup.h
index 5952ff1..31403ca 100644
--- a/fs/btrfs/qgroup.h
+++ b/fs/btrfs/qgroup.h
@@ -69,8 +69,7 @@ int btrfs_add_qgroup_relation(struct
btrfs_trans_handle *trans,
 int btrfs_del_qgroup_relation(struct btrfs_trans_handle *trans,
   struct btrfs_fs_info *fs_info, u64 src, u64 dst);
 int btrfs_create_qgroup(struct btrfs_trans_handle *trans,
-struct btrfs_fs_info *fs_info, u64 qgroupid,
-char *name);
+struct btrfs_fs_info *fs_info, u64 qgroupid);
 int btrfs_remove_qgroup(struct btrfs_trans_handle *trans,
   struct btrfs_fs_info *fs_info, u64 qgroupid);
 int btrfs_limit_qgroup(struct btrfs_trans_handle *trans,
-- 
2.0.1
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] btrfs: remove unused parameter from btrfs_header_fsid

2013-09-20 Thread Ross Kirk
Remove unused parameter, 'eb'. Unused since introduction in
5f39d397dfbe140a14edecd4e73c34ce23c4f9ee

Signed-off-by: Ross Kirk ross.k...@gmail.com
---
 fs/btrfs/ctree.c   |   10 +-
 fs/btrfs/ctree.h   |2 +-
 fs/btrfs/disk-io.c |6 +++---
 fs/btrfs/ioctl.c   |2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 63cde75..febc672 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -275,7 +275,7 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans,
btrfs_set_header_owner(cow, new_root_objectid);
 
write_extent_buffer(cow, root-fs_info-fsid,
-   (unsigned long)btrfs_header_fsid(cow),
+   (unsigned long)btrfs_header_fsid(),
BTRFS_FSID_SIZE);
 
WARN_ON(btrfs_header_generation(buf)  trans-transid);
@@ -1047,7 +1047,7 @@ static noinline int __btrfs_cow_block(struct 
btrfs_trans_handle *trans,
btrfs_set_header_owner(cow, root-root_key.objectid);
 
write_extent_buffer(cow, root-fs_info-fsid,
-   (unsigned long)btrfs_header_fsid(cow),
+   (unsigned long)btrfs_header_fsid(),
BTRFS_FSID_SIZE);
 
ret = update_ref_for_cow(trans, root, buf, cow, last_ref);
@@ -3145,7 +3145,7 @@ static noinline int insert_new_root(struct 
btrfs_trans_handle *trans,
btrfs_set_header_owner(c, root-root_key.objectid);
 
write_extent_buffer(c, root-fs_info-fsid,
-   (unsigned long)btrfs_header_fsid(c),
+   (unsigned long)btrfs_header_fsid(),
BTRFS_FSID_SIZE);
 
write_extent_buffer(c, root-fs_info-chunk_tree_uuid,
@@ -3285,7 +3285,7 @@ static noinline int split_node(struct btrfs_trans_handle 
*trans,
btrfs_set_header_backref_rev(split, BTRFS_MIXED_BACKREF_REV);
btrfs_set_header_owner(split, root-root_key.objectid);
write_extent_buffer(split, root-fs_info-fsid,
-   (unsigned long)btrfs_header_fsid(split),
+   (unsigned long)btrfs_header_fsid(),
BTRFS_FSID_SIZE);
write_extent_buffer(split, root-fs_info-chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(split),
@@ -4041,7 +4041,7 @@ again:
btrfs_set_header_owner(right, root-root_key.objectid);
btrfs_set_header_level(right, 0);
write_extent_buffer(right, root-fs_info-fsid,
-   (unsigned long)btrfs_header_fsid(right),
+   (unsigned long)btrfs_header_fsid(),
BTRFS_FSID_SIZE);
 
write_extent_buffer(right, root-fs_info-chunk_tree_uuid,
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index e0bab4d..972a2f8 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2602,7 +2602,7 @@ static inline void btrfs_set_header_backref_rev(struct 
extent_buffer *eb,
btrfs_set_header_flags(eb, flags);
 }
 
-static inline u8 *btrfs_header_fsid(struct extent_buffer *eb)
+static inline u8 *btrfs_header_fsid(void)
 {
unsigned long ptr = offsetof(struct btrfs_header, fsid);
return (u8 *)ptr;
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 3c2886c..e038693 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -497,7 +497,7 @@ static int check_tree_block_fsid(struct btrfs_root *root,
u8 fsid[BTRFS_UUID_SIZE];
int ret = 1;
 
-   read_extent_buffer(eb, fsid, (unsigned long)btrfs_header_fsid(eb),
+   read_extent_buffer(eb, fsid, (unsigned long)btrfs_header_fsid(),
   BTRFS_FSID_SIZE);
while (fs_devices) {
if (!memcmp(fsid, fs_devices-fsid, BTRFS_FSID_SIZE)) {
@@ -1291,7 +1291,7 @@ struct btrfs_root *btrfs_create_tree(struct 
btrfs_trans_handle *trans,
root-node = leaf;
 
write_extent_buffer(leaf, fs_info-fsid,
-   (unsigned long)btrfs_header_fsid(leaf),
+   (unsigned long)btrfs_header_fsid(),
BTRFS_FSID_SIZE);
write_extent_buffer(leaf, fs_info-chunk_tree_uuid,
(unsigned long)btrfs_header_chunk_tree_uuid(leaf),
@@ -1378,7 +1378,7 @@ static struct btrfs_root *alloc_log_tree(struct 
btrfs_trans_handle *trans,
root-node = leaf;
 
write_extent_buffer(root-node, root-fs_info-fsid,
-   (unsigned long)btrfs_header_fsid(root-node),
+   (unsigned long)btrfs_header_fsid(),
BTRFS_FSID_SIZE);
btrfs_mark_buffer_dirty(root-node);
btrfs_tree_unlock(root-node);
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 0e17a30..464e569 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -426,7 +426,7 @@ static noinline int create_subvol(struct inode *dir,
  

Re: [PATCH] btrfs: remove unused parameter from btrfs_header_fsid

2013-09-20 Thread Eric Sandeen
On 9/20/13 8:27 AM, Ross Kirk wrote:
 Remove unused parameter, 'eb'. Unused since introduction in
 5f39d397dfbe140a14edecd4e73c34ce23c4f9ee
 
 Signed-off-by: Ross Kirk ross.k...@gmail.com

A few points; was this against latest upstream?

Upstream, fba6aa75654394fccf2530041e9451414c28084f removed
all the superfluous (unsigned long) casts when this function
gets called.  So I think you need to rebase this.

(that commit would be great to apply to userspace as well to keep things
more in sync).

But it seems like this could be cleaned up even more:

static inline unsigned long btrfs_header_fsid(struct extent_buffer *eb)
{
return offsetof(struct btrfs_header, fsid);
}

really?  We have a function which just returns a static value from offsetof?

And to a caveman-code-reader like me, I'd sure expect btrfs_header_fsid to
give me an fsid, not an offset of a structure member.  :(

And as for types, I'm not sure why write_extent_buffer takes an unsigned long
for start; if nothing else it seems to actually be used as a size_t inside the
function.  Argh.

Well -

I suppose for now, removing the unused var is a decent start, after you rebase.

btrfs_header_chunk_tree_uuid() could get similar treatments in kernelspace
and/or userspace.  As could btrfs_leaf_data().

Welcome to peeling the onion.  :)

-Eric

 ---
  fs/btrfs/ctree.c   |   10 +-
  fs/btrfs/ctree.h   |2 +-
  fs/btrfs/disk-io.c |6 +++---
  fs/btrfs/ioctl.c   |2 +-
  4 files changed, 10 insertions(+), 10 deletions(-)
 
 diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
 index 63cde75..febc672 100644
 --- a/fs/btrfs/ctree.c
 +++ b/fs/btrfs/ctree.c
 @@ -275,7 +275,7 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans,
   btrfs_set_header_owner(cow, new_root_objectid);
  
   write_extent_buffer(cow, root-fs_info-fsid,
 - (unsigned long)btrfs_header_fsid(cow),
 + (unsigned long)btrfs_header_fsid(),
   BTRFS_FSID_SIZE);
  
   WARN_ON(btrfs_header_generation(buf)  trans-transid);
 @@ -1047,7 +1047,7 @@ static noinline int __btrfs_cow_block(struct 
 btrfs_trans_handle *trans,
   btrfs_set_header_owner(cow, root-root_key.objectid);
  
   write_extent_buffer(cow, root-fs_info-fsid,
 - (unsigned long)btrfs_header_fsid(cow),
 + (unsigned long)btrfs_header_fsid(),
   BTRFS_FSID_SIZE);
  
   ret = update_ref_for_cow(trans, root, buf, cow, last_ref);
 @@ -3145,7 +3145,7 @@ static noinline int insert_new_root(struct 
 btrfs_trans_handle *trans,
   btrfs_set_header_owner(c, root-root_key.objectid);
  
   write_extent_buffer(c, root-fs_info-fsid,
 - (unsigned long)btrfs_header_fsid(c),
 + (unsigned long)btrfs_header_fsid(),
   BTRFS_FSID_SIZE);
  
   write_extent_buffer(c, root-fs_info-chunk_tree_uuid,
 @@ -3285,7 +3285,7 @@ static noinline int split_node(struct 
 btrfs_trans_handle *trans,
   btrfs_set_header_backref_rev(split, BTRFS_MIXED_BACKREF_REV);
   btrfs_set_header_owner(split, root-root_key.objectid);
   write_extent_buffer(split, root-fs_info-fsid,
 - (unsigned long)btrfs_header_fsid(split),
 + (unsigned long)btrfs_header_fsid(),
   BTRFS_FSID_SIZE);
   write_extent_buffer(split, root-fs_info-chunk_tree_uuid,
   (unsigned long)btrfs_header_chunk_tree_uuid(split),
 @@ -4041,7 +4041,7 @@ again:
   btrfs_set_header_owner(right, root-root_key.objectid);
   btrfs_set_header_level(right, 0);
   write_extent_buffer(right, root-fs_info-fsid,
 - (unsigned long)btrfs_header_fsid(right),
 + (unsigned long)btrfs_header_fsid(),
   BTRFS_FSID_SIZE);
  
   write_extent_buffer(right, root-fs_info-chunk_tree_uuid,
 diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
 index e0bab4d..972a2f8 100644
 --- a/fs/btrfs/ctree.h
 +++ b/fs/btrfs/ctree.h
 @@ -2602,7 +2602,7 @@ static inline void btrfs_set_header_backref_rev(struct 
 extent_buffer *eb,
   btrfs_set_header_flags(eb, flags);
  }
  
 -static inline u8 *btrfs_header_fsid(struct extent_buffer *eb)
 +static inline u8 *btrfs_header_fsid(void)
  {
   unsigned long ptr = offsetof(struct btrfs_header, fsid);
   return (u8 *)ptr;
 diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
 index 3c2886c..e038693 100644
 --- a/fs/btrfs/disk-io.c
 +++ b/fs/btrfs/disk-io.c
 @@ -497,7 +497,7 @@ static int check_tree_block_fsid(struct btrfs_root *root,
   u8 fsid[BTRFS_UUID_SIZE];
   int ret = 1;
  
 - read_extent_buffer(eb, fsid, (unsigned long)btrfs_header_fsid(eb),
 + read_extent_buffer(eb, fsid, (unsigned long)btrfs_header_fsid(),
  BTRFS_FSID_SIZE);
   while (fs_devices) {
   if