namei.c (b80697c14dcacd83ed1b78e26ad93b25ecc52c5e) namei.c (f845fced913b1437659bb5baf187698547697afe)
1/*
2 * namei.c
3 *
4 * PURPOSE
5 * Inode name handling routines for the OSTA-UDF(tm) filesystem.
6 *
7 * COPYRIGHT
8 * This file is distributed under the terms of the GNU General Public

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

26#include <linux/string.h>
27#include <linux/errno.h>
28#include <linux/mm.h>
29#include <linux/slab.h>
30#include <linux/quotaops.h>
31#include <linux/smp_lock.h>
32#include <linux/buffer_head.h>
33#include <linux/sched.h>
1/*
2 * namei.c
3 *
4 * PURPOSE
5 * Inode name handling routines for the OSTA-UDF(tm) filesystem.
6 *
7 * COPYRIGHT
8 * This file is distributed under the terms of the GNU General Public

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

26#include <linux/string.h>
27#include <linux/errno.h>
28#include <linux/mm.h>
29#include <linux/slab.h>
30#include <linux/quotaops.h>
31#include <linux/smp_lock.h>
32#include <linux/buffer_head.h>
33#include <linux/sched.h>
34#include <linux/crc-itu-t.h>
34
35static inline int udf_match(int len1, const char *name1, int len2,
36 const char *name2)
37{
38 if (len1 != len2)
39 return 0;
40
41 return !memcmp(name1, name2, len1);

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

92 memset((uint8_t *)sfi->padding + liu + lfi, 0x00, padlen);
93 } else if (offset >= 0) {
94 memset(fibh->ebh->b_data + offset, 0x00, padlen);
95 } else {
96 memset((uint8_t *)sfi->padding + liu + lfi, 0x00, -offset);
97 memset(fibh->ebh->b_data, 0x00, padlen + offset);
98 }
99
35
36static inline int udf_match(int len1, const char *name1, int len2,
37 const char *name2)
38{
39 if (len1 != len2)
40 return 0;
41
42 return !memcmp(name1, name2, len1);

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

93 memset((uint8_t *)sfi->padding + liu + lfi, 0x00, padlen);
94 } else if (offset >= 0) {
95 memset(fibh->ebh->b_data + offset, 0x00, padlen);
96 } else {
97 memset((uint8_t *)sfi->padding + liu + lfi, 0x00, -offset);
98 memset(fibh->ebh->b_data, 0x00, padlen + offset);
99 }
100
100 crc = udf_crc((uint8_t *)cfi + sizeof(tag),
101 sizeof(struct fileIdentDesc) - sizeof(tag), 0);
101 crc = crc_itu_t(0, (uint8_t *)cfi + sizeof(tag),
102 sizeof(struct fileIdentDesc) - sizeof(tag));
102
103 if (fibh->sbh == fibh->ebh) {
103
104 if (fibh->sbh == fibh->ebh) {
104 crc = udf_crc((uint8_t *)sfi->impUse,
105 crc = crc_itu_t(crc, (uint8_t *)sfi->impUse,
105 crclen + sizeof(tag) -
106 crclen + sizeof(tag) -
106 sizeof(struct fileIdentDesc), crc);
107 sizeof(struct fileIdentDesc));
107 } else if (sizeof(struct fileIdentDesc) >= -fibh->soffset) {
108 } else if (sizeof(struct fileIdentDesc) >= -fibh->soffset) {
108 crc = udf_crc(fibh->ebh->b_data +
109 crc = crc_itu_t(crc, fibh->ebh->b_data +
109 sizeof(struct fileIdentDesc) +
110 fibh->soffset,
111 crclen + sizeof(tag) -
110 sizeof(struct fileIdentDesc) +
111 fibh->soffset,
112 crclen + sizeof(tag) -
112 sizeof(struct fileIdentDesc),
113 crc);
113 sizeof(struct fileIdentDesc));
114 } else {
114 } else {
115 crc = udf_crc((uint8_t *)sfi->impUse,
116 -fibh->soffset - sizeof(struct fileIdentDesc),
117 crc);
118 crc = udf_crc(fibh->ebh->b_data, fibh->eoffset, crc);
115 crc = crc_itu_t(crc, (uint8_t *)sfi->impUse,
116 -fibh->soffset - sizeof(struct fileIdentDesc));
117 crc = crc_itu_t(crc, fibh->ebh->b_data, fibh->eoffset);
119 }
120
121 cfi->descTag.descCRC = cpu_to_le16(crc);
122 cfi->descTag.descCRCLength = cpu_to_le16(crclen);
123 cfi->descTag.tagChecksum = udf_tag_checksum(&cfi->descTag);
124
125 if (adinicb || (sizeof(struct fileIdentDesc) <= -fibh->soffset)) {
126 memcpy((uint8_t *)sfi, (uint8_t *)cfi,

--- 1120 unchanged lines hidden ---
118 }
119
120 cfi->descTag.descCRC = cpu_to_le16(crc);
121 cfi->descTag.descCRCLength = cpu_to_le16(crclen);
122 cfi->descTag.tagChecksum = udf_tag_checksum(&cfi->descTag);
123
124 if (adinicb || (sizeof(struct fileIdentDesc) <= -fibh->soffset)) {
125 memcpy((uint8_t *)sfi, (uint8_t *)cfi,

--- 1120 unchanged lines hidden ---