ctree.c (2d65685a4a6ff6ef6bfe42717222db92c04224c2) | ctree.c (ce6ef5abe68251cb60c4585df2cc73e218ec0dba) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2007,2008 Oracle. All rights reserved. 4 */ 5 6#include <linux/sched.h> 7#include <linux/slab.h> 8#include <linux/rbtree.h> --- 1487 unchanged lines hidden (view full) --- 1496{ 1497 if (blocknr < other && other - (blocknr + blocksize) < 32768) 1498 return 1; 1499 if (blocknr > other && blocknr - (other + blocksize) < 32768) 1500 return 1; 1501 return 0; 1502} 1503 | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2007,2008 Oracle. All rights reserved. 4 */ 5 6#include <linux/sched.h> 7#include <linux/slab.h> 8#include <linux/rbtree.h> --- 1487 unchanged lines hidden (view full) --- 1496{ 1497 if (blocknr < other && other - (blocknr + blocksize) < 32768) 1498 return 1; 1499 if (blocknr > other && blocknr - (other + blocksize) < 32768) 1500 return 1; 1501 return 0; 1502} 1503 |
1504#ifdef __LITTLE_ENDIAN 1505 |
|
1504/* | 1506/* |
1507 * Compare two keys, on little-endian the disk order is same as CPU order and 1508 * we can avoid the conversion. 1509 */ 1510static int comp_keys(const struct btrfs_disk_key *disk_key, 1511 const struct btrfs_key *k2) 1512{ 1513 const struct btrfs_key *k1 = (const struct btrfs_key *)disk_key; 1514 1515 return btrfs_comp_cpu_keys(k1, k2); 1516} 1517 1518#else 1519 1520/* |
|
1505 * compare two keys in a memcmp fashion 1506 */ 1507static int comp_keys(const struct btrfs_disk_key *disk, 1508 const struct btrfs_key *k2) 1509{ 1510 struct btrfs_key k1; 1511 1512 btrfs_disk_key_to_cpu(&k1, disk); 1513 1514 return btrfs_comp_cpu_keys(&k1, k2); 1515} | 1521 * compare two keys in a memcmp fashion 1522 */ 1523static int comp_keys(const struct btrfs_disk_key *disk, 1524 const struct btrfs_key *k2) 1525{ 1526 struct btrfs_key k1; 1527 1528 btrfs_disk_key_to_cpu(&k1, disk); 1529 1530 return btrfs_comp_cpu_keys(&k1, k2); 1531} |
1532#endif |
|
1516 1517/* 1518 * same as comp_keys only with two btrfs_key's 1519 */ 1520int __pure btrfs_comp_cpu_keys(const struct btrfs_key *k1, const struct btrfs_key *k2) 1521{ 1522 if (k1->objectid > k2->objectid) 1523 return 1; --- 3972 unchanged lines hidden --- | 1533 1534/* 1535 * same as comp_keys only with two btrfs_key's 1536 */ 1537int __pure btrfs_comp_cpu_keys(const struct btrfs_key *k1, const struct btrfs_key *k2) 1538{ 1539 if (k1->objectid > k2->objectid) 1540 return 1; --- 3972 unchanged lines hidden --- |