linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Andries.Brouwer@cwi.nl
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cryptoloop
Date: Thu, 3 Jul 2003 16:44:55 +0100	[thread overview]
Message-ID: <20030703164455.A4801@infradead.org> (raw)
In-Reply-To: <UTC200307021521.h62FLbw16702.aeb@smtp.cwi.nl>; from Andries.Brouwer@cwi.nl on Wed, Jul 02, 2003 at 05:21:37PM +0200

A general comment to the design of this code: imho we should rip
out the whole concept of transfer functions and go directly to
the cryptoapi algorithms - one level of unneeded abstractions
gone (the transfer funcs were never used for anything but X0R in
mainline and the interface is quite wrong as we could really
pass the page+offsets through).  If we finally decide to get rid
of this legacy junk I even volunteer to implemente a X0R cryptoapi
module :)

Some more nitpicking:

> +#include <linux/version.h>

not needed.

> +#include <linux/config.h>

dito.

> +static struct loop_func_table cryptoloop_funcs = {
> +	number:		LO_CRYPT_CRYPTOAPI,
> +	init:		cryptoloop_init,
> +	ioctl:		cryptoloop_ioctl,
> +	transfer:	cryptoloop_transfer,
> +	release:	cryptoloop_release,
> +	owner:		THIS_MODULE
> +};

please use C99-initializers.

> +	printk(KERN_INFO "cryptoloop: loaded\n");

isn't this a bit verbose?

> +	if (loop_unregister_transfer(LO_CRYPT_CRYPTOAPI))

how could this fail?

> +		printk(KERN_ERR
> +			"cryptoloop: unregistering transfer funcs failed\n");
> +
> +	printk(KERN_INFO "cryptoloop: unloaded\n");

dito.

> +	if (info->lo_encrypt_type == LO_CRYPT_CRYPTOAPI)
> +		memcpy(info64->lo_crypt_name, info->lo_name, LO_NAME_SIZE);
> +	else
> +		memcpy(info64->lo_file_name, info->lo_name, LO_NAME_SIZE);

this special-casing sounds like a bad idea.  I'd say anyone who wants
crypto support needs to use a losetup that uses the newstyle loop_info.
(Or did I get the context wrong?  diff -p helps a lot if you don't have
a recent kernel tree nearby..)


  parent reply	other threads:[~2003-07-03 15:30 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-02 15:21 [PATCH] cryptoloop Andries.Brouwer
2003-07-02 17:16 ` Andrew Morton
2003-07-03 15:44 ` Christoph Hellwig [this message]
2003-07-02 18:44 Andries.Brouwer
2003-07-02 19:02 ` Andrew Morton
2003-07-02 19:16   ` Linus Torvalds
2003-07-02 19:20     ` Andrew Morton
2003-07-02 19:31       ` Linus Torvalds
2003-07-03 11:21 ` Jari Ruusu
2003-07-03 15:20   ` Andrew Morton
2003-07-03 17:29     ` Jari Ruusu
2003-07-03 17:38       ` Chris Friesen
2003-07-04  7:43         ` Jari Ruusu
2003-07-04  8:44           ` Andrew Morton
2003-07-04  9:41           ` Christoph Hellwig
2003-07-05  8:41             ` Jari Ruusu
2003-07-05  8:58               ` Andrew Morton
2003-07-05  9:00                 ` Andre Hedrick
2003-07-05  9:10               ` Andre Hedrick
2003-07-05 17:16               ` James Morris
2003-07-05 17:20               ` Linus Torvalds
2003-07-08 12:43               ` Christoph Hellwig
2003-07-04  9:39       ` Christoph Hellwig
2003-07-03 16:20 ` Christoph Hellwig
2003-07-02 19:42 Andries.Brouwer
2003-07-02 19:58 ` Andrew Morton
2003-07-02 21:00 Andries.Brouwer
2003-07-02 21:06 ` Greg KH
2003-07-02 21:31 ` Andrew Morton
2003-07-03 16:23 ` Christoph Hellwig
2003-07-02 22:27 Andries.Brouwer
2003-07-02 22:57 Andries.Brouwer
2003-07-03 16:25 Andries.Brouwer
2003-07-03 16:31 ` Christoph Hellwig
2003-07-04 11:08 Andries.Brouwer
2003-07-04 12:13 ` Christoph Hellwig
2003-07-04 13:21 Andries.Brouwer
2003-07-04 13:28 ` Christoph Hellwig

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=20030703164455.A4801@infradead.org \
    --to=hch@infradead.org \
    --cc=Andries.Brouwer@cwi.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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 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).