lkml.org 
[lkml]   [2012]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 4/9] pstore: allow storing different type id's in ram backend
On Thu, Oct 18, 2012 at 02:06:02PM +0300, dragos.tatulea@intel.com wrote:
> From: Dragos Tatulea <dragos.tatulea@intel.com>
>
> Added pstore_type_id in message header when storing to ram.
> On write, take into account the contents of this header and
> set the type accordingly.
>
> Signed-off-by: Dragos Tatulea <dragos.tatulea@intel.com>
> ---
[...]
> -static size_t ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz)
> +static size_t ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz,
> + enum pstore_type_id type)
> {
> char *hdr;
> struct timeval timestamp;
> size_t len;
>
> do_gettimeofday(&timestamp);
> - hdr = kasprintf(GFP_ATOMIC, RAMOOPS_KERNMSG_HDR "%lu.%lu\n",
> - (long)timestamp.tv_sec, (long)timestamp.tv_usec);
> + hdr = kasprintf(GFP_ATOMIC, "%u" RAMOOPS_KERNMSG_HDR "%lu.%lu\n",
> + type, (long)timestamp.tv_sec, (long)timestamp.tv_usec);

This will probably break scripts (and the main purpose for the header is
to make it somewhat scripts-parsable). It's safer to change it to

RAMOOPS_KERNMSG_HDR "%lu.%lu %u"

Thanks,
Anton.


\
 
 \ /
  Last update: 2012-11-18 03:41    [W:0.069 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site