All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] Introduced btrfs file-system with btrload command
Date: Thu, 14 Feb 2013 14:32:45 +0100	[thread overview]
Message-ID: <511CE77D.5010907@denx.de> (raw)
In-Reply-To: <1360847055-7480-2-git-send-email-adnan.ali@codethink.co.uk>

On 14.02.2013 14:04, Adnan Ali wrote:
> Introduces btrfs file-system to read file
> from volume/sub-volumes with btrload command. This
> implementation has read-only support.
> This btrfs implementation is based on syslinux btrfs
> code.

Signed-off-by missing. And could you please add a more complete/exact
comment about the source of this code (revision etc). Please see:

http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign

More comments below (apart from Otavio's):

> ---
>  Makefile                   |    3 +-
>  common/Makefile            |    1 +
>  common/cmd_btr.c           |   52 ++
>  fs/btrfs/Makefile          |   51 ++
>  fs/btrfs/btrfs.c           | 1131 ++++++++++++++++++++++++++++++++++++++++++++
>  fs/fs.c                    |  117 ++++-
>  include/btrfs.h            |  398 ++++++++++++++++
>  include/config_fallbacks.h |    4 +
>  include/crc32c.h           |   48 ++
>  include/fs.h               |    1 +
>  10 files changed, 1786 insertions(+), 20 deletions(-)
>  create mode 100644 common/cmd_btr.c
>  create mode 100644 fs/btrfs/Makefile
>  create mode 100644 fs/btrfs/btrfs.c
>  create mode 100644 include/btrfs.h
>  create mode 100644 include/crc32c.h
> 
> diff --git a/Makefile b/Makefile
> index 3305e8c..a34905e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -261,6 +261,7 @@ endif
>  LIBS-$(CONFIG_OF_EMBED) += dts/libdts.o
>  LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
>  LIBS-y += fs/libfs.o \
> +        fs/btrfs/libbtrfs.o \
>  	fs/cbfs/libcbfs.o \
>  	fs/cramfs/libcramfs.o \
>  	fs/ext4/libext4fs.o \
> @@ -270,7 +271,7 @@ LIBS-y += fs/libfs.o \
>  	fs/reiserfs/libreiserfs.o \
>  	fs/ubifs/libubifs.o \
>  	fs/yaffs2/libyaffs2.o \
> -	fs/zfs/libzfs.o
> +	fs/zfs/libzfs.o 
>  LIBS-y += net/libnet.o
>  LIBS-y += disk/libdisk.o
>  LIBS-y += drivers/bios_emulator/libatibiosemu.o
> diff --git a/common/Makefile b/common/Makefile
> index 54fcc81..c7af839 100644
> --- a/common/Makefile
> +++ b/common/Makefile
> @@ -96,6 +96,7 @@ COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_exit.o
>  COBJS-$(CONFIG_CMD_EXT4) += cmd_ext4.o
>  COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
>  COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
> +COBJS-$(CONFIG_CMD_BTR) += cmd_btr.o

Again, please keep this list alphabetically sorted.

>  COBJS-$(CONFIG_CMD_FDC)$(CONFIG_CMD_FDOS) += cmd_fdc.o
>  COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o
>  COBJS-$(CONFIG_CMD_FDOS) += cmd_fdos.o
> diff --git a/common/cmd_btr.c b/common/cmd_btr.c
> new file mode 100644
> index 0000000..f65261c
> --- /dev/null
> +++ b/common/cmd_btr.c
> @@ -0,0 +1,52 @@
> +/*
> + * (C) Copyright 2013 Codethink Limited
> + * Btrfs port to Uboot by
> + * Adnan Ali <adnan.ali@codethink.co.uk>
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +/*
> + * Boot support
> + */
> +#include <fs.h>
> +#include <btrfs.h>
> +
> +char SubvolName[MAX_SUBVOL_NAME];

No ChamelCase please. This is most likely code not copied from
syslinux, so all rules for coding style apply here.

> +
> +int do_btr_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> +{
> +        if(argc>5)
> +          strcpy(SubvolName, argv[5]); 

Indention.

> +        else strcpy(SubvolName, ""); //no subvol defined

No "//" comments.

> +
> +        return do_load(cmdtp, flag, argc, argv, FS_TYPE_BTR, 16);
> +}
> +
> +
> +U_BOOT_CMD(
> +        btrload,        7,      0,      do_btr_fsload,
> +        "load binary file from a btr filesystem",
> +        "<interface> [<dev[:part]>]  <addr> <filename> [subvol_name]\n"
> +        "    - Load binary file 'filename' from 'dev' on 'interface'\n"
> +        "      to address 'addr' from better filesystem.\n"
> +        "      the load stops on end of file.\n"
> +        "      subvol_name is used read that file from this subvolume.\n"
> +        "      All numeric parameters are assumed to be hex."
> +);

I suggest you run this file through checkpatch before the
next submission.

I didn't review the "real" btrfs support code for now (lack of
time now).

Best regards,
Stefan

  parent reply	other threads:[~2013-02-14 13:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14 13:04 [U-Boot] [PATCH v2] btrfs addition to uboot Adnan Ali
2013-02-14 13:04 ` [U-Boot] [PATCH v2] Introduced btrfs file-system with btrload command Adnan Ali
2013-02-14 13:10   ` Otavio Salvador
2013-02-14 13:32   ` Stefan Roese [this message]
2013-02-14 14:35     ` Adnan Ali

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=511CE77D.5010907@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 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.