All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: Re: [PATCH v2 2/3] efidisk: implement alignment-respecting malloc function
Date: Wed, 2 Mar 2016 06:46:52 +0300	[thread overview]
Message-ID: <56D6622C.9030909@gmail.com> (raw)
In-Reply-To: <1456877652-19389-3-git-send-email-leif.lindholm@linaro.org>

02.03.2016 03:14, Leif Lindholm пишет:
> Implement a driver-specific malloc function that allocates a buffer
> with the alignment specified by grub_efi_block_io_media structure.
> ---
>  grub-core/disk/efi/efidisk.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c
> index 3b79f7b..ac99ea7 100644
> --- a/grub-core/disk/efi/efidisk.c
> +++ b/grub-core/disk/efi/efidisk.c
> @@ -457,6 +457,13 @@ get_device (struct grub_efidisk_data *devices, int num)
>    return 0;
>  }
>  
> +static void *
> +aligned_malloc (struct grub_disk *disk, grub_size_t size)
> +{
> +  struct grub_efidisk_data *d = disk->data;
> +  return grub_memalign (d->block_io->media->io_align, size);
> +}
> +
>  static grub_err_t
>  grub_efidisk_open (const char *name, struct grub_disk *disk)
>  {
> @@ -512,6 +519,7 @@ grub_efidisk_open (const char *name, struct grub_disk *disk)
>         (1U << disk->log_sector_size) < m->block_size;
>         disk->log_sector_size++);
>    disk->data = d;
> +  disk->malloc = aligned_malloc;
>  
>    grub_dprintf ("efidisk", "opening %s succeeded\n", name);
>  
> 


Did you drop sanity check in grub_efidisk_open intentionally?


  reply	other threads:[~2016-03-02  3:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02  0:14 [PATCH v2 0/3] some disk reworking reposted Leif Lindholm
2016-03-02  0:14 ` [PATCH v2 1/3] disk: Add support for device-specific malloc function Leif Lindholm
2016-03-02  0:14 ` [PATCH v2 2/3] efidisk: implement alignment-respecting " Leif Lindholm
2016-03-02  3:46   ` Andrei Borzenkov [this message]
2016-03-02 14:00     ` Leif Lindholm
2016-03-02  0:14 ` [PATCH v2 3/3] disk: read into cache directly Leif Lindholm
2016-03-02  0:22   ` Vladimir 'phcoder' Serbinenko
2016-03-02  3:46     ` Andrei Borzenkov
2016-03-02  9:55       ` Vladimir 'phcoder' Serbinenko
2016-03-03  0:04   ` Elliott, Robert (Persistent Memory)

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=56D6622C.9030909@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    /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.