Commit 71aa96e9 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/home/davem/BK/tg3-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents c6026d08 cbbf50f0
...@@ -125,13 +125,15 @@ static struct sysfs_ops edd_attr_ops = { ...@@ -125,13 +125,15 @@ static struct sysfs_ops edd_attr_ops = {
static ssize_t static ssize_t
edd_show_host_bus(struct edd_device *edev, char *buf) edd_show_host_bus(struct edd_device *edev, char *buf)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
char *p = buf; char *p = buf;
int i; int i;
if (!edev || !info || !buf) { if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info || !buf)
return -EINVAL; return -EINVAL;
}
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (isprint(info->params.host_bus_type[i])) { if (isprint(info->params.host_bus_type[i])) {
...@@ -169,13 +171,15 @@ edd_show_host_bus(struct edd_device *edev, char *buf) ...@@ -169,13 +171,15 @@ edd_show_host_bus(struct edd_device *edev, char *buf)
static ssize_t static ssize_t
edd_show_interface(struct edd_device *edev, char *buf) edd_show_interface(struct edd_device *edev, char *buf)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
char *p = buf; char *p = buf;
int i; int i;
if (!edev || !info || !buf) { if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info || !buf)
return -EINVAL; return -EINVAL;
}
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
if (isprint(info->params.interface_type[i])) { if (isprint(info->params.interface_type[i])) {
...@@ -231,11 +235,13 @@ edd_show_interface(struct edd_device *edev, char *buf) ...@@ -231,11 +235,13 @@ edd_show_interface(struct edd_device *edev, char *buf)
static ssize_t static ssize_t
edd_show_raw_data(struct edd_device *edev, char *buf) edd_show_raw_data(struct edd_device *edev, char *buf)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
ssize_t len = sizeof (info->params); ssize_t len = sizeof (info->params);
if (!edev || !info || !buf) { if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info || !buf)
return -EINVAL; return -EINVAL;
}
if (!(info->params.key == 0xBEDD || info->params.key == 0xDDBE)) if (!(info->params.key == 0xBEDD || info->params.key == 0xDDBE))
len = info->params.length; len = info->params.length;
...@@ -251,11 +257,13 @@ edd_show_raw_data(struct edd_device *edev, char *buf) ...@@ -251,11 +257,13 @@ edd_show_raw_data(struct edd_device *edev, char *buf)
static ssize_t static ssize_t
edd_show_version(struct edd_device *edev, char *buf) edd_show_version(struct edd_device *edev, char *buf)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
char *p = buf; char *p = buf;
if (!edev || !info || !buf) { if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info || !buf)
return -EINVAL; return -EINVAL;
}
p += scnprintf(p, left, "0x%02x\n", info->version); p += scnprintf(p, left, "0x%02x\n", info->version);
return (p - buf); return (p - buf);
...@@ -272,11 +280,13 @@ edd_show_disk80_sig(struct edd_device *edev, char *buf) ...@@ -272,11 +280,13 @@ edd_show_disk80_sig(struct edd_device *edev, char *buf)
static ssize_t static ssize_t
edd_show_extensions(struct edd_device *edev, char *buf) edd_show_extensions(struct edd_device *edev, char *buf)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
char *p = buf; char *p = buf;
if (!edev || !info || !buf) { if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info || !buf)
return -EINVAL; return -EINVAL;
}
if (info->interface_support & EDD_EXT_FIXED_DISK_ACCESS) { if (info->interface_support & EDD_EXT_FIXED_DISK_ACCESS) {
p += scnprintf(p, left, "Fixed disk access\n"); p += scnprintf(p, left, "Fixed disk access\n");
...@@ -296,11 +306,13 @@ edd_show_extensions(struct edd_device *edev, char *buf) ...@@ -296,11 +306,13 @@ edd_show_extensions(struct edd_device *edev, char *buf)
static ssize_t static ssize_t
edd_show_info_flags(struct edd_device *edev, char *buf) edd_show_info_flags(struct edd_device *edev, char *buf)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
char *p = buf; char *p = buf;
if (!edev || !info || !buf) { if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info || !buf)
return -EINVAL; return -EINVAL;
}
if (info->params.info_flags & EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT) if (info->params.info_flags & EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT)
p += scnprintf(p, left, "DMA boundary error transparent\n"); p += scnprintf(p, left, "DMA boundary error transparent\n");
...@@ -324,11 +336,13 @@ edd_show_info_flags(struct edd_device *edev, char *buf) ...@@ -324,11 +336,13 @@ edd_show_info_flags(struct edd_device *edev, char *buf)
static ssize_t static ssize_t
edd_show_legacy_cylinders(struct edd_device *edev, char *buf) edd_show_legacy_cylinders(struct edd_device *edev, char *buf)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
char *p = buf; char *p = buf;
if (!edev || !info || !buf) { if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info || !buf)
return -EINVAL; return -EINVAL;
}
p += snprintf(p, left, "0x%x\n", info->legacy_cylinders); p += snprintf(p, left, "0x%x\n", info->legacy_cylinders);
return (p - buf); return (p - buf);
...@@ -337,11 +351,13 @@ edd_show_legacy_cylinders(struct edd_device *edev, char *buf) ...@@ -337,11 +351,13 @@ edd_show_legacy_cylinders(struct edd_device *edev, char *buf)
static ssize_t static ssize_t
edd_show_legacy_heads(struct edd_device *edev, char *buf) edd_show_legacy_heads(struct edd_device *edev, char *buf)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
char *p = buf; char *p = buf;
if (!edev || !info || !buf) { if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info || !buf)
return -EINVAL; return -EINVAL;
}
p += snprintf(p, left, "0x%x\n", info->legacy_heads); p += snprintf(p, left, "0x%x\n", info->legacy_heads);
return (p - buf); return (p - buf);
...@@ -350,11 +366,13 @@ edd_show_legacy_heads(struct edd_device *edev, char *buf) ...@@ -350,11 +366,13 @@ edd_show_legacy_heads(struct edd_device *edev, char *buf)
static ssize_t static ssize_t
edd_show_legacy_sectors(struct edd_device *edev, char *buf) edd_show_legacy_sectors(struct edd_device *edev, char *buf)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
char *p = buf; char *p = buf;
if (!edev || !info || !buf) { if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info || !buf)
return -EINVAL; return -EINVAL;
}
p += snprintf(p, left, "0x%x\n", info->legacy_sectors); p += snprintf(p, left, "0x%x\n", info->legacy_sectors);
return (p - buf); return (p - buf);
...@@ -363,11 +381,13 @@ edd_show_legacy_sectors(struct edd_device *edev, char *buf) ...@@ -363,11 +381,13 @@ edd_show_legacy_sectors(struct edd_device *edev, char *buf)
static ssize_t static ssize_t
edd_show_default_cylinders(struct edd_device *edev, char *buf) edd_show_default_cylinders(struct edd_device *edev, char *buf)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
char *p = buf; char *p = buf;
if (!edev || !info || !buf) { if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info || !buf)
return -EINVAL; return -EINVAL;
}
p += scnprintf(p, left, "0x%x\n", info->params.num_default_cylinders); p += scnprintf(p, left, "0x%x\n", info->params.num_default_cylinders);
return (p - buf); return (p - buf);
...@@ -376,11 +396,13 @@ edd_show_default_cylinders(struct edd_device *edev, char *buf) ...@@ -376,11 +396,13 @@ edd_show_default_cylinders(struct edd_device *edev, char *buf)
static ssize_t static ssize_t
edd_show_default_heads(struct edd_device *edev, char *buf) edd_show_default_heads(struct edd_device *edev, char *buf)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
char *p = buf; char *p = buf;
if (!edev || !info || !buf) { if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info || !buf)
return -EINVAL; return -EINVAL;
}
p += scnprintf(p, left, "0x%x\n", info->params.num_default_heads); p += scnprintf(p, left, "0x%x\n", info->params.num_default_heads);
return (p - buf); return (p - buf);
...@@ -389,11 +411,13 @@ edd_show_default_heads(struct edd_device *edev, char *buf) ...@@ -389,11 +411,13 @@ edd_show_default_heads(struct edd_device *edev, char *buf)
static ssize_t static ssize_t
edd_show_default_sectors_per_track(struct edd_device *edev, char *buf) edd_show_default_sectors_per_track(struct edd_device *edev, char *buf)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
char *p = buf; char *p = buf;
if (!edev || !info || !buf) { if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info || !buf)
return -EINVAL; return -EINVAL;
}
p += scnprintf(p, left, "0x%x\n", info->params.sectors_per_track); p += scnprintf(p, left, "0x%x\n", info->params.sectors_per_track);
return (p - buf); return (p - buf);
...@@ -402,11 +426,13 @@ edd_show_default_sectors_per_track(struct edd_device *edev, char *buf) ...@@ -402,11 +426,13 @@ edd_show_default_sectors_per_track(struct edd_device *edev, char *buf)
static ssize_t static ssize_t
edd_show_sectors(struct edd_device *edev, char *buf) edd_show_sectors(struct edd_device *edev, char *buf)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
char *p = buf; char *p = buf;
if (!edev || !info || !buf) { if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info || !buf)
return -EINVAL; return -EINVAL;
}
p += scnprintf(p, left, "0x%llx\n", info->params.number_of_sectors); p += scnprintf(p, left, "0x%llx\n", info->params.number_of_sectors);
return (p - buf); return (p - buf);
...@@ -426,8 +452,11 @@ edd_show_sectors(struct edd_device *edev, char *buf) ...@@ -426,8 +452,11 @@ edd_show_sectors(struct edd_device *edev, char *buf)
static int static int
edd_has_legacy_cylinders(struct edd_device *edev) edd_has_legacy_cylinders(struct edd_device *edev)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
if (!edev || !info) if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info)
return -EINVAL; return -EINVAL;
return info->legacy_cylinders > 0; return info->legacy_cylinders > 0;
} }
...@@ -435,8 +464,11 @@ edd_has_legacy_cylinders(struct edd_device *edev) ...@@ -435,8 +464,11 @@ edd_has_legacy_cylinders(struct edd_device *edev)
static int static int
edd_has_legacy_heads(struct edd_device *edev) edd_has_legacy_heads(struct edd_device *edev)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
if (!edev || !info) if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info)
return -EINVAL; return -EINVAL;
return info->legacy_heads > 0; return info->legacy_heads > 0;
} }
...@@ -444,8 +476,11 @@ edd_has_legacy_heads(struct edd_device *edev) ...@@ -444,8 +476,11 @@ edd_has_legacy_heads(struct edd_device *edev)
static int static int
edd_has_legacy_sectors(struct edd_device *edev) edd_has_legacy_sectors(struct edd_device *edev)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
if (!edev || !info) if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info)
return -EINVAL; return -EINVAL;
return info->legacy_sectors > 0; return info->legacy_sectors > 0;
} }
...@@ -453,8 +488,11 @@ edd_has_legacy_sectors(struct edd_device *edev) ...@@ -453,8 +488,11 @@ edd_has_legacy_sectors(struct edd_device *edev)
static int static int
edd_has_default_cylinders(struct edd_device *edev) edd_has_default_cylinders(struct edd_device *edev)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
if (!edev || !info) if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info)
return -EINVAL; return -EINVAL;
return info->params.num_default_cylinders > 0; return info->params.num_default_cylinders > 0;
} }
...@@ -462,8 +500,11 @@ edd_has_default_cylinders(struct edd_device *edev) ...@@ -462,8 +500,11 @@ edd_has_default_cylinders(struct edd_device *edev)
static int static int
edd_has_default_heads(struct edd_device *edev) edd_has_default_heads(struct edd_device *edev)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
if (!edev || !info) if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info)
return -EINVAL; return -EINVAL;
return info->params.num_default_heads > 0; return info->params.num_default_heads > 0;
} }
...@@ -471,8 +512,11 @@ edd_has_default_heads(struct edd_device *edev) ...@@ -471,8 +512,11 @@ edd_has_default_heads(struct edd_device *edev)
static int static int
edd_has_default_sectors_per_track(struct edd_device *edev) edd_has_default_sectors_per_track(struct edd_device *edev)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
if (!edev || !info) if (!edev)
return -EINVAL;
info = edd_dev_get_info(edev);
if (!info)
return -EINVAL; return -EINVAL;
return info->params.sectors_per_track > 0; return info->params.sectors_per_track > 0;
} }
...@@ -480,11 +524,14 @@ edd_has_default_sectors_per_track(struct edd_device *edev) ...@@ -480,11 +524,14 @@ edd_has_default_sectors_per_track(struct edd_device *edev)
static int static int
edd_has_edd30(struct edd_device *edev) edd_has_edd30(struct edd_device *edev)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
int i, nonzero_path = 0; int i, nonzero_path = 0;
char c; char c;
if (!edev || !info) if (!edev)
return 0;
info = edd_dev_get_info(edev);
if (!info)
return 0; return 0;
if (!(info->params.key == 0xBEDD || info->params.key == 0xDDBE)) { if (!(info->params.key == 0xBEDD || info->params.key == 0xDDBE)) {
...@@ -508,8 +555,11 @@ edd_has_edd30(struct edd_device *edev) ...@@ -508,8 +555,11 @@ edd_has_edd30(struct edd_device *edev)
static int static int
edd_has_disk80_sig(struct edd_device *edev) edd_has_disk80_sig(struct edd_device *edev)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
if (!edev || !info) if (!edev)
return 0;
info = edd_dev_get_info(edev);
if (!info)
return 0; return 0;
return info->device == 0x80; return info->device == 0x80;
} }
...@@ -597,9 +647,12 @@ static decl_subsys(edd,&ktype_edd,NULL); ...@@ -597,9 +647,12 @@ static decl_subsys(edd,&ktype_edd,NULL);
static int static int
edd_dev_is_type(struct edd_device *edev, const char *type) edd_dev_is_type(struct edd_device *edev, const char *type)
{ {
struct edd_info *info = edd_dev_get_info(edev); struct edd_info *info;
if (!edev)
return 0;
info = edd_dev_get_info(edev);
if (edev && type && info) { if (type && info) {
if (!strncmp(info->params.host_bus_type, type, strlen(type)) || if (!strncmp(info->params.host_bus_type, type, strlen(type)) ||
!strncmp(info->params.interface_type, type, strlen(type))) !strncmp(info->params.interface_type, type, strlen(type)))
return 1; return 1;
......
...@@ -103,7 +103,8 @@ static inline int drive_is_flashcard (ide_drive_t *drive) ...@@ -103,7 +103,8 @@ static inline int drive_is_flashcard (ide_drive_t *drive)
if (id->config == 0x848a) return 1; /* CompactFlash */ if (id->config == 0x848a) return 1; /* CompactFlash */
if (!strncmp(id->model, "KODAK ATA_FLASH", 15) /* Kodak */ if (!strncmp(id->model, "KODAK ATA_FLASH", 15) /* Kodak */
|| !strncmp(id->model, "Hitachi CV", 10) /* Hitachi */ || !strncmp(id->model, "Hitachi CV", 10) /* Hitachi */
|| !strncmp(id->model, "SunDisk SDCFB", 13) /* SunDisk */ || !strncmp(id->model, "SunDisk SDCFB", 13) /* old SanDisk */
|| !strncmp(id->model, "SanDisk SDCFB", 13) /* SanDisk */
|| !strncmp(id->model, "HAGIWARA HPC", 12) /* Hagiwara */ || !strncmp(id->model, "HAGIWARA HPC", 12) /* Hagiwara */
|| !strncmp(id->model, "LEXAR ATA_FLASH", 15) /* Lexar */ || !strncmp(id->model, "LEXAR ATA_FLASH", 15) /* Lexar */
|| !strncmp(id->model, "ATA_FLASH", 9)) /* Simple Tech */ || !strncmp(id->model, "ATA_FLASH", 9)) /* Simple Tech */
......
...@@ -192,6 +192,7 @@ static int parse_options(struct super_block *sb, char *options) ...@@ -192,6 +192,7 @@ static int parse_options(struct super_block *sb, char *options)
static int adfs_remount(struct super_block *sb, int *flags, char *data) static int adfs_remount(struct super_block *sb, int *flags, char *data)
{ {
*flags |= MS_NODIRATIME;
return parse_options(sb, data); return parse_options(sb, data);
} }
......
...@@ -502,6 +502,8 @@ affs_remount(struct super_block *sb, int *flags, char *data) ...@@ -502,6 +502,8 @@ affs_remount(struct super_block *sb, int *flags, char *data)
pr_debug("AFFS: remount(flags=0x%x,opts=\"%s\")\n",*flags,data); pr_debug("AFFS: remount(flags=0x%x,opts=\"%s\")\n",*flags,data);
*flags |= MS_NODIRATIME;
if (!parse_options(data,&uid,&gid,&mode,&reserved,&root_block, if (!parse_options(data,&uid,&gid,&mode,&reserved,&root_block,
&blocksize,&sbi->s_prefix,sbi->s_volume,&mount_flags)) &blocksize,&sbi->s_prefix,sbi->s_volume,&mount_flags))
return -EINVAL; return -EINVAL;
......
...@@ -357,6 +357,12 @@ static struct quotactl_ops cifs_quotactl_ops = { ...@@ -357,6 +357,12 @@ static struct quotactl_ops cifs_quotactl_ops = {
}; };
#endif #endif
static int cifs_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
return 0;
}
struct super_operations cifs_super_ops = { struct super_operations cifs_super_ops = {
.read_inode = cifs_read_inode, .read_inode = cifs_read_inode,
.put_super = cifs_put_super, .put_super = cifs_put_super,
...@@ -369,6 +375,7 @@ struct super_operations cifs_super_ops = { ...@@ -369,6 +375,7 @@ struct super_operations cifs_super_ops = {
us with the same number of releases (closes) as opens */ us with the same number of releases (closes) as opens */
.show_options = cifs_show_options, .show_options = cifs_show_options,
/* .umount_begin = cifs_umount_begin, *//* consider adding in the future */ /* .umount_begin = cifs_umount_begin, *//* consider adding in the future */
.remount_fs = cifs_remount,
}; };
static struct super_block * static struct super_block *
......
...@@ -82,6 +82,12 @@ void coda_destroy_inodecache(void) ...@@ -82,6 +82,12 @@ void coda_destroy_inodecache(void)
printk(KERN_INFO "coda_inode_cache: not all structures were freed\n"); printk(KERN_INFO "coda_inode_cache: not all structures were freed\n");
} }
static int coda_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
return 0;
}
/* exported operations */ /* exported operations */
struct super_operations coda_super_operations = struct super_operations coda_super_operations =
{ {
...@@ -90,6 +96,7 @@ struct super_operations coda_super_operations = ...@@ -90,6 +96,7 @@ struct super_operations coda_super_operations =
.clear_inode = coda_clear_inode, .clear_inode = coda_clear_inode,
.put_super = coda_put_super, .put_super = coda_put_super,
.statfs = coda_statfs, .statfs = coda_statfs,
.remount_fs = coda_remount,
}; };
static int get_device_index(struct coda_mount_data *data) static int get_device_index(struct coda_mount_data *data)
......
...@@ -193,6 +193,12 @@ static void cramfs_put_super(struct super_block *sb) ...@@ -193,6 +193,12 @@ static void cramfs_put_super(struct super_block *sb)
sb->s_fs_info = NULL; sb->s_fs_info = NULL;
} }
static int cramfs_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_RDONLY;
return 0;
}
static int cramfs_fill_super(struct super_block *sb, void *data, int silent) static int cramfs_fill_super(struct super_block *sb, void *data, int silent)
{ {
int i; int i;
...@@ -483,6 +489,7 @@ static struct inode_operations cramfs_dir_inode_operations = { ...@@ -483,6 +489,7 @@ static struct inode_operations cramfs_dir_inode_operations = {
static struct super_operations cramfs_ops = { static struct super_operations cramfs_ops = {
.put_super = cramfs_put_super, .put_super = cramfs_put_super,
.remount_fs = cramfs_remount,
.statfs = cramfs_statfs, .statfs = cramfs_statfs,
}; };
......
...@@ -77,12 +77,19 @@ void efs_put_super(struct super_block *s) ...@@ -77,12 +77,19 @@ void efs_put_super(struct super_block *s)
s->s_fs_info = NULL; s->s_fs_info = NULL;
} }
static int efs_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_RDONLY;
return 0;
}
static struct super_operations efs_superblock_operations = { static struct super_operations efs_superblock_operations = {
.alloc_inode = efs_alloc_inode, .alloc_inode = efs_alloc_inode,
.destroy_inode = efs_destroy_inode, .destroy_inode = efs_destroy_inode,
.read_inode = efs_read_inode, .read_inode = efs_read_inode,
.put_super = efs_put_super, .put_super = efs_put_super,
.statfs = efs_statfs, .statfs = efs_statfs,
.remount_fs = efs_remount,
}; };
static int __init init_efs_fs(void) { static int __init init_efs_fs(void) {
......
...@@ -734,6 +734,12 @@ void __exit fat_destroy_inodecache(void) ...@@ -734,6 +734,12 @@ void __exit fat_destroy_inodecache(void)
printk(KERN_INFO "fat_inode_cache: not all structures were freed\n"); printk(KERN_INFO "fat_inode_cache: not all structures were freed\n");
} }
static int fat_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
return 0;
}
static struct super_operations fat_sops = { static struct super_operations fat_sops = {
.alloc_inode = fat_alloc_inode, .alloc_inode = fat_alloc_inode,
.destroy_inode = fat_destroy_inode, .destroy_inode = fat_destroy_inode,
...@@ -742,6 +748,7 @@ static struct super_operations fat_sops = { ...@@ -742,6 +748,7 @@ static struct super_operations fat_sops = {
.put_super = fat_put_super, .put_super = fat_put_super,
.statfs = fat_statfs, .statfs = fat_statfs,
.clear_inode = fat_clear_inode, .clear_inode = fat_clear_inode,
.remount_fs = fat_remount,
.read_inode = make_bad_inode, .read_inode = make_bad_inode,
......
...@@ -56,12 +56,14 @@ MODULE_ALIAS("vxfs"); /* makes mount -t vxfs autoload the module */ ...@@ -56,12 +56,14 @@ MODULE_ALIAS("vxfs"); /* makes mount -t vxfs autoload the module */
static void vxfs_put_super(struct super_block *); static void vxfs_put_super(struct super_block *);
static int vxfs_statfs(struct super_block *, struct kstatfs *); static int vxfs_statfs(struct super_block *, struct kstatfs *);
static int vxfs_remount(struct super_block *, int *, char *);
static struct super_operations vxfs_super_ops = { static struct super_operations vxfs_super_ops = {
.read_inode = vxfs_read_inode, .read_inode = vxfs_read_inode,
.put_inode = vxfs_put_inode, .put_inode = vxfs_put_inode,
.put_super = vxfs_put_super, .put_super = vxfs_put_super,
.statfs = vxfs_statfs, .statfs = vxfs_statfs,
.remount_fs = vxfs_remount,
}; };
/** /**
...@@ -121,6 +123,12 @@ vxfs_statfs(struct super_block *sbp, struct kstatfs *bufp) ...@@ -121,6 +123,12 @@ vxfs_statfs(struct super_block *sbp, struct kstatfs *bufp)
return 0; return 0;
} }
static int vxfs_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_RDONLY;
return 0;
}
/** /**
* vxfs_read_super - read superblock into memory and initalize filesystem * vxfs_read_super - read superblock into memory and initalize filesystem
* @sbp: VFS superblock (to fill) * @sbp: VFS superblock (to fill)
......
...@@ -94,6 +94,7 @@ static int hfs_statfs(struct super_block *sb, struct kstatfs *buf) ...@@ -94,6 +94,7 @@ static int hfs_statfs(struct super_block *sb, struct kstatfs *buf)
int hfs_remount(struct super_block *sb, int *flags, char *data) int hfs_remount(struct super_block *sb, int *flags, char *data)
{ {
*flags |= MS_NODIRATIME;
if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
return 0; return 0;
if (!(*flags & MS_RDONLY)) { if (!(*flags & MS_RDONLY)) {
......
...@@ -119,12 +119,20 @@ static void destroy_inodecache(void) ...@@ -119,12 +119,20 @@ static void destroy_inodecache(void)
printk(KERN_INFO "iso_inode_cache: not all structures were freed\n"); printk(KERN_INFO "iso_inode_cache: not all structures were freed\n");
} }
static int isofs_remount(struct super_block *sb, int *flags, char *data)
{
/* we probably want a lot more here */
*flags |= MS_RDONLY;
return 0;
}
static struct super_operations isofs_sops = { static struct super_operations isofs_sops = {
.alloc_inode = isofs_alloc_inode, .alloc_inode = isofs_alloc_inode,
.destroy_inode = isofs_destroy_inode, .destroy_inode = isofs_destroy_inode,
.read_inode = isofs_read_inode, .read_inode = isofs_read_inode,
.put_super = isofs_put_super, .put_super = isofs_put_super,
.statfs = isofs_statfs, .statfs = isofs_statfs,
.remount_fs = isofs_remount,
}; };
/* the export_operations structure for describing /* the export_operations structure for describing
......
...@@ -1771,6 +1771,12 @@ jffs_write_super(struct super_block *sb) ...@@ -1771,6 +1771,12 @@ jffs_write_super(struct super_block *sb)
unlock_kernel(); unlock_kernel();
} }
static int jffs_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
return 0;
}
static struct super_operations jffs_ops = static struct super_operations jffs_ops =
{ {
.read_inode = jffs_read_inode, .read_inode = jffs_read_inode,
...@@ -1778,6 +1784,7 @@ static struct super_operations jffs_ops = ...@@ -1778,6 +1784,7 @@ static struct super_operations jffs_ops =
.put_super = jffs_put_super, .put_super = jffs_put_super,
.write_super = jffs_write_super, .write_super = jffs_write_super,
.statfs = jffs_statfs, .statfs = jffs_statfs,
.remount_fs = jffs_remount,
}; };
static struct super_block *jffs_get_sb(struct file_system_type *fs_type, static struct super_block *jffs_get_sb(struct file_system_type *fs_type,
......
...@@ -350,7 +350,7 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data) ...@@ -350,7 +350,7 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)
if (!(*flags & MS_RDONLY)) if (!(*flags & MS_RDONLY))
jffs2_start_garbage_collect_thread(c); jffs2_start_garbage_collect_thread(c);
sb->s_flags = (sb->s_flags & ~MS_RDONLY)|(*flags & MS_RDONLY); *flags |= MS_NOATIME;
return 0; return 0;
} }
......
...@@ -129,7 +129,7 @@ static struct super_block *jffs2_get_sb_mtd(struct file_system_type *fs_type, ...@@ -129,7 +129,7 @@ static struct super_block *jffs2_get_sb_mtd(struct file_system_type *fs_type,
mtd->index, mtd->name)); mtd->index, mtd->name));
sb->s_op = &jffs2_super_operations; sb->s_op = &jffs2_super_operations;
sb->s_flags |= MS_NODIRATIME; sb->s_flags |= MS_NOATIME;
ret = jffs2_do_fill_super(sb, data, (flags&MS_VERBOSE)?1:0); ret = jffs2_do_fill_super(sb, data, (flags&MS_VERBOSE)?1:0);
......
...@@ -777,7 +777,7 @@ long do_mount(char * dev_name, char * dir_name, char *type_page, ...@@ -777,7 +777,7 @@ long do_mount(char * dev_name, char * dir_name, char *type_page,
mnt_flags |= MNT_NODEV; mnt_flags |= MNT_NODEV;
if (flags & MS_NOEXEC) if (flags & MS_NOEXEC)
mnt_flags |= MNT_NOEXEC; mnt_flags |= MNT_NOEXEC;
flags &= ~(MS_NOSUID|MS_NOEXEC|MS_NODEV); flags &= ~(MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_ACTIVE);
/* ... and get the mountpoint */ /* ... and get the mountpoint */
retval = path_lookup(dir_name, LOOKUP_FOLLOW, &nd); retval = path_lookup(dir_name, LOOKUP_FOLLOW, &nd);
......
...@@ -85,6 +85,12 @@ static void destroy_inodecache(void) ...@@ -85,6 +85,12 @@ static void destroy_inodecache(void)
printk(KERN_INFO "ncp_inode_cache: not all structures were freed\n"); printk(KERN_INFO "ncp_inode_cache: not all structures were freed\n");
} }
static int ncp_remount(struct super_block *sb, int *flags, char* data)
{
*flags |= MS_NODIRATIME;
return 0;
}
static struct super_operations ncp_sops = static struct super_operations ncp_sops =
{ {
.alloc_inode = ncp_alloc_inode, .alloc_inode = ncp_alloc_inode,
...@@ -93,6 +99,7 @@ static struct super_operations ncp_sops = ...@@ -93,6 +99,7 @@ static struct super_operations ncp_sops =
.delete_inode = ncp_delete_inode, .delete_inode = ncp_delete_inode,
.put_super = ncp_put_super, .put_super = ncp_put_super,
.statfs = ncp_statfs, .statfs = ncp_statfs,
.remount_fs = ncp_remount,
}; };
extern struct dentry_operations ncp_root_dentry_operations; extern struct dentry_operations ncp_root_dentry_operations;
......
...@@ -1018,16 +1018,23 @@ static void openprom_read_inode(struct inode * inode) ...@@ -1018,16 +1018,23 @@ static void openprom_read_inode(struct inode * inode)
} }
} }
static int openprom_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NOATIME;
return 0;
}
static struct super_operations openprom_sops = { static struct super_operations openprom_sops = {
.read_inode = openprom_read_inode, .read_inode = openprom_read_inode,
.statfs = simple_statfs, .statfs = simple_statfs,
.remount = openprom_remount,
}; };
static int openprom_fill_super(struct super_block *s, void *data, int silent) static int openprom_fill_super(struct super_block *s, void *data, int silent)
{ {
struct inode * root_inode; struct inode * root_inode;
s->s_flags |= MS_NODIRATIME; s->s_flags |= MS_NOATIME;
s->s_blocksize = 1024; s->s_blocksize = 1024;
s->s_blocksize_bits = 10; s->s_blocksize_bits = 10;
s->s_magic = OPENPROM_SUPER_MAGIC; s->s_magic = OPENPROM_SUPER_MAGIC;
......
...@@ -127,6 +127,12 @@ int __init proc_init_inodecache(void) ...@@ -127,6 +127,12 @@ int __init proc_init_inodecache(void)
return 0; return 0;
} }
static int proc_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
return 0;
}
static struct super_operations proc_sops = { static struct super_operations proc_sops = {
.alloc_inode = proc_alloc_inode, .alloc_inode = proc_alloc_inode,
.destroy_inode = proc_destroy_inode, .destroy_inode = proc_destroy_inode,
...@@ -134,6 +140,7 @@ static struct super_operations proc_sops = { ...@@ -134,6 +140,7 @@ static struct super_operations proc_sops = {
.drop_inode = generic_delete_inode, .drop_inode = generic_delete_inode,
.delete_inode = proc_delete_inode, .delete_inode = proc_delete_inode,
.statfs = simple_statfs, .statfs = simple_statfs,
.remount_fs = proc_remount,
}; };
enum { enum {
......
...@@ -149,9 +149,13 @@ static int qnx4_remount(struct super_block *sb, int *flags, char *data) ...@@ -149,9 +149,13 @@ static int qnx4_remount(struct super_block *sb, int *flags, char *data)
qs = qnx4_sb(sb); qs = qnx4_sb(sb);
qs->Version = QNX4_VERSION; qs->Version = QNX4_VERSION;
#ifndef CONFIG_QNX4FS_RW
*flags |= MS_RDONLY;
#endif
if (*flags & MS_RDONLY) { if (*flags & MS_RDONLY) {
return 0; return 0;
} }
mark_buffer_dirty(qs->sb_buf); mark_buffer_dirty(qs->sb_buf);
return 0; return 0;
......
...@@ -592,11 +592,18 @@ static void destroy_inodecache(void) ...@@ -592,11 +592,18 @@ static void destroy_inodecache(void)
printk(KERN_INFO "romfs_inode_cache: not all structures were freed\n"); printk(KERN_INFO "romfs_inode_cache: not all structures were freed\n");
} }
static int romfs_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_RDONLY;
return 0;
}
static struct super_operations romfs_ops = { static struct super_operations romfs_ops = {
.alloc_inode = romfs_alloc_inode, .alloc_inode = romfs_alloc_inode,
.destroy_inode = romfs_destroy_inode, .destroy_inode = romfs_destroy_inode,
.read_inode = romfs_read_inode, .read_inode = romfs_read_inode,
.statfs = romfs_statfs, .statfs = romfs_statfs,
.remount_fs = romfs_remount,
}; };
static struct super_block *romfs_get_sb(struct file_system_type *fs_type, static struct super_block *romfs_get_sb(struct file_system_type *fs_type,
......
...@@ -93,6 +93,12 @@ static void destroy_inodecache(void) ...@@ -93,6 +93,12 @@ static void destroy_inodecache(void)
printk(KERN_INFO "smb_inode_cache: not all structures were freed\n"); printk(KERN_INFO "smb_inode_cache: not all structures were freed\n");
} }
static int smb_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
return 0;
}
static struct super_operations smb_sops = static struct super_operations smb_sops =
{ {
.alloc_inode = smb_alloc_inode, .alloc_inode = smb_alloc_inode,
...@@ -102,6 +108,7 @@ static struct super_operations smb_sops = ...@@ -102,6 +108,7 @@ static struct super_operations smb_sops =
.put_super = smb_put_super, .put_super = smb_put_super,
.statfs = smb_statfs, .statfs = smb_statfs,
.show_options = smb_show_options, .show_options = smb_show_options,
.remount_fs = smb_remount,
}; };
......
...@@ -57,6 +57,16 @@ static void sysv_write_super(struct super_block *sb) ...@@ -57,6 +57,16 @@ static void sysv_write_super(struct super_block *sb)
unlock_kernel(); unlock_kernel();
} }
static int sysv_remount(struct super_block *sb, int *flags, char *data)
{
struct sysv_sb_info *sbi = SYSV_SB(sb);
if (sbi->s_forced_ro)
*flags |= MS_RDONLY;
if (!(*flags & MS_RDONLY))
sb->s_dirt = 1;
return 0;
}
static void sysv_put_super(struct super_block *sb) static void sysv_put_super(struct super_block *sb)
{ {
struct sysv_sb_info *sbi = SYSV_SB(sb); struct sysv_sb_info *sbi = SYSV_SB(sb);
...@@ -321,6 +331,7 @@ struct super_operations sysv_sops = { ...@@ -321,6 +331,7 @@ struct super_operations sysv_sops = {
.delete_inode = sysv_delete_inode, .delete_inode = sysv_delete_inode,
.put_super = sysv_put_super, .put_super = sysv_put_super,
.write_super = sysv_write_super, .write_super = sysv_write_super,
.remount_fs = sysv_remount,
.statfs = sysv_statfs, .statfs = sysv_statfs,
}; };
......
...@@ -206,11 +206,11 @@ static int detect_sysv(struct sysv_sb_info *sbi, struct buffer_head *bh) ...@@ -206,11 +206,11 @@ static int detect_sysv(struct sysv_sb_info *sbi, struct buffer_head *bh)
if (fs16_to_cpu(sbi, sbd->s_nfree) == 0xffff) { if (fs16_to_cpu(sbi, sbd->s_nfree) == 0xffff) {
sbi->s_type = FSTYPE_AFS; sbi->s_type = FSTYPE_AFS;
sbi->s_forced_ro = 1;
if (!(sb->s_flags & MS_RDONLY)) { if (!(sb->s_flags & MS_RDONLY)) {
printk("SysV FS: SCO EAFS on %s detected, " printk("SysV FS: SCO EAFS on %s detected, "
"forcing read-only mode.\n", "forcing read-only mode.\n",
sb->s_id); sb->s_id);
sb->s_flags |= MS_RDONLY;
} }
return sbd->s_type; return sbd->s_type;
} }
...@@ -234,7 +234,7 @@ static int detect_sysv(struct sysv_sb_info *sbi, struct buffer_head *bh) ...@@ -234,7 +234,7 @@ static int detect_sysv(struct sysv_sb_info *sbi, struct buffer_head *bh)
if (sbd->s_type >= 0x10) { if (sbd->s_type >= 0x10) {
printk("SysV FS: can't handle long file names on %s, " printk("SysV FS: can't handle long file names on %s, "
"forcing read-only mode.\n", sb->s_id); "forcing read-only mode.\n", sb->s_id);
sb->s_flags |= MS_RDONLY; sbi->s_forced_ro = 1;
} }
sbi->s_type = FSTYPE_SYSV4; sbi->s_type = FSTYPE_SYSV4;
...@@ -335,9 +335,10 @@ static int complete_read_super(struct super_block *sb, int silent, int size) ...@@ -335,9 +335,10 @@ static int complete_read_super(struct super_block *sb, int silent, int size)
printk("SysV FS: get root dentry failed\n"); printk("SysV FS: get root dentry failed\n");
return 0; return 0;
} }
if (sbi->s_forced_ro)
sb->s_flags |= MS_RDONLY;
if (sbi->s_truncate) if (sbi->s_truncate)
sb->s_root->d_op = &sysv_dentry_operations; sb->s_root->d_op = &sysv_dentry_operations;
sb->s_flags |= MS_RDONLY;
sb->s_dirt = 1; sb->s_dirt = 1;
return 1; return 1;
} }
...@@ -481,6 +482,7 @@ static int v7_fill_super(struct super_block *sb, void *data, int silent) ...@@ -481,6 +482,7 @@ static int v7_fill_super(struct super_block *sb, void *data, int silent)
(fs32_to_cpu(sbi, v7i->i_size) & 017) != 0) (fs32_to_cpu(sbi, v7i->i_size) & 017) != 0)
goto failed; goto failed;
brelse(bh2); brelse(bh2);
bh2 = NULL;
sbi->s_bh1 = bh; sbi->s_bh1 = bh;
sbi->s_bh2 = bh; sbi->s_bh2 = bh;
......
...@@ -54,6 +54,7 @@ struct sysv_sb_info { ...@@ -54,6 +54,7 @@ struct sysv_sb_info {
u32 s_ndatazones; /* total number of data zones */ u32 s_ndatazones; /* total number of data zones */
u32 s_nzones; /* same as s_sbd->s_fsize */ u32 s_nzones; /* same as s_sbd->s_fsize */
u16 s_namelen; /* max length of dir entry */ u16 s_namelen; /* max length of dir entry */
int s_forced_ro;
}; };
/* /*
......
...@@ -460,6 +460,12 @@ udf_remount_fs(struct super_block *sb, int *flags, char *options) ...@@ -460,6 +460,12 @@ udf_remount_fs(struct super_block *sb, int *flags, char *options)
UDF_SB(sb)->s_gid = uopt.gid; UDF_SB(sb)->s_gid = uopt.gid;
UDF_SB(sb)->s_umask = uopt.umask; UDF_SB(sb)->s_umask = uopt.umask;
if (UDF_SB_LVIDBH(sb)) {
int write_rev = le16_to_cpu(UDF_SB_LVIDIU(sb)->minUDFWriteRev);
if (write_rev > UDF_MAX_WRITE_VERSION)
*flags |= MS_RDONLY;
}
if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
return 0; return 0;
if (*flags & MS_RDONLY) if (*flags & MS_RDONLY)
......
...@@ -114,10 +114,11 @@ static int ...@@ -114,10 +114,11 @@ static int
mprotect_attempt_merge(struct vm_area_struct *vma, struct vm_area_struct *prev, mprotect_attempt_merge(struct vm_area_struct *vma, struct vm_area_struct *prev,
unsigned long end, int newflags) unsigned long end, int newflags)
{ {
struct mm_struct * mm = vma->vm_mm; struct mm_struct * mm;
if (!prev || !vma) if (!prev || !vma)
return 0; return 0;
mm = vma->vm_mm;
if (prev->vm_end != vma->vm_start) if (prev->vm_end != vma->vm_start)
return 0; return 0;
if (!can_vma_merge(prev, newflags)) if (!can_vma_merge(prev, newflags))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment