Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1234161 > unrolled thread
| Started by | Yaowei Bai <bywxiaobai@163.com> |
|---|---|
| First post | 2015-09-28 15:40 +0200 |
| Last post | 2015-10-01 15:40 +0200 |
| Articles | 11 on this page of 31 — 9 participants |
Back to article view | Back to linux.kernel
[PATCH 00/17] cleanups of fs about new/huge_valid_dev Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 15:40 +0200
[PATCH 04/17] fs/btrfs: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 15:50 +0200
Re: [PATCH 04/17] fs/btrfs: remove unnecessary new_valid_dev check David Sterba <dsterba@suse.cz> - 2015-09-29 17:00 +0200
[PATCH 05/17] fs/exofs: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 16:00 +0200
Re: [PATCH 05/17] fs/exofs: remove unnecessary new_valid_dev check Boaz Harrosh <ooo@electrozaur.com> - 2015-09-29 15:50 +0200
Re: [PATCH 05/17] fs/exofs: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-29 17:50 +0200
Re: [PATCH 05/17] fs/exofs: remove unnecessary new_valid_dev check Boaz Harrosh <ooo@electrozaur.com> - 2015-09-30 12:30 +0200
[PATCH 08/17] fs/f2fs: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 16:00 +0200
[PATCH 07/17] fs/ext4: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 16:00 +0200
[PATCH 06/17] fs/ext2: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 16:00 +0200
[PATCH 10/17] fs/jffs2: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 16:20 +0200
Re: [PATCH 10/17] fs/jffs2: remove unnecessary new_valid_dev check Brian Norris <computersforpeace@gmail.com> - 2015-09-29 01:30 +0200
[PATCH 11/17] fs/jfs: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 16:30 +0200
Re: [Jfs-discussion] [PATCH 11/17] fs/jfs: remove unnecessary new_valid_dev check Dave Kleikamp <dave.kleikamp@oracle.com> - 2015-09-28 17:50 +0200
[PATCH 06/17] fs/ext2: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 16:30 +0200
[PATCH 09/17] fs/hpfs: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 16:40 +0200
Re: [PATCH 09/17] fs/hpfs: remove unnecessary new_valid_dev check Mikulas Patocka <mikulas@twibright.com> - 2015-09-29 17:10 +0200
Re: [PATCH 09/17] fs/hpfs: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-30 13:20 +0200
Re: [PATCH 09/17] fs/hpfs: remove unnecessary new_valid_dev check Mikulas Patocka <mikulas@twibright.com> - 2015-10-01 23:00 +0200
[PATCH 12/17] fs/ncpfs: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 16:40 +0200
[PATCH 14/17] fs/nilfs2: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 16:40 +0200
Re: [PATCH 14/17] fs/nilfs2: remove unnecessary new_valid_dev check Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2015-09-29 17:20 +0200
[PATCH 13/17] fs/nfs: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 16:40 +0200
[PATCH 17/17] fs/ubifs: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 17:00 +0200
Re: [PATCH 17/17] fs/ubifs: remove unnecessary new_valid_dev check Richard Weinberger <richard.weinberger@gmail.com> - 2015-09-28 21:30 +0200
Re: [PATCH 17/17] fs/ubifs: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-29 15:50 +0200
[PATCH 15/17] fs/reiserfs: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 17:00 +0200
[PATCH 16/17] fs/stat: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-28 17:00 +0200
[PATCH] fs/ubifs: remove unnecessary new_valid_dev check Yaowei Bai <bywxiaobai@163.com> - 2015-09-29 16:10 +0200
Re: [PATCH] fs/ubifs: remove unnecessary new_valid_dev check Richard Weinberger <richard.weinberger@gmail.com> - 2015-09-30 10:20 +0200
Re: [PATCH] fs/ubifs: remove unnecessary new_valid_dev check Artem Bityutskiy <dedekind1@gmail.com> - 2015-10-01 15:40 +0200
Page 2 of 2 — ← Prev page 1 [2]
| From | Yaowei Bai <bywxiaobai@163.com> |
|---|---|
| Date | 2015-09-28 16:40 +0200 |
| Subject | [PATCH 14/17] fs/nilfs2: remove unnecessary new_valid_dev check |
| Message-ID | <qdHKW-2co-19@gated-at.bofh.it> |
| In reply to | #1234161 |
As new_valid_dev always returns 1, so !new_valid_dev check is not needed, remove it. Signed-off-by: Yaowei Bai <bywxiaobai@163.com> --- fs/nilfs2/namei.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c index 37dd6b0..c9a1a49 100644 --- a/fs/nilfs2/namei.c +++ b/fs/nilfs2/namei.c @@ -120,9 +120,6 @@ nilfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) struct nilfs_transaction_info ti; int err; - if (!new_valid_dev(rdev)) - return -EINVAL; - err = nilfs_transaction_begin(dir->i_sb, &ti, 1); if (err) return err; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> |
|---|---|
| Date | 2015-09-29 17:20 +0200 |
| Subject | Re: [PATCH 14/17] fs/nilfs2: remove unnecessary new_valid_dev check |
| Message-ID | <qe4Rb-1Nk-1@gated-at.bofh.it> |
| In reply to | #1234215 |
On 2015/09/28 23:33, Yaowei Bai wrote: > As new_valid_dev always returns 1, so !new_valid_dev check is not > needed, remove it. > > Signed-off-by: Yaowei Bai <bywxiaobai@163.com> Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> > --- > fs/nilfs2/namei.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c > index 37dd6b0..c9a1a49 100644 > --- a/fs/nilfs2/namei.c > +++ b/fs/nilfs2/namei.c > @@ -120,9 +120,6 @@ nilfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) > struct nilfs_transaction_info ti; > int err; > > - if (!new_valid_dev(rdev)) > - return -EINVAL; > - > err = nilfs_transaction_begin(dir->i_sb, &ti, 1); > if (err) > return err; > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yaowei Bai <bywxiaobai@163.com> |
|---|---|
| Date | 2015-09-28 16:40 +0200 |
| Subject | [PATCH 13/17] fs/nfs: remove unnecessary new_valid_dev check |
| Message-ID | <qdHKW-2co-13@gated-at.bofh.it> |
| In reply to | #1234161 |
As new_valid_dev always returns 1, so !new_valid_dev check is not needed, remove it. Signed-off-by: Yaowei Bai <bywxiaobai@163.com> --- fs/nfs/dir.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 3d8e4ff..ce5a218 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1714,9 +1714,6 @@ nfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) dfprintk(VFS, "NFS: mknod(%s/%lu), %pd\n", dir->i_sb->s_id, dir->i_ino, dentry); - if (!new_valid_dev(rdev)) - return -EINVAL; - attr.ia_mode = mode; attr.ia_valid = ATTR_MODE; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yaowei Bai <bywxiaobai@163.com> |
|---|---|
| Date | 2015-09-28 17:00 +0200 |
| Subject | [PATCH 17/17] fs/ubifs: remove unnecessary new_valid_dev check |
| Message-ID | <qdI4j-2z9-19@gated-at.bofh.it> |
| In reply to | #1234161 |
As new_valid_dev always returns 1, so new_valid_dev check is not
needed, remove it.
Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
---
fs/ubifs/dir.c | 3 ---
fs/ubifs/misc.h | 9 ++-------
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index 5c27c66..1dd9267 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -787,9 +787,6 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
dbg_gen("dent '%pd' in dir ino %lu", dentry, dir->i_ino);
- if (!new_valid_dev(rdev))
- return -EINVAL;
-
if (S_ISBLK(mode) || S_ISCHR(mode)) {
dev = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS);
if (!dev)
diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h
index ee7cb5e..0197ed6 100644
--- a/fs/ubifs/misc.h
+++ b/fs/ubifs/misc.h
@@ -155,13 +155,8 @@ static inline int ubifs_wbuf_sync(struct ubifs_wbuf *wbuf)
*/
static inline int ubifs_encode_dev(union ubifs_dev_desc *dev, dev_t rdev)
{
- if (new_valid_dev(rdev)) {
- dev->new = cpu_to_le32(new_encode_dev(rdev));
- return sizeof(dev->new);
- } else {
- dev->huge = cpu_to_le64(huge_encode_dev(rdev));
- return sizeof(dev->huge);
- }
+ dev->huge = cpu_to_le64(huge_encode_dev(rdev));
+ return sizeof(dev->huge);
}
/**
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Richard Weinberger <richard.weinberger@gmail.com> |
|---|---|
| Date | 2015-09-28 21:30 +0200 |
| Subject | Re: [PATCH 17/17] fs/ubifs: remove unnecessary new_valid_dev check |
| Message-ID | <qdMhB-gH-53@gated-at.bofh.it> |
| In reply to | #1234231 |
On Mon, Sep 28, 2015 at 4:53 PM, Yaowei Bai <bywxiaobai@163.com> wrote:
> As new_valid_dev always returns 1, so new_valid_dev check is not
> needed, remove it.
>
> Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
> ---
> fs/ubifs/dir.c | 3 ---
> fs/ubifs/misc.h | 9 ++-------
> 2 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
> index 5c27c66..1dd9267 100644
> --- a/fs/ubifs/dir.c
> +++ b/fs/ubifs/dir.c
> @@ -787,9 +787,6 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
>
> dbg_gen("dent '%pd' in dir ino %lu", dentry, dir->i_ino);
>
> - if (!new_valid_dev(rdev))
> - return -EINVAL;
> -
> if (S_ISBLK(mode) || S_ISCHR(mode)) {
> dev = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS);
> if (!dev)
> diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h
> index ee7cb5e..0197ed6 100644
> --- a/fs/ubifs/misc.h
> +++ b/fs/ubifs/misc.h
> @@ -155,13 +155,8 @@ static inline int ubifs_wbuf_sync(struct ubifs_wbuf *wbuf)
> */
> static inline int ubifs_encode_dev(union ubifs_dev_desc *dev, dev_t rdev)
> {
> - if (new_valid_dev(rdev)) {
> - dev->new = cpu_to_le32(new_encode_dev(rdev));
> - return sizeof(dev->new);
> - } else {
> - dev->huge = cpu_to_le64(huge_encode_dev(rdev));
> - return sizeof(dev->huge);
> - }
> + dev->huge = cpu_to_le64(huge_encode_dev(rdev));
> + return sizeof(dev->huge);
Please be careful.
dev->new = cpu_to_le32(new_encode_dev(rdev));
return sizeof(dev->huge);
...is the correct branch. You enabled the dead one.
--
Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yaowei Bai <bywxiaobai@163.com> |
|---|---|
| Date | 2015-09-29 15:50 +0200 |
| Subject | Re: [PATCH 17/17] fs/ubifs: remove unnecessary new_valid_dev check |
| Message-ID | <qe3s5-85D-1@gated-at.bofh.it> |
| In reply to | #1234381 |
On Mon, Sep 28, 2015 at 09:20:32PM +0200, Richard Weinberger wrote:
> On Mon, Sep 28, 2015 at 4:53 PM, Yaowei Bai <bywxiaobai@163.com> wrote:
> > As new_valid_dev always returns 1, so new_valid_dev check is not
> > needed, remove it.
> >
> > Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
> > ---
> > fs/ubifs/dir.c | 3 ---
> > fs/ubifs/misc.h | 9 ++-------
> > 2 files changed, 2 insertions(+), 10 deletions(-)
> >
> > diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
> > index 5c27c66..1dd9267 100644
> > --- a/fs/ubifs/dir.c
> > +++ b/fs/ubifs/dir.c
> > @@ -787,9 +787,6 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
> >
> > dbg_gen("dent '%pd' in dir ino %lu", dentry, dir->i_ino);
> >
> > - if (!new_valid_dev(rdev))
> > - return -EINVAL;
> > -
> > if (S_ISBLK(mode) || S_ISCHR(mode)) {
> > dev = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS);
> > if (!dev)
> > diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h
> > index ee7cb5e..0197ed6 100644
> > --- a/fs/ubifs/misc.h
> > +++ b/fs/ubifs/misc.h
> > @@ -155,13 +155,8 @@ static inline int ubifs_wbuf_sync(struct ubifs_wbuf *wbuf)
> > */
> > static inline int ubifs_encode_dev(union ubifs_dev_desc *dev, dev_t rdev)
> > {
> > - if (new_valid_dev(rdev)) {
> > - dev->new = cpu_to_le32(new_encode_dev(rdev));
> > - return sizeof(dev->new);
> > - } else {
> > - dev->huge = cpu_to_le64(huge_encode_dev(rdev));
> > - return sizeof(dev->huge);
> > - }
> > + dev->huge = cpu_to_le64(huge_encode_dev(rdev));
> > + return sizeof(dev->huge);
>
> Please be careful.
>
> dev->new = cpu_to_le32(new_encode_dev(rdev));
> return sizeof(dev->huge);
>
> ...is the correct branch. You enabled the dead one.
Sorry about that, will resend fixing it. Thanks.
>
> --
> Thanks,
> //richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yaowei Bai <bywxiaobai@163.com> |
|---|---|
| Date | 2015-09-28 17:00 +0200 |
| Subject | [PATCH 15/17] fs/reiserfs: remove unnecessary new_valid_dev check |
| Message-ID | <qdI4j-2z9-17@gated-at.bofh.it> |
| In reply to | #1234161 |
As new_valid_dev always returns 1, so !new_valid_dev check is not needed, remove it. Signed-off-by: Yaowei Bai <bywxiaobai@163.com> --- fs/reiserfs/namei.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index 5f1c9c2..47f9698 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c @@ -712,9 +712,6 @@ static int reiserfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode 2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) + REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb)); - if (!new_valid_dev(rdev)) - return -EINVAL; - retval = dquot_initialize(dir); if (retval) return retval; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yaowei Bai <bywxiaobai@163.com> |
|---|---|
| Date | 2015-09-28 17:00 +0200 |
| Subject | [PATCH 16/17] fs/stat: remove unnecessary new_valid_dev check |
| Message-ID | <qdI4j-2z9-29@gated-at.bofh.it> |
| In reply to | #1234161 |
As new_valid_dev always returns 1, so !new_valid_dev check is not needed, remove it. Signed-off-by: Yaowei Bai <bywxiaobai@163.com> --- fs/stat.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/stat.c b/fs/stat.c index cccc1aa..d4a61d8 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -367,8 +367,6 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf) INIT_STRUCT_STAT64_PADDING(tmp); #ifdef CONFIG_MIPS /* mips has weird padding, so we don't get 64 bits there */ - if (!new_valid_dev(stat->dev) || !new_valid_dev(stat->rdev)) - return -EOVERFLOW; tmp.st_dev = new_encode_dev(stat->dev); tmp.st_rdev = new_encode_dev(stat->rdev); #else -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yaowei Bai <bywxiaobai@163.com> |
|---|---|
| Date | 2015-09-29 16:10 +0200 |
| Subject | [PATCH] fs/ubifs: remove unnecessary new_valid_dev check |
| Message-ID | <qe3Ls-gh-7@gated-at.bofh.it> |
| In reply to | #1234161 |
As currently new_valid_dev always returns 1, so new_valid_dev check is not
needed, remove it.
Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
---
fs/ubifs/dir.c | 3 ---
fs/ubifs/misc.h | 9 ++-------
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index 5c27c66..1dd9267 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -787,9 +787,6 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
dbg_gen("dent '%pd' in dir ino %lu", dentry, dir->i_ino);
- if (!new_valid_dev(rdev))
- return -EINVAL;
-
if (S_ISBLK(mode) || S_ISCHR(mode)) {
dev = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS);
if (!dev)
diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h
index ee7cb5e..8ece6ca 100644
--- a/fs/ubifs/misc.h
+++ b/fs/ubifs/misc.h
@@ -155,13 +155,8 @@ static inline int ubifs_wbuf_sync(struct ubifs_wbuf *wbuf)
*/
static inline int ubifs_encode_dev(union ubifs_dev_desc *dev, dev_t rdev)
{
- if (new_valid_dev(rdev)) {
- dev->new = cpu_to_le32(new_encode_dev(rdev));
- return sizeof(dev->new);
- } else {
- dev->huge = cpu_to_le64(huge_encode_dev(rdev));
- return sizeof(dev->huge);
- }
+ dev->new = cpu_to_le32(new_encode_dev(rdev));
+ return sizeof(dev->new);
}
/**
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Richard Weinberger <richard.weinberger@gmail.com> |
|---|---|
| Date | 2015-09-30 10:20 +0200 |
| Subject | Re: [PATCH] fs/ubifs: remove unnecessary new_valid_dev check |
| Message-ID | <qekMj-7IF-19@gated-at.bofh.it> |
| In reply to | #1235125 |
On Tue, Sep 29, 2015 at 3:57 PM, Yaowei Bai <bywxiaobai@163.com> wrote:
> As currently new_valid_dev always returns 1, so new_valid_dev check is not
> needed, remove it.
>
> Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
> ---
> fs/ubifs/dir.c | 3 ---
> fs/ubifs/misc.h | 9 ++-------
> 2 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
> index 5c27c66..1dd9267 100644
> --- a/fs/ubifs/dir.c
> +++ b/fs/ubifs/dir.c
> @@ -787,9 +787,6 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
>
> dbg_gen("dent '%pd' in dir ino %lu", dentry, dir->i_ino);
>
> - if (!new_valid_dev(rdev))
> - return -EINVAL;
> -
> if (S_ISBLK(mode) || S_ISCHR(mode)) {
> dev = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS);
> if (!dev)
> diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h
> index ee7cb5e..8ece6ca 100644
> --- a/fs/ubifs/misc.h
> +++ b/fs/ubifs/misc.h
> @@ -155,13 +155,8 @@ static inline int ubifs_wbuf_sync(struct ubifs_wbuf *wbuf)
> */
> static inline int ubifs_encode_dev(union ubifs_dev_desc *dev, dev_t rdev)
> {
> - if (new_valid_dev(rdev)) {
> - dev->new = cpu_to_le32(new_encode_dev(rdev));
> - return sizeof(dev->new);
> - } else {
> - dev->huge = cpu_to_le64(huge_encode_dev(rdev));
> - return sizeof(dev->huge);
> - }
> + dev->new = cpu_to_le32(new_encode_dev(rdev));
> + return sizeof(dev->new);
> }
Reviewed-by: Richard Weinberger <richard@nod.at>
--
Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Artem Bityutskiy <dedekind1@gmail.com> |
|---|---|
| Date | 2015-10-01 15:40 +0200 |
| Subject | Re: [PATCH] fs/ubifs: remove unnecessary new_valid_dev check |
| Message-ID | <qeMfw-5PR-3@gated-at.bofh.it> |
| In reply to | #1235877 |
On Wed, 2015-09-30 at 10:11 +0200, Richard Weinberger wrote:
> > {
> > - if (new_valid_dev(rdev)) {
> > - dev->new = cpu_to_le32(new_encode_dev(rdev));
> > - return sizeof(dev->new);
> > - } else {
> > - dev->huge = cpu_to_le64(huge_encode_dev(rdev));
> > - return sizeof(dev->huge);
> > - }
> > + dev->new = cpu_to_le32(new_encode_dev(rdev));
> > + return sizeof(dev->new);
> > }
>
> Reviewed-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | linux.kernel
csiph-web