Skip to content

Commit 0fe105a

Browse files
Mikulas Patockatorvalds
authored andcommitted
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>
1 parent 7d23ce3 commit 0fe105a

6 files changed

Lines changed: 7 additions & 75 deletions

File tree

‎fs/hpfs/dir.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,6 @@ struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, struct name
250250
hpfs_result = hpfs_i(result);
251251
if (!de->directory) hpfs_result->i_parent_dir = dir->i_ino;
252252

253-
hpfs_decide_conv(result, name, len);
254-
255253
if (de->has_acl || de->has_xtd_perm) if (!(dir->i_sb->s_flags & MS_RDONLY)) {
256254
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");
257255
goto bail1;

‎fs/hpfs/hpfs_fn.h‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ struct hpfs_inode_info {
5151
unsigned i_disk_sec; /* (files) minimalist cache of alloc info */
5252
unsigned i_n_secs; /* (files) minimalist cache of alloc info */
5353
unsigned i_ea_size; /* size of extended attributes */
54-
unsigned i_conv : 2; /* (files) crlf->newline hackery */
5554
unsigned i_ea_mode : 1; /* file's permission is stored in ea */
5655
unsigned i_ea_uid : 1; /* file's uid is stored in ea */
5756
unsigned i_ea_gid : 1; /* file's gid is stored in ea */
@@ -73,7 +72,6 @@ struct hpfs_sb_info {
7372
uid_t sb_uid; /* uid from mount options */
7473
gid_t sb_gid; /* gid from mount options */
7574
umode_t sb_mode; /* mode from mount options */
76-
unsigned sb_conv : 2; /* crlf->newline hackery */
7775
unsigned sb_eas : 2; /* eas: 0-ignore, 1-ro, 2-rw */
7876
unsigned sb_err : 2; /* on errs: 0-cont, 1-ro, 2-panic */
7977
unsigned sb_chk : 2; /* checks: 0-no, 1-normal, 2-strict */
@@ -90,14 +88,6 @@ struct hpfs_sb_info {
9088
int sb_timeshift;
9189
};
9290

93-
/*
94-
* conv= options
95-
*/
96-
97-
#define CONV_BINARY 0 /* no conversion */
98-
#define CONV_TEXT 1 /* crlf->newline */
99-
#define CONV_AUTO 2 /* decide based on file contents */
100-
10191
/* Four 512-byte buffers and the 2k block obtained by concatenating them */
10292

10393
struct quad_buffer_head {
@@ -298,7 +288,6 @@ int hpfs_compare_names(struct super_block *, const unsigned char *, unsigned,
298288
const unsigned char *, unsigned, int);
299289
int hpfs_is_name_long(const unsigned char *, unsigned);
300290
void hpfs_adjust_length(const unsigned char *, unsigned *);
301-
void hpfs_decide_conv(struct inode *, const unsigned char *, unsigned);
302291

303292
/* namei.c */
304293

‎fs/hpfs/inode.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ void hpfs_init_inode(struct inode *i)
1717
i->i_uid = hpfs_sb(sb)->sb_uid;
1818
i->i_gid = hpfs_sb(sb)->sb_gid;
1919
i->i_mode = hpfs_sb(sb)->sb_mode;
20-
hpfs_inode->i_conv = hpfs_sb(sb)->sb_conv;
2120
i->i_size = -1;
2221
i->i_blocks = -1;
2322

‎fs/hpfs/name.c‎

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,6 @@
88

99
#include "hpfs_fn.h"
1010

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-
4411
static inline int not_allowed_char(unsigned char c)
4512
{
4613
return c<' ' || c=='"' || c=='*' || c=='/' || c==':' || c=='<' ||

‎fs/hpfs/namei.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ static int hpfs_create(struct inode *dir, struct dentry *dentry, int mode, struc
151151
result->i_op = &hpfs_file_iops;
152152
result->i_fop = &hpfs_file_ops;
153153
result->i_nlink = 1;
154-
hpfs_decide_conv(result, name, len);
155154
hpfs_i(result)->i_parent_dir = dir->i_ino;
156155
result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, dee.creation_date);
157156
result->i_ctime.tv_nsec = 0;
@@ -616,8 +615,6 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry,
616615
mark_buffer_dirty(bh);
617616
brelse(bh);
618617
}
619-
hpfs_i(i)->i_conv = hpfs_sb(i->i_sb)->sb_conv;
620-
hpfs_decide_conv(i, new_name, new_len);
621618
end1:
622619
hpfs_unlock(i->i_sb);
623620
return err;

‎fs/hpfs/super.c‎

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ static void destroy_inodecache(void)
219219

220220
enum {
221221
Opt_help, Opt_uid, Opt_gid, Opt_umask, Opt_case_lower, Opt_case_asis,
222-
Opt_conv_binary, Opt_conv_text, Opt_conv_auto,
223222
Opt_check_none, Opt_check_normal, Opt_check_strict,
224223
Opt_err_cont, Opt_err_ro, Opt_err_panic,
225224
Opt_eas_no, Opt_eas_ro, Opt_eas_rw,
@@ -234,9 +233,6 @@ static const match_table_t tokens = {
234233
{Opt_umask, "umask=%o"},
235234
{Opt_case_lower, "case=lower"},
236235
{Opt_case_asis, "case=asis"},
237-
{Opt_conv_binary, "conv=binary"},
238-
{Opt_conv_text, "conv=text"},
239-
{Opt_conv_auto, "conv=auto"},
240236
{Opt_check_none, "check=none"},
241237
{Opt_check_normal, "check=normal"},
242238
{Opt_check_strict, "check=strict"},
@@ -254,7 +250,7 @@ static const match_table_t tokens = {
254250
};
255251

256252
static int parse_opts(char *opts, uid_t *uid, gid_t *gid, umode_t *umask,
257-
int *lowercase, int *conv, int *eas, int *chk, int *errs,
253+
int *lowercase, int *eas, int *chk, int *errs,
258254
int *chkdsk, int *timeshift)
259255
{
260256
char *p;
@@ -296,15 +292,6 @@ static int parse_opts(char *opts, uid_t *uid, gid_t *gid, umode_t *umask,
296292
case Opt_case_asis:
297293
*lowercase = 0;
298294
break;
299-
case Opt_conv_binary:
300-
*conv = CONV_BINARY;
301-
break;
302-
case Opt_conv_text:
303-
*conv = CONV_TEXT;
304-
break;
305-
case Opt_conv_auto:
306-
*conv = CONV_AUTO;
307-
break;
308295
case Opt_check_none:
309296
*chk = 0;
310297
break;
@@ -371,9 +358,6 @@ HPFS filesystem options:\n\
371358
umask=xxx set mode of files that don't have mode specified in eas\n\
372359
case=lower lowercase all files\n\
373360
case=asis do not lowercase files (default)\n\
374-
conv=binary do not convert CR/LF -> LF (default)\n\
375-
conv=auto convert only files with known text extensions\n\
376-
conv=text convert all files\n\
377361
check=none no fs checks - kernel may crash on corrupted filesystem\n\
378362
check=normal do some checks - it should not crash (default)\n\
379363
check=strict do extra time-consuming checks, used for debugging\n\
@@ -395,7 +379,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
395379
uid_t uid;
396380
gid_t gid;
397381
umode_t umask;
398-
int lowercase, conv, eas, chk, errs, chkdsk, timeshift;
382+
int lowercase, eas, chk, errs, chkdsk, timeshift;
399383
int o;
400384
struct hpfs_sb_info *sbi = hpfs_sb(s);
401385
char *new_opts = kstrdup(data, GFP_KERNEL);
@@ -406,11 +390,11 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
406390
lock_super(s);
407391
uid = sbi->sb_uid; gid = sbi->sb_gid;
408392
umask = 0777 & ~sbi->sb_mode;
409-
lowercase = sbi->sb_lowercase; conv = sbi->sb_conv;
393+
lowercase = sbi->sb_lowercase;
410394
eas = sbi->sb_eas; chk = sbi->sb_chk; chkdsk = sbi->sb_chkdsk;
411395
errs = sbi->sb_err; timeshift = sbi->sb_timeshift;
412396

413-
if (!(o = parse_opts(data, &uid, &gid, &umask, &lowercase, &conv,
397+
if (!(o = parse_opts(data, &uid, &gid, &umask, &lowercase,
414398
&eas, &chk, &errs, &chkdsk, &timeshift))) {
415399
printk("HPFS: bad mount options.\n");
416400
goto out_err;
@@ -428,7 +412,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
428412

429413
sbi->sb_uid = uid; sbi->sb_gid = gid;
430414
sbi->sb_mode = 0777 & ~umask;
431-
sbi->sb_lowercase = lowercase; sbi->sb_conv = conv;
415+
sbi->sb_lowercase = lowercase;
432416
sbi->sb_eas = eas; sbi->sb_chk = chk; sbi->sb_chkdsk = chkdsk;
433417
sbi->sb_err = errs; sbi->sb_timeshift = timeshift;
434418

@@ -472,7 +456,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
472456
uid_t uid;
473457
gid_t gid;
474458
umode_t umask;
475-
int lowercase, conv, eas, chk, errs, chkdsk, timeshift;
459+
int lowercase, eas, chk, errs, chkdsk, timeshift;
476460

477461
dnode_secno root_dno;
478462
struct hpfs_dirent *de = NULL;
@@ -498,14 +482,13 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
498482
gid = current_gid();
499483
umask = current_umask();
500484
lowercase = 0;
501-
conv = CONV_BINARY;
502485
eas = 2;
503486
chk = 1;
504487
errs = 1;
505488
chkdsk = 1;
506489
timeshift = 0;
507490

508-
if (!(o = parse_opts(options, &uid, &gid, &umask, &lowercase, &conv,
491+
if (!(o = parse_opts(options, &uid, &gid, &umask, &lowercase,
509492
&eas, &chk, &errs, &chkdsk, &timeshift))) {
510493
printk("HPFS: bad mount options.\n");
511494
goto bail0;
@@ -558,7 +541,6 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
558541
sbi->sb_n_free = -1;
559542
sbi->sb_n_free_dnodes = -1;
560543
sbi->sb_lowercase = lowercase;
561-
sbi->sb_conv = conv;
562544
sbi->sb_eas = eas;
563545
sbi->sb_chk = chk;
564546
sbi->sb_chkdsk = chkdsk;

0 commit comments

Comments
 (0)