From: Andrey Abramov <st5pub@yandex.ru>
To: "vgupta@synopsys.com" <vgupta@synopsys.com>,
"benh@kernel.crashing.org" <benh@kernel.crashing.org>,
"paulus@samba.org" <paulus@samba.org>,
"mpe@ellerman.id.au" <mpe@ellerman.id.au>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"bp@alien8.de" <bp@alien8.de>, "hpa@zytor.com" <hpa@zytor.com>,
"x86@kernel.org" <x86@kernel.org>,
"mark@fasheh.com" <mark@fasheh.com>,
"jlbec@evilplan.org" <jlbec@evilplan.org>,
"richard@nod.at" <richard@nod.at>,
"dedekind1@gmail.com" <dedekind1@gmail.com>,
"adrian.hunter@intel.com" <adrian.hunter@intel.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"naveen.n.rao@linux.vnet.ibm.com"
<naveen.n.rao@linux.vnet.ibm.com>,
"jpoimboe@redhat.com" <jpoimboe@redhat.com>,
Dave Chinner <dchinner@redhat.com>,
"darrick.wong@oracle.com" <darrick.wong@oracle.com>,
"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
George Spelvin <lkml@sdf.org>,
"linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"ocfs2-devel@oss.oracle.com" <ocfs2-devel@oss.oracle.com>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
"sfr@canb.auug.org.au" <sfr@canb.auug.org.au>
Cc: "mhocko@suse.com" <mhocko@suse.com>,
"gustavo@embeddedor.com" <gustavo@embeddedor.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"amir73il@gmail.com" <amir73il@gmail.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
"kamalesh@linux.vnet.ibm.com" <kamalesh@linux.vnet.ibm.com>,
"piaojun@huawei.com" <piaojun@huawei.com>,
"yamada.masahiro@socionext.com" <yamada.masahiro@socionext.com>,
"jiang.biao2@zte.com.cn" <jiang.biao2@zte.com.cn>,
"jslaby@suse.cz" <jslaby@suse.cz>,
"yuehaibing@huawei.com" <yuehaibing@huawei.com>,
"rppt@linux.ibm.com" <rppt@linux.ibm.com>,
"ge.changwei@h3c.com" <ge.changwei@h3c.com>,
"keescook@chromium.org" <keescook@chromium.org>,
"jannh@google.com" <jannh@google.com>,
"ashish.samant@oracle.com" <ashish.samant@oracle.com>,
"npiggin@gmail.com" <npiggin@gmail.com>,
"jiangyiwen@huawei.com" <jiangyiwen@huawei.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
"lchen@suse.com" <lchen@suse.com>,
"malat@debian.org" <malat@debian.org>,
Morton Andrew <akpm@linux-foundation.org>
Subject: [PATCH 4/5] ubifs: find.c: replace swap function with built-in one
Date: Sat, 30 Mar 2019 19:43:01 +0300 [thread overview]
Message-ID: <16620851553964181@myt5-f1576e7b5bad.qloud-c.yandex.net> (raw)
In-Reply-To: <18626931553963861@sas1-b3ec53dbc12b.qloud-c.yandex.net>
Replace swap_dirty_idx function with built-in one,
because swap_dirty_idx does only a simple byte to byte swap.
Signed-off-by: Andrey Abramov <st5pub@yandex.ru>
---
fs/ubifs/find.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c
index f9646835b026..5deaae7fcead 100644
--- a/fs/ubifs/find.c
+++ b/fs/ubifs/find.c
@@ -747,12 +747,6 @@ static int cmp_dirty_idx(const struct ubifs_lprops **a,
return lpa->dirty + lpa->free - lpb->dirty - lpb->free;
}
-static void swap_dirty_idx(struct ubifs_lprops **a, struct ubifs_lprops **b,
- int size)
-{
- swap(*a, *b);
-}
-
/**
* ubifs_save_dirty_idx_lnums - save an array of the most dirty index LEB nos.
* @c: the UBIFS file-system description object
@@ -772,8 +766,7 @@ int ubifs_save_dirty_idx_lnums(struct ubifs_info *c)
sizeof(void *) * c->dirty_idx.cnt);
/* Sort it so that the dirtiest is now at the end */
sort(c->dirty_idx.arr, c->dirty_idx.cnt, sizeof(void *),
- (int (*)(const void *, const void *))cmp_dirty_idx,
- (void (*)(void *, void *, int))swap_dirty_idx);
+ (int (*)(const void *, const void *))cmp_dirty_idx, NULL);
dbg_find("found %d dirty index LEBs", c->dirty_idx.cnt);
if (c->dirty_idx.cnt)
dbg_find("dirtiest index LEB is %d with dirty %d and free %d",
--
2.21.0
next prev parent reply other threads:[~2019-03-31 3:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-30 16:37 [PATCH 0/5] simple sort swap function usage improvements Andrey Abramov
2019-03-30 16:40 ` [PATCH 1/5] arch/arc: unwind.c: replace swap function with built-in one Andrey Abramov
2019-03-30 16:41 ` [PATCH 2/5] powerpc: module_[32|64].c: " Andrey Abramov
2019-04-01 10:11 ` Michael Ellerman
2019-04-02 19:11 ` Andrey Abramov
2019-03-30 16:42 ` [PATCH 3/5] ocfs2: dir, refcounttree, xattr: replace swap functions " Andrey Abramov
2019-03-30 16:43 ` Andrey Abramov [this message]
2019-03-30 16:43 ` [PATCH 5/5] Lib: sort.h: replace int size with size_t size in the swap function Andrey Abramov
2019-03-30 18:38 ` gregkh
2019-03-30 17:16 ` [PATCH 0/5] simple sort swap function usage improvements George Spelvin
2019-03-30 18:32 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16620851553964181@myt5-f1576e7b5bad.qloud-c.yandex.net \
--to=st5pub@yandex.ru \
--cc=adrian.hunter@intel.com \
--cc=akpm@linux-foundation.org \
--cc=amir73il@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ard.biesheuvel@linaro.org \
--cc=ashish.samant@oracle.com \
--cc=benh@kernel.crashing.org \
--cc=bp@alien8.de \
--cc=darrick.wong@oracle.com \
--cc=dchinner@redhat.com \
--cc=dedekind1@gmail.com \
--cc=ge.changwei@h3c.com \
--cc=gregkh@linuxfoundation.org \
--cc=gustavo@embeddedor.com \
--cc=hpa@zytor.com \
--cc=jannh@google.com \
--cc=jiang.biao2@zte.com.cn \
--cc=jiangyiwen@huawei.com \
--cc=jlbec@evilplan.org \
--cc=jpoimboe@redhat.com \
--cc=jslaby@suse.cz \
--cc=kamalesh@linux.vnet.ibm.com \
--cc=keescook@chromium.org \
--cc=lchen@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=linux@rasmusvillemoes.dk \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lkml@sdf.org \
--cc=malat@debian.org \
--cc=mark@fasheh.com \
--cc=mhocko@suse.com \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=npiggin@gmail.com \
--cc=ocfs2-devel@oss.oracle.com \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=piaojun@huawei.com \
--cc=richard@nod.at \
--cc=rppt@linux.ibm.com \
--cc=sfr@canb.auug.org.au \
--cc=tglx@linutronix.de \
--cc=vgupta@synopsys.com \
--cc=x86@kernel.org \
--cc=yamada.masahiro@socionext.com \
--cc=yuehaibing@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).