diff options
Diffstat (limited to 'fs/ext4/file.c')
-rw-r--r-- | fs/ext4/file.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 9630583cef28..d0776e410f34 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/jbd2.h> | 23 | #include <linux/jbd2.h> |
24 | #include <linux/mount.h> | 24 | #include <linux/mount.h> |
25 | #include <linux/path.h> | 25 | #include <linux/path.h> |
26 | #include <linux/quotaops.h> | ||
26 | #include "ext4.h" | 27 | #include "ext4.h" |
27 | #include "ext4_jbd2.h" | 28 | #include "ext4_jbd2.h" |
28 | #include "xattr.h" | 29 | #include "xattr.h" |
@@ -35,9 +36,9 @@ | |||
35 | */ | 36 | */ |
36 | static int ext4_release_file(struct inode *inode, struct file *filp) | 37 | static int ext4_release_file(struct inode *inode, struct file *filp) |
37 | { | 38 | { |
38 | if (EXT4_I(inode)->i_state & EXT4_STATE_DA_ALLOC_CLOSE) { | 39 | if (ext4_test_inode_state(inode, EXT4_STATE_DA_ALLOC_CLOSE)) { |
39 | ext4_alloc_da_blocks(inode); | 40 | ext4_alloc_da_blocks(inode); |
40 | EXT4_I(inode)->i_state &= ~EXT4_STATE_DA_ALLOC_CLOSE; | 41 | ext4_clear_inode_state(inode, EXT4_STATE_DA_ALLOC_CLOSE); |
41 | } | 42 | } |
42 | /* if we are the last writer on the inode, drop the block reservation */ | 43 | /* if we are the last writer on the inode, drop the block reservation */ |
43 | if ((filp->f_mode & FMODE_WRITE) && | 44 | if ((filp->f_mode & FMODE_WRITE) && |
@@ -116,18 +117,16 @@ static int ext4_file_open(struct inode * inode, struct file * filp) | |||
116 | * devices or filesystem images. | 117 | * devices or filesystem images. |
117 | */ | 118 | */ |
118 | memset(buf, 0, sizeof(buf)); | 119 | memset(buf, 0, sizeof(buf)); |
119 | path.mnt = mnt->mnt_parent; | 120 | path.mnt = mnt; |
120 | path.dentry = mnt->mnt_mountpoint; | 121 | path.dentry = mnt->mnt_root; |
121 | path_get(&path); | ||
122 | cp = d_path(&path, buf, sizeof(buf)); | 122 | cp = d_path(&path, buf, sizeof(buf)); |
123 | path_put(&path); | ||
124 | if (!IS_ERR(cp)) { | 123 | if (!IS_ERR(cp)) { |
125 | memcpy(sbi->s_es->s_last_mounted, cp, | 124 | memcpy(sbi->s_es->s_last_mounted, cp, |
126 | sizeof(sbi->s_es->s_last_mounted)); | 125 | sizeof(sbi->s_es->s_last_mounted)); |
127 | sb->s_dirt = 1; | 126 | sb->s_dirt = 1; |
128 | } | 127 | } |
129 | } | 128 | } |
130 | return generic_file_open(inode, filp); | 129 | return dquot_file_open(inode, filp); |
131 | } | 130 | } |
132 | 131 | ||
133 | const struct file_operations ext4_file_operations = { | 132 | const struct file_operations ext4_file_operations = { |