aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hppfs/hppfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hppfs/hppfs.c')
-rw-r--r--fs/hppfs/hppfs.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c
index 126d3c2e2dee..cd3e38972c86 100644
--- a/fs/hppfs/hppfs.c
+++ b/fs/hppfs/hppfs.c
@@ -436,7 +436,6 @@ static int hppfs_open(struct inode *inode, struct file *file)
436 path.mnt = inode->i_sb->s_fs_info; 436 path.mnt = inode->i_sb->s_fs_info;
437 path.dentry = HPPFS_I(inode)->proc_dentry; 437 path.dentry = HPPFS_I(inode)->proc_dentry;
438 438
439 /* XXX This isn't closed anywhere */
440 data->proc_file = dentry_open(&path, file_mode(file->f_mode), cred); 439 data->proc_file = dentry_open(&path, file_mode(file->f_mode), cred);
441 err = PTR_ERR(data->proc_file); 440 err = PTR_ERR(data->proc_file);
442 if (IS_ERR(data->proc_file)) 441 if (IS_ERR(data->proc_file))
@@ -523,12 +522,23 @@ static loff_t hppfs_llseek(struct file *file, loff_t off, int where)
523 return default_llseek(file, off, where); 522 return default_llseek(file, off, where);
524} 523}
525 524
525static int hppfs_release(struct inode *inode, struct file *file)
526{
527 struct hppfs_private *data = file->private_data;
528 struct file *proc_file = data->proc_file;
529 if (proc_file)
530 fput(proc_file);
531 kfree(data);
532 return 0;
533}
534
526static const struct file_operations hppfs_file_fops = { 535static const struct file_operations hppfs_file_fops = {
527 .owner = NULL, 536 .owner = NULL,
528 .llseek = hppfs_llseek, 537 .llseek = hppfs_llseek,
529 .read = hppfs_read, 538 .read = hppfs_read,
530 .write = hppfs_write, 539 .write = hppfs_write,
531 .open = hppfs_open, 540 .open = hppfs_open,
541 .release = hppfs_release,
532}; 542};
533 543
534struct hppfs_dirent { 544struct hppfs_dirent {
@@ -570,18 +580,12 @@ static int hppfs_readdir(struct file *file, void *ent, filldir_t filldir)
570 return err; 580 return err;
571} 581}
572 582
573static int hppfs_fsync(struct file *file, loff_t start, loff_t end,
574 int datasync)
575{
576 return filemap_write_and_wait_range(file->f_mapping, start, end);
577}
578
579static const struct file_operations hppfs_dir_fops = { 583static const struct file_operations hppfs_dir_fops = {
580 .owner = NULL, 584 .owner = NULL,
581 .readdir = hppfs_readdir, 585 .readdir = hppfs_readdir,
582 .open = hppfs_dir_open, 586 .open = hppfs_dir_open,
583 .fsync = hppfs_fsync,
584 .llseek = default_llseek, 587 .llseek = default_llseek,
588 .release = hppfs_release,
585}; 589};
586 590
587static int hppfs_statfs(struct dentry *dentry, struct kstatfs *sf) 591static int hppfs_statfs(struct dentry *dentry, struct kstatfs *sf)