dm-crypt.c (fd7c092e711ebab55b2688d3859d95dfd0301f73) dm-crypt.c (55a62eef8d1b50ceff3b7bf46851103bdcc7e5b0)
1/*
2 * Copyright (C) 2003 Christophe Saout <christophe@saout.de>
3 * Copyright (C) 2004 Clemens Fruhwirth <clemens@endorphin.org>
4 * Copyright (C) 2006-2009 Red Hat, Inc. All rights reserved.
5 *
6 * This file is released under the GPL.
7 */
8

--- 1623 unchanged lines hidden (view full) ---

1632 ret = dm_read_arg_group(_args, &as, &opt_params, &ti->error);
1633 if (ret)
1634 goto bad;
1635
1636 opt_string = dm_shift_arg(&as);
1637
1638 if (opt_params == 1 && opt_string &&
1639 !strcasecmp(opt_string, "allow_discards"))
1/*
2 * Copyright (C) 2003 Christophe Saout <christophe@saout.de>
3 * Copyright (C) 2004 Clemens Fruhwirth <clemens@endorphin.org>
4 * Copyright (C) 2006-2009 Red Hat, Inc. All rights reserved.
5 *
6 * This file is released under the GPL.
7 */
8

--- 1623 unchanged lines hidden (view full) ---

1632 ret = dm_read_arg_group(_args, &as, &opt_params, &ti->error);
1633 if (ret)
1634 goto bad;
1635
1636 opt_string = dm_shift_arg(&as);
1637
1638 if (opt_params == 1 && opt_string &&
1639 !strcasecmp(opt_string, "allow_discards"))
1640 ti->num_discard_requests = 1;
1640 ti->num_discard_bios = 1;
1641 else if (opt_params) {
1642 ret = -EINVAL;
1643 ti->error = "Invalid feature arguments";
1644 goto bad;
1645 }
1646 }
1647
1648 ret = -ENOMEM;

--- 11 unchanged lines hidden (view full) ---

1660 WQ_CPU_INTENSIVE|
1661 WQ_MEM_RECLAIM,
1662 1);
1663 if (!cc->crypt_queue) {
1664 ti->error = "Couldn't create kcryptd queue";
1665 goto bad;
1666 }
1667
1641 else if (opt_params) {
1642 ret = -EINVAL;
1643 ti->error = "Invalid feature arguments";
1644 goto bad;
1645 }
1646 }
1647
1648 ret = -ENOMEM;

--- 11 unchanged lines hidden (view full) ---

1660 WQ_CPU_INTENSIVE|
1661 WQ_MEM_RECLAIM,
1662 1);
1663 if (!cc->crypt_queue) {
1664 ti->error = "Couldn't create kcryptd queue";
1665 goto bad;
1666 }
1667
1668 ti->num_flush_requests = 1;
1668 ti->num_flush_bios = 1;
1669 ti->discard_zeroes_data_unsupported = true;
1670
1671 return 0;
1672
1673bad:
1674 crypt_dtr(ti);
1675 return ret;
1676}

--- 44 unchanged lines hidden (view full) ---

1721 for (i = 0; i < cc->key_size; i++)
1722 DMEMIT("%02x", cc->key[i]);
1723 else
1724 DMEMIT("-");
1725
1726 DMEMIT(" %llu %s %llu", (unsigned long long)cc->iv_offset,
1727 cc->dev->name, (unsigned long long)cc->start);
1728
1669 ti->discard_zeroes_data_unsupported = true;
1670
1671 return 0;
1672
1673bad:
1674 crypt_dtr(ti);
1675 return ret;
1676}

--- 44 unchanged lines hidden (view full) ---

1721 for (i = 0; i < cc->key_size; i++)
1722 DMEMIT("%02x", cc->key[i]);
1723 else
1724 DMEMIT("-");
1725
1726 DMEMIT(" %llu %s %llu", (unsigned long long)cc->iv_offset,
1727 cc->dev->name, (unsigned long long)cc->start);
1728
1729 if (ti->num_discard_requests)
1729 if (ti->num_discard_bios)
1730 DMEMIT(" 1 allow_discards");
1731
1732 break;
1733 }
1734}
1735
1736static void crypt_postsuspend(struct dm_target *ti)
1737{

--- 132 unchanged lines hidden ---
1730 DMEMIT(" 1 allow_discards");
1731
1732 break;
1733 }
1734}
1735
1736static void crypt_postsuspend(struct dm_target *ti)
1737{

--- 132 unchanged lines hidden ---