diff options
Diffstat (limited to 'fs/ufs')
| -rw-r--r-- | fs/ufs/inode.c | 2 | ||||
| -rw-r--r-- | fs/ufs/namei.c | 2 | ||||
| -rw-r--r-- | fs/ufs/symlink.c | 8 | ||||
| -rw-r--r-- | fs/ufs/truncate.c | 10 | ||||
| -rw-r--r-- | fs/ufs/ufs.h | 2 |
5 files changed, 17 insertions, 7 deletions
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index 80b68c3702d1..cffa756f1047 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c | |||
| @@ -603,7 +603,7 @@ static void ufs_set_inode_ops(struct inode *inode) | |||
| 603 | if (!inode->i_blocks) | 603 | if (!inode->i_blocks) |
| 604 | inode->i_op = &ufs_fast_symlink_inode_operations; | 604 | inode->i_op = &ufs_fast_symlink_inode_operations; |
| 605 | else { | 605 | else { |
| 606 | inode->i_op = &page_symlink_inode_operations; | 606 | inode->i_op = &ufs_symlink_inode_operations; |
| 607 | inode->i_mapping->a_ops = &ufs_aops; | 607 | inode->i_mapping->a_ops = &ufs_aops; |
| 608 | } | 608 | } |
| 609 | } else | 609 | } else |
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index 118556243e7a..eabc02eb1294 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c | |||
| @@ -148,7 +148,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry, | |||
| 148 | 148 | ||
| 149 | if (l > UFS_SB(sb)->s_uspi->s_maxsymlinklen) { | 149 | if (l > UFS_SB(sb)->s_uspi->s_maxsymlinklen) { |
| 150 | /* slow symlink */ | 150 | /* slow symlink */ |
| 151 | inode->i_op = &page_symlink_inode_operations; | 151 | inode->i_op = &ufs_symlink_inode_operations; |
| 152 | inode->i_mapping->a_ops = &ufs_aops; | 152 | inode->i_mapping->a_ops = &ufs_aops; |
| 153 | err = page_symlink(inode, symname, l); | 153 | err = page_symlink(inode, symname, l); |
| 154 | if (err) | 154 | if (err) |
diff --git a/fs/ufs/symlink.c b/fs/ufs/symlink.c index c0156eda44bc..d283628b4778 100644 --- a/fs/ufs/symlink.c +++ b/fs/ufs/symlink.c | |||
| @@ -42,4 +42,12 @@ static void *ufs_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
| 42 | const struct inode_operations ufs_fast_symlink_inode_operations = { | 42 | const struct inode_operations ufs_fast_symlink_inode_operations = { |
| 43 | .readlink = generic_readlink, | 43 | .readlink = generic_readlink, |
| 44 | .follow_link = ufs_follow_link, | 44 | .follow_link = ufs_follow_link, |
| 45 | .setattr = ufs_setattr, | ||
| 46 | }; | ||
| 47 | |||
| 48 | const struct inode_operations ufs_symlink_inode_operations = { | ||
| 49 | .readlink = generic_readlink, | ||
| 50 | .follow_link = page_follow_link_light, | ||
| 51 | .put_link = page_put_link, | ||
| 52 | .setattr = ufs_setattr, | ||
| 45 | }; | 53 | }; |
diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c index d3b6270cb377..f294c44577dc 100644 --- a/fs/ufs/truncate.c +++ b/fs/ufs/truncate.c | |||
| @@ -508,7 +508,7 @@ out: | |||
| 508 | * - there is no way to know old size | 508 | * - there is no way to know old size |
| 509 | * - there is no way inform user about error, if it happens in `truncate' | 509 | * - there is no way inform user about error, if it happens in `truncate' |
| 510 | */ | 510 | */ |
| 511 | static int ufs_setattr(struct dentry *dentry, struct iattr *attr) | 511 | int ufs_setattr(struct dentry *dentry, struct iattr *attr) |
| 512 | { | 512 | { |
| 513 | struct inode *inode = dentry->d_inode; | 513 | struct inode *inode = dentry->d_inode; |
| 514 | unsigned int ia_valid = attr->ia_valid; | 514 | unsigned int ia_valid = attr->ia_valid; |
| @@ -518,18 +518,18 @@ static int ufs_setattr(struct dentry *dentry, struct iattr *attr) | |||
| 518 | if (error) | 518 | if (error) |
| 519 | return error; | 519 | return error; |
| 520 | 520 | ||
| 521 | if (is_quota_modification(inode, attr)) | ||
| 522 | dquot_initialize(inode); | ||
| 523 | |||
| 521 | if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || | 524 | if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || |
| 522 | (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) { | 525 | (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) { |
| 523 | error = dquot_transfer(inode, attr); | 526 | error = dquot_transfer(inode, attr); |
| 524 | if (error) | 527 | if (error) |
| 525 | return error; | 528 | return error; |
| 526 | } | 529 | } |
| 527 | if (ia_valid & ATTR_SIZE && | 530 | if (ia_valid & ATTR_SIZE && attr->ia_size != inode->i_size) { |
| 528 | attr->ia_size != i_size_read(inode)) { | ||
| 529 | loff_t old_i_size = inode->i_size; | 531 | loff_t old_i_size = inode->i_size; |
| 530 | 532 | ||
| 531 | dquot_initialize(inode); | ||
| 532 | |||
| 533 | error = vmtruncate(inode, attr->ia_size); | 533 | error = vmtruncate(inode, attr->ia_size); |
| 534 | if (error) | 534 | if (error) |
| 535 | return error; | 535 | return error; |
diff --git a/fs/ufs/ufs.h b/fs/ufs/ufs.h index 43f9f5d5670e..179ae6b3180a 100644 --- a/fs/ufs/ufs.h +++ b/fs/ufs/ufs.h | |||
| @@ -122,9 +122,11 @@ extern void ufs_panic (struct super_block *, const char *, const char *, ...) __ | |||
| 122 | 122 | ||
| 123 | /* symlink.c */ | 123 | /* symlink.c */ |
| 124 | extern const struct inode_operations ufs_fast_symlink_inode_operations; | 124 | extern const struct inode_operations ufs_fast_symlink_inode_operations; |
| 125 | extern const struct inode_operations ufs_symlink_inode_operations; | ||
| 125 | 126 | ||
| 126 | /* truncate.c */ | 127 | /* truncate.c */ |
| 127 | extern int ufs_truncate (struct inode *, loff_t); | 128 | extern int ufs_truncate (struct inode *, loff_t); |
| 129 | extern int ufs_setattr(struct dentry *dentry, struct iattr *attr); | ||
| 128 | 130 | ||
| 129 | static inline struct ufs_sb_info *UFS_SB(struct super_block *sb) | 131 | static inline struct ufs_sb_info *UFS_SB(struct super_block *sb) |
| 130 | { | 132 | { |
