Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HPFS: Remove CR/LF conversion option

Remove CR/LF conversion option

It is unused anyway. It was used on 2.2 kernels or so.

Signed-off-by: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mikulas Patocka and committed by
Linus Torvalds
0fe105aa 7d23ce36

+7 -75
-2
fs/hpfs/dir.c
··· 250 250 hpfs_result = hpfs_i(result); 251 251 if (!de->directory) hpfs_result->i_parent_dir = dir->i_ino; 252 252 253 - hpfs_decide_conv(result, name, len); 254 - 255 253 if (de->has_acl || de->has_xtd_perm) if (!(dir->i_sb->s_flags & MS_RDONLY)) { 256 254 hpfs_error(result->i_sb, "ACLs or XPERM found. This is probably HPFS386. This driver doesn't support it now. Send me some info on these structures"); 257 255 goto bail1;
-11
fs/hpfs/hpfs_fn.h
··· 51 51 unsigned i_disk_sec; /* (files) minimalist cache of alloc info */ 52 52 unsigned i_n_secs; /* (files) minimalist cache of alloc info */ 53 53 unsigned i_ea_size; /* size of extended attributes */ 54 - unsigned i_conv : 2; /* (files) crlf->newline hackery */ 55 54 unsigned i_ea_mode : 1; /* file's permission is stored in ea */ 56 55 unsigned i_ea_uid : 1; /* file's uid is stored in ea */ 57 56 unsigned i_ea_gid : 1; /* file's gid is stored in ea */ ··· 72 73 uid_t sb_uid; /* uid from mount options */ 73 74 gid_t sb_gid; /* gid from mount options */ 74 75 umode_t sb_mode; /* mode from mount options */ 75 - unsigned sb_conv : 2; /* crlf->newline hackery */ 76 76 unsigned sb_eas : 2; /* eas: 0-ignore, 1-ro, 2-rw */ 77 77 unsigned sb_err : 2; /* on errs: 0-cont, 1-ro, 2-panic */ 78 78 unsigned sb_chk : 2; /* checks: 0-no, 1-normal, 2-strict */ ··· 87 89 /*unsigned sb_mounting : 1;*/ 88 90 int sb_timeshift; 89 91 }; 90 - 91 - /* 92 - * conv= options 93 - */ 94 - 95 - #define CONV_BINARY 0 /* no conversion */ 96 - #define CONV_TEXT 1 /* crlf->newline */ 97 - #define CONV_AUTO 2 /* decide based on file contents */ 98 92 99 93 /* Four 512-byte buffers and the 2k block obtained by concatenating them */ 100 94 ··· 288 298 const unsigned char *, unsigned, int); 289 299 int hpfs_is_name_long(const unsigned char *, unsigned); 290 300 void hpfs_adjust_length(const unsigned char *, unsigned *); 291 - void hpfs_decide_conv(struct inode *, const unsigned char *, unsigned); 292 301 293 302 /* namei.c */ 294 303
-1
fs/hpfs/inode.c
··· 17 17 i->i_uid = hpfs_sb(sb)->sb_uid; 18 18 i->i_gid = hpfs_sb(sb)->sb_gid; 19 19 i->i_mode = hpfs_sb(sb)->sb_mode; 20 - hpfs_inode->i_conv = hpfs_sb(sb)->sb_conv; 21 20 i->i_size = -1; 22 21 i->i_blocks = -1; 23 22
-33
fs/hpfs/name.c
··· 8 8 9 9 #include "hpfs_fn.h" 10 10 11 - static const char *text_postfix[]={ 12 - ".ASM", ".BAS", ".BAT", ".C", ".CC", ".CFG", ".CMD", ".CON", ".CPP", ".DEF", 13 - ".DOC", ".DPR", ".ERX", ".H", ".HPP", ".HTM", ".HTML", ".JAVA", ".LOG", ".PAS", 14 - ".RC", ".TEX", ".TXT", ".Y", ""}; 15 - 16 - static const char *text_prefix[]={ 17 - "AUTOEXEC.", "CHANGES", "COPYING", "CONFIG.", "CREDITS", "FAQ", "FILE_ID.DIZ", 18 - "MAKEFILE", "READ.ME", "README", "TERMCAP", ""}; 19 - 20 - void hpfs_decide_conv(struct inode *inode, const unsigned char *name, unsigned len) 21 - { 22 - struct hpfs_inode_info *hpfs_inode = hpfs_i(inode); 23 - int i; 24 - if (hpfs_inode->i_conv != CONV_AUTO) return; 25 - for (i = 0; *text_postfix[i]; i++) { 26 - int l = strlen(text_postfix[i]); 27 - if (l <= len) 28 - if (!hpfs_compare_names(inode->i_sb, text_postfix[i], l, name + len - l, l, 0)) 29 - goto text; 30 - } 31 - for (i = 0; *text_prefix[i]; i++) { 32 - int l = strlen(text_prefix[i]); 33 - if (l <= len) 34 - if (!hpfs_compare_names(inode->i_sb, text_prefix[i], l, name, l, 0)) 35 - goto text; 36 - } 37 - hpfs_inode->i_conv = CONV_BINARY; 38 - return; 39 - text: 40 - hpfs_inode->i_conv = CONV_TEXT; 41 - return; 42 - } 43 - 44 11 static inline int not_allowed_char(unsigned char c) 45 12 { 46 13 return c<' ' || c=='"' || c=='*' || c=='/' || c==':' || c=='<' ||
-3
fs/hpfs/namei.c
··· 151 151 result->i_op = &hpfs_file_iops; 152 152 result->i_fop = &hpfs_file_ops; 153 153 result->i_nlink = 1; 154 - hpfs_decide_conv(result, name, len); 155 154 hpfs_i(result)->i_parent_dir = dir->i_ino; 156 155 result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, dee.creation_date); 157 156 result->i_ctime.tv_nsec = 0; ··· 615 616 mark_buffer_dirty(bh); 616 617 brelse(bh); 617 618 } 618 - hpfs_i(i)->i_conv = hpfs_sb(i->i_sb)->sb_conv; 619 - hpfs_decide_conv(i, new_name, new_len); 620 619 end1: 621 620 hpfs_unlock(i->i_sb); 622 621 return err;
+7 -25
fs/hpfs/super.c
··· 219 219 220 220 enum { 221 221 Opt_help, Opt_uid, Opt_gid, Opt_umask, Opt_case_lower, Opt_case_asis, 222 - Opt_conv_binary, Opt_conv_text, Opt_conv_auto, 223 222 Opt_check_none, Opt_check_normal, Opt_check_strict, 224 223 Opt_err_cont, Opt_err_ro, Opt_err_panic, 225 224 Opt_eas_no, Opt_eas_ro, Opt_eas_rw, ··· 233 234 {Opt_umask, "umask=%o"}, 234 235 {Opt_case_lower, "case=lower"}, 235 236 {Opt_case_asis, "case=asis"}, 236 - {Opt_conv_binary, "conv=binary"}, 237 - {Opt_conv_text, "conv=text"}, 238 - {Opt_conv_auto, "conv=auto"}, 239 237 {Opt_check_none, "check=none"}, 240 238 {Opt_check_normal, "check=normal"}, 241 239 {Opt_check_strict, "check=strict"}, ··· 250 254 }; 251 255 252 256 static int parse_opts(char *opts, uid_t *uid, gid_t *gid, umode_t *umask, 253 - int *lowercase, int *conv, int *eas, int *chk, int *errs, 257 + int *lowercase, int *eas, int *chk, int *errs, 254 258 int *chkdsk, int *timeshift) 255 259 { 256 260 char *p; ··· 291 295 break; 292 296 case Opt_case_asis: 293 297 *lowercase = 0; 294 - break; 295 - case Opt_conv_binary: 296 - *conv = CONV_BINARY; 297 - break; 298 - case Opt_conv_text: 299 - *conv = CONV_TEXT; 300 - break; 301 - case Opt_conv_auto: 302 - *conv = CONV_AUTO; 303 298 break; 304 299 case Opt_check_none: 305 300 *chk = 0; ··· 358 371 umask=xxx set mode of files that don't have mode specified in eas\n\ 359 372 case=lower lowercase all files\n\ 360 373 case=asis do not lowercase files (default)\n\ 361 - conv=binary do not convert CR/LF -> LF (default)\n\ 362 - conv=auto convert only files with known text extensions\n\ 363 - conv=text convert all files\n\ 364 374 check=none no fs checks - kernel may crash on corrupted filesystem\n\ 365 375 check=normal do some checks - it should not crash (default)\n\ 366 376 check=strict do extra time-consuming checks, used for debugging\n\ ··· 379 395 uid_t uid; 380 396 gid_t gid; 381 397 umode_t umask; 382 - int lowercase, conv, eas, chk, errs, chkdsk, timeshift; 398 + int lowercase, eas, chk, errs, chkdsk, timeshift; 383 399 int o; 384 400 struct hpfs_sb_info *sbi = hpfs_sb(s); 385 401 char *new_opts = kstrdup(data, GFP_KERNEL); ··· 390 406 lock_super(s); 391 407 uid = sbi->sb_uid; gid = sbi->sb_gid; 392 408 umask = 0777 & ~sbi->sb_mode; 393 - lowercase = sbi->sb_lowercase; conv = sbi->sb_conv; 409 + lowercase = sbi->sb_lowercase; 394 410 eas = sbi->sb_eas; chk = sbi->sb_chk; chkdsk = sbi->sb_chkdsk; 395 411 errs = sbi->sb_err; timeshift = sbi->sb_timeshift; 396 412 397 - if (!(o = parse_opts(data, &uid, &gid, &umask, &lowercase, &conv, 413 + if (!(o = parse_opts(data, &uid, &gid, &umask, &lowercase, 398 414 &eas, &chk, &errs, &chkdsk, &timeshift))) { 399 415 printk("HPFS: bad mount options.\n"); 400 416 goto out_err; ··· 412 428 413 429 sbi->sb_uid = uid; sbi->sb_gid = gid; 414 430 sbi->sb_mode = 0777 & ~umask; 415 - sbi->sb_lowercase = lowercase; sbi->sb_conv = conv; 431 + sbi->sb_lowercase = lowercase; 416 432 sbi->sb_eas = eas; sbi->sb_chk = chk; sbi->sb_chkdsk = chkdsk; 417 433 sbi->sb_err = errs; sbi->sb_timeshift = timeshift; 418 434 ··· 456 472 uid_t uid; 457 473 gid_t gid; 458 474 umode_t umask; 459 - int lowercase, conv, eas, chk, errs, chkdsk, timeshift; 475 + int lowercase, eas, chk, errs, chkdsk, timeshift; 460 476 461 477 dnode_secno root_dno; 462 478 struct hpfs_dirent *de = NULL; ··· 482 498 gid = current_gid(); 483 499 umask = current_umask(); 484 500 lowercase = 0; 485 - conv = CONV_BINARY; 486 501 eas = 2; 487 502 chk = 1; 488 503 errs = 1; 489 504 chkdsk = 1; 490 505 timeshift = 0; 491 506 492 - if (!(o = parse_opts(options, &uid, &gid, &umask, &lowercase, &conv, 507 + if (!(o = parse_opts(options, &uid, &gid, &umask, &lowercase, 493 508 &eas, &chk, &errs, &chkdsk, &timeshift))) { 494 509 printk("HPFS: bad mount options.\n"); 495 510 goto bail0; ··· 541 558 sbi->sb_n_free = -1; 542 559 sbi->sb_n_free_dnodes = -1; 543 560 sbi->sb_lowercase = lowercase; 544 - sbi->sb_conv = conv; 545 561 sbi->sb_eas = eas; 546 562 sbi->sb_chk = chk; 547 563 sbi->sb_chkdsk = chkdsk;