aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-10-28 16:09:47 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-28 16:09:47 -0400
commit84860bf0644d7c45afe7ddbd30731c3e3c371fae (patch)
treed6c4b98a9c3fd9981e7fcc5d7729c9e01e327767 /fs
parent8caf89157d64f1eedba37113afb4b303b2b3e301 (diff)
parent6fbfddcb52d8d9fa2cd209f5ac2a1c87497d55b5 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
Diffstat (limited to 'fs')
-rw-r--r--fs/coda/psdev.c4
-rw-r--r--fs/partitions/check.c27
2 files changed, 28 insertions, 3 deletions
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c
index 3d1cce3653b8..6a3df88accfe 100644
--- a/fs/coda/psdev.c
+++ b/fs/coda/psdev.c
@@ -370,8 +370,8 @@ static int init_coda_psdev(void)
370 } 370 }
371 devfs_mk_dir ("coda"); 371 devfs_mk_dir ("coda");
372 for (i = 0; i < MAX_CODADEVS; i++) { 372 for (i = 0; i < MAX_CODADEVS; i++) {
373 class_device_create(coda_psdev_class, MKDEV(CODA_PSDEV_MAJOR,i), 373 class_device_create(coda_psdev_class, NULL,
374 NULL, "cfs%d", i); 374 MKDEV(CODA_PSDEV_MAJOR,i), NULL, "cfs%d", i);
375 err = devfs_mk_cdev(MKDEV(CODA_PSDEV_MAJOR, i), 375 err = devfs_mk_cdev(MKDEV(CODA_PSDEV_MAJOR, i),
376 S_IFCHR|S_IRUSR|S_IWUSR, "coda/%d", i); 376 S_IFCHR|S_IRUSR|S_IWUSR, "coda/%d", i);
377 if (err) 377 if (err)
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 1e848648a322..9c06c5434ec4 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -192,6 +192,7 @@ check_partition(struct gendisk *hd, struct block_device *bdev)
192struct part_attribute { 192struct part_attribute {
193 struct attribute attr; 193 struct attribute attr;
194 ssize_t (*show)(struct hd_struct *,char *); 194 ssize_t (*show)(struct hd_struct *,char *);
195 ssize_t (*store)(struct hd_struct *,const char *, size_t);
195}; 196};
196 197
197static ssize_t 198static ssize_t
@@ -201,14 +202,33 @@ part_attr_show(struct kobject * kobj, struct attribute * attr, char * page)
201 struct part_attribute * part_attr = container_of(attr,struct part_attribute,attr); 202 struct part_attribute * part_attr = container_of(attr,struct part_attribute,attr);
202 ssize_t ret = 0; 203 ssize_t ret = 0;
203 if (part_attr->show) 204 if (part_attr->show)
204 ret = part_attr->show(p,page); 205 ret = part_attr->show(p, page);
206 return ret;
207}
208static ssize_t
209part_attr_store(struct kobject * kobj, struct attribute * attr,
210 const char *page, size_t count)
211{
212 struct hd_struct * p = container_of(kobj,struct hd_struct,kobj);
213 struct part_attribute * part_attr = container_of(attr,struct part_attribute,attr);
214 ssize_t ret = 0;
215
216 if (part_attr->store)
217 ret = part_attr->store(p, page, count);
205 return ret; 218 return ret;
206} 219}
207 220
208static struct sysfs_ops part_sysfs_ops = { 221static struct sysfs_ops part_sysfs_ops = {
209 .show = part_attr_show, 222 .show = part_attr_show,
223 .store = part_attr_store,
210}; 224};
211 225
226static ssize_t part_uevent_store(struct hd_struct * p,
227 const char *page, size_t count)
228{
229 kobject_hotplug(&p->kobj, KOBJ_ADD);
230 return count;
231}
212static ssize_t part_dev_read(struct hd_struct * p, char *page) 232static ssize_t part_dev_read(struct hd_struct * p, char *page)
213{ 233{
214 struct gendisk *disk = container_of(p->kobj.parent,struct gendisk,kobj); 234 struct gendisk *disk = container_of(p->kobj.parent,struct gendisk,kobj);
@@ -229,6 +249,10 @@ static ssize_t part_stat_read(struct hd_struct * p, char *page)
229 p->reads, (unsigned long long)p->read_sectors, 249 p->reads, (unsigned long long)p->read_sectors,
230 p->writes, (unsigned long long)p->write_sectors); 250 p->writes, (unsigned long long)p->write_sectors);
231} 251}
252static struct part_attribute part_attr_uevent = {
253 .attr = {.name = "uevent", .mode = S_IWUSR },
254 .store = part_uevent_store
255};
232static struct part_attribute part_attr_dev = { 256static struct part_attribute part_attr_dev = {
233 .attr = {.name = "dev", .mode = S_IRUGO }, 257 .attr = {.name = "dev", .mode = S_IRUGO },
234 .show = part_dev_read 258 .show = part_dev_read
@@ -247,6 +271,7 @@ static struct part_attribute part_attr_stat = {
247}; 271};
248 272
249static struct attribute * default_attrs[] = { 273static struct attribute * default_attrs[] = {
274 &part_attr_uevent.attr,
250 &part_attr_dev.attr, 275 &part_attr_dev.attr,
251 &part_attr_start.attr, 276 &part_attr_start.attr,
252 &part_attr_size.attr, 277 &part_attr_size.attr,