diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 20:51:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 20:51:54 -0400 |
commit | 20b4fb485227404329e41ad15588afad3df23050 (patch) | |
tree | f3e099f0ab3da8a93b447203e294d2bb22f6dc05 /fs/hpfs/file.c | |
parent | b9394d8a657cd3c064fa432aa0905c1b58b38fe9 (diff) | |
parent | ac3e3c5b1164397656df81b9e9ab4991184d3236 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS updates from Al Viro,
Misc cleanups all over the place, mainly wrt /proc interfaces (switch
create_proc_entry to proc_create(), get rid of the deprecated
create_proc_read_entry() in favor of using proc_create_data() and
seq_file etc).
7kloc removed.
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits)
don't bother with deferred freeing of fdtables
proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h
proc: Make the PROC_I() and PDE() macros internal to procfs
proc: Supply a function to remove a proc entry by PDE
take cgroup_open() and cpuset_open() to fs/proc/base.c
ppc: Clean up scanlog
ppc: Clean up rtas_flash driver somewhat
hostap: proc: Use remove_proc_subtree()
drm: proc: Use remove_proc_subtree()
drm: proc: Use minor->index to label things, not PDE->name
drm: Constify drm_proc_list[]
zoran: Don't print proc_dir_entry data in debug
reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show()
proc: Supply an accessor for getting the data from a PDE's parent
airo: Use remove_proc_subtree()
rtl8192u: Don't need to save device proc dir PDE
rtl8187se: Use a dir under /proc/net/r8180/
proc: Add proc_mkdir_data()
proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h}
proc: Move PDE_NET() to fs/proc/proc_net.c
...
Diffstat (limited to 'fs/hpfs/file.c')
-rw-r--r-- | fs/hpfs/file.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c index 9f9dbeceeee7..3027f4dbbab5 100644 --- a/fs/hpfs/file.c +++ b/fs/hpfs/file.c | |||
@@ -131,6 +131,24 @@ static int hpfs_write_begin(struct file *file, struct address_space *mapping, | |||
131 | return ret; | 131 | return ret; |
132 | } | 132 | } |
133 | 133 | ||
134 | static int hpfs_write_end(struct file *file, struct address_space *mapping, | ||
135 | loff_t pos, unsigned len, unsigned copied, | ||
136 | struct page *pagep, void *fsdata) | ||
137 | { | ||
138 | struct inode *inode = mapping->host; | ||
139 | int err; | ||
140 | err = generic_write_end(file, mapping, pos, len, copied, pagep, fsdata); | ||
141 | if (err < len) | ||
142 | hpfs_write_failed(mapping, pos + len); | ||
143 | if (!(err < 0)) { | ||
144 | /* make sure we write it on close, if not earlier */ | ||
145 | hpfs_lock(inode->i_sb); | ||
146 | hpfs_i(inode)->i_dirty = 1; | ||
147 | hpfs_unlock(inode->i_sb); | ||
148 | } | ||
149 | return err; | ||
150 | } | ||
151 | |||
134 | static sector_t _hpfs_bmap(struct address_space *mapping, sector_t block) | 152 | static sector_t _hpfs_bmap(struct address_space *mapping, sector_t block) |
135 | { | 153 | { |
136 | return generic_block_bmap(mapping,block,hpfs_get_block); | 154 | return generic_block_bmap(mapping,block,hpfs_get_block); |
@@ -140,30 +158,16 @@ const struct address_space_operations hpfs_aops = { | |||
140 | .readpage = hpfs_readpage, | 158 | .readpage = hpfs_readpage, |
141 | .writepage = hpfs_writepage, | 159 | .writepage = hpfs_writepage, |
142 | .write_begin = hpfs_write_begin, | 160 | .write_begin = hpfs_write_begin, |
143 | .write_end = generic_write_end, | 161 | .write_end = hpfs_write_end, |
144 | .bmap = _hpfs_bmap | 162 | .bmap = _hpfs_bmap |
145 | }; | 163 | }; |
146 | 164 | ||
147 | static ssize_t hpfs_file_write(struct file *file, const char __user *buf, | ||
148 | size_t count, loff_t *ppos) | ||
149 | { | ||
150 | ssize_t retval; | ||
151 | |||
152 | retval = do_sync_write(file, buf, count, ppos); | ||
153 | if (retval > 0) { | ||
154 | hpfs_lock(file->f_path.dentry->d_sb); | ||
155 | hpfs_i(file_inode(file))->i_dirty = 1; | ||
156 | hpfs_unlock(file->f_path.dentry->d_sb); | ||
157 | } | ||
158 | return retval; | ||
159 | } | ||
160 | |||
161 | const struct file_operations hpfs_file_ops = | 165 | const struct file_operations hpfs_file_ops = |
162 | { | 166 | { |
163 | .llseek = generic_file_llseek, | 167 | .llseek = generic_file_llseek, |
164 | .read = do_sync_read, | 168 | .read = do_sync_read, |
165 | .aio_read = generic_file_aio_read, | 169 | .aio_read = generic_file_aio_read, |
166 | .write = hpfs_file_write, | 170 | .write = do_sync_write, |
167 | .aio_write = generic_file_aio_write, | 171 | .aio_write = generic_file_aio_write, |
168 | .mmap = generic_file_mmap, | 172 | .mmap = generic_file_mmap, |
169 | .release = hpfs_file_release, | 173 | .release = hpfs_file_release, |