]> git.pld-linux.org Git - packages/kernel.git/blob - kernel-nls_default.patch
- ported from linux-2.4.25-atmdd.patch
[packages/kernel.git] / kernel-nls_default.patch
1 diff -Nur linux-2.4.23.orig/fs/fat/inode.c linux-2.4.23/fs/fat/inode.c
2 --- linux-2.4.23.orig/fs/fat/inode.c    2003-08-25 13:44:43.000000000 +0200
3 +++ linux-2.4.23/fs/fat/inode.c 2003-12-10 16:04:01.000000000 +0100
4 @@ -770,7 +770,7 @@
5  
6         sbi->nls_io = NULL;
7         if (sbi->options.isvfat && !opts.utf8) {
8 -               p = opts.iocharset ? opts.iocharset : CONFIG_NLS_DEFAULT;
9 +               p = opts.iocharset ? opts.iocharset : nls_default_name;
10                 sbi->nls_io = load_nls(p);
11                 if (! sbi->nls_io)
12                         /* Fail only if explicit charset specified */
13 diff -Nur linux-2.4.23.orig/fs/nls/nls_base.c linux-2.4.23/fs/nls/nls_base.c
14 --- linux-2.4.23.orig/fs/nls/nls_base.c 2002-08-03 02:39:45.000000000 +0200
15 +++ linux-2.4.23/fs/nls/nls_base.c      2003-12-10 16:02:27.000000000 +0100
16 @@ -20,6 +20,8 @@
17  #endif
18  #include <linux/spinlock.h>
19  
20 +char nls_default_name[40] = CONFIG_NLS_DEFAULT;
21 +
22  static struct nls_table *tables;
23  static spinlock_t nls_lock = SPIN_LOCK_UNLOCKED;
24  
25 @@ -483,13 +485,14 @@
26  {
27         struct nls_table *default_nls;
28         
29 -       default_nls = load_nls(CONFIG_NLS_DEFAULT);
30 +       default_nls = load_nls(nls_default_name);
31         if (default_nls != NULL)
32                 return default_nls;
33         else
34                 return &default_table;
35  }
36  
37 +EXPORT_SYMBOL(nls_default_name);
38  EXPORT_SYMBOL(register_nls);
39  EXPORT_SYMBOL(unregister_nls);
40  EXPORT_SYMBOL(unload_nls);
41 diff -Nur linux-2.4.23.orig/fs/smbfs/inode.c linux-2.4.23/fs/smbfs/inode.c
42 --- linux-2.4.23.orig/fs/smbfs/inode.c  2002-11-29 00:53:15.000000000 +0100
43 +++ linux-2.4.23/fs/smbfs/inode.c       2003-12-10 16:04:38.000000000 +0100
44 @@ -374,7 +374,7 @@
45         seq_printf(s, ",file_mode=%04o", mnt->file_mode & S_IRWXUGO);
46         seq_printf(s, ",dir_mode=%04o", mnt->dir_mode & S_IRWXUGO);
47  
48 -       if (strcmp(mnt->codepage.local_name, CONFIG_NLS_DEFAULT))
49 +       if (strcmp(mnt->codepage.local_name, nls_default_name))
50                 seq_printf(s, ",iocharset=%s", mnt->codepage.local_name);
51         if (strcmp(mnt->codepage.remote_name, SMB_NLS_REMOTE))
52                 seq_printf(s, ",codepage=%s", mnt->codepage.remote_name);
53 @@ -468,7 +468,7 @@
54         server->mnt = mnt;
55  
56         memset(mnt, 0, sizeof(struct smb_mount_data_kernel));
57 -       strncpy(mnt->codepage.local_name, CONFIG_NLS_DEFAULT,
58 +       strncpy(mnt->codepage.local_name, nls_default_name,
59                 SMB_NLS_MAXNAMELEN);
60         strncpy(mnt->codepage.remote_name, SMB_NLS_REMOTE,
61                 SMB_NLS_MAXNAMELEN);
62 diff -Nur linux-2.4.23.orig/include/linux/nls.h linux-2.4.23/include/linux/nls.h
63 --- linux-2.4.23.orig/include/linux/nls.h       2002-08-03 02:39:45.000000000 +0200
64 +++ linux-2.4.23/include/linux/nls.h    2003-12-10 16:03:19.000000000 +0100
65 @@ -21,6 +21,8 @@
66  #define NLS_MAX_CHARSET_SIZE 6 /* for UTF-8 */
67  
68  /* nls.c */
69 +extern char nls_default_name[];
70 +
71  extern int register_nls(struct nls_table *);
72  extern int unregister_nls(struct nls_table *);
73  extern struct nls_table *load_nls(char *);
74 diff -Nur linux-2.4.23.orig/include/linux/sysctl.h linux-2.4.23/include/linux/sysctl.h
75 --- linux-2.4.23.orig/include/linux/sysctl.h    2003-11-28 19:26:21.000000000 +0100
76 +++ linux-2.4.23/include/linux/sysctl.h 2003-12-10 15:55:47.000000000 +0100
77 @@ -608,6 +608,7 @@
78         FS_LEASE_TIME=15,       /* int: maximum time to wait for a lease break */
79         FS_DQSTATS=16,  /* dir: disc quota usage statistics */
80         FS_XFS=17,      /* struct: control xfs parameters */
81 +       FS_NLS_DEFAULT=18,      /* string:default console character set */
82  };
83  
84  /* /proc/sys/fs/quota/ */
85 diff -Nur linux-2.4.23.orig/kernel/sysctl.c linux-2.4.23/kernel/sysctl.c
86 --- linux-2.4.23.orig/kernel/sysctl.c   2003-11-28 19:26:21.000000000 +0100
87 +++ linux-2.4.23/kernel/sysctl.c        2003-12-10 16:03:30.000000000 +0100
88 @@ -66,6 +66,9 @@
89  #ifdef CONFIG_HOTPLUG
90  extern char hotplug_path[];
91  #endif
92 +#ifdef CONFIG_NLS
93 +extern char nls_default_name[];
94 +#endif
95  #ifdef CONFIG_CHR_DEV_SG
96  extern int sg_big_buff;
97  #endif
98 @@ -342,6 +345,10 @@
99          sizeof(int), 0644, NULL, &proc_dointvec},
100         {FS_LEASE_TIME, "lease-break-time", &lease_break_time, sizeof(int),
101          0644, NULL, &proc_dointvec},
102 +#ifdef CONFIG_NLS
103 +       {FS_NLS_DEFAULT, "nls-default", &nls_default_name, 40,
104 +        0644, NULL, &proc_dostring, &sysctl_string },
105 +#endif
106         {0}
107  };
108  
This page took 0.030656 seconds and 3 git commands to generate.