aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-06-04 05:30:00 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-09 16:47:35 -0400
commit6a1a90ad1b0edb556a7550a6ef8a8756f0304dd5 (patch)
tree234488533d89e3f8b938823c2071be19e66e1b4b
parentd39aae9ec447dda84d9a2850743a78a535a71c90 (diff)
rename generic_setattr
Despite its name it's now a generic implementation of ->setattr, but rather a helper to copy attributes from a struct iattr to the inode. Rename it to setattr_copy to reflect this fact. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/attr.c14
-rw-r--r--fs/ext2/inode.c2
-rw-r--r--fs/fat/file.c2
-rw-r--r--fs/libfs.c3
-rw-r--r--fs/ramfs/file-nommu.c2
-rw-r--r--fs/sysfs/inode.c2
-rw-r--r--include/linux/fs.h2
-rw-r--r--mm/shmem.c2
8 files changed, 14 insertions, 15 deletions
diff --git a/fs/attr.c b/fs/attr.c
index b4fa3b0aa596..1f6a895e24e9 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -105,13 +105,13 @@ out_big:
105EXPORT_SYMBOL(inode_newsize_ok); 105EXPORT_SYMBOL(inode_newsize_ok);
106 106
107/** 107/**
108 * generic_setattr - copy simple metadata updates into the generic inode 108 * setattr_copy - copy simple metadata updates into the generic inode
109 * @inode: the inode to be updated 109 * @inode: the inode to be updated
110 * @attr: the new attributes 110 * @attr: the new attributes
111 * 111 *
112 * generic_setattr must be called with i_mutex held. 112 * setattr_copy must be called with i_mutex held.
113 * 113 *
114 * generic_setattr updates the inode's metadata with that specified 114 * setattr_copy updates the inode's metadata with that specified
115 * in attr. Noticably missing is inode size update, which is more complex 115 * in attr. Noticably missing is inode size update, which is more complex
116 * as it requires pagecache updates. See simple_setsize. 116 * as it requires pagecache updates. See simple_setsize.
117 * 117 *
@@ -119,7 +119,7 @@ EXPORT_SYMBOL(inode_newsize_ok);
119 * that for "simple" filesystems, the struct inode is the inode storage. 119 * that for "simple" filesystems, the struct inode is the inode storage.
120 * The caller is free to mark the inode dirty afterwards if needed. 120 * The caller is free to mark the inode dirty afterwards if needed.
121 */ 121 */
122void generic_setattr(struct inode *inode, const struct iattr *attr) 122void setattr_copy(struct inode *inode, const struct iattr *attr)
123{ 123{
124 unsigned int ia_valid = attr->ia_valid; 124 unsigned int ia_valid = attr->ia_valid;
125 125
@@ -144,11 +144,11 @@ void generic_setattr(struct inode *inode, const struct iattr *attr)
144 inode->i_mode = mode; 144 inode->i_mode = mode;
145 } 145 }
146} 146}
147EXPORT_SYMBOL(generic_setattr); 147EXPORT_SYMBOL(setattr_copy);
148 148
149/* 149/*
150 * note this function is deprecated, the new truncate sequence should be 150 * note this function is deprecated, the new truncate sequence should be
151 * used instead -- see eg. simple_setsize, generic_setattr. 151 * used instead -- see eg. simple_setsize, setattr_copy.
152 */ 152 */
153int inode_setattr(struct inode *inode, const struct iattr *attr) 153int inode_setattr(struct inode *inode, const struct iattr *attr)
154{ 154{
@@ -163,7 +163,7 @@ int inode_setattr(struct inode *inode, const struct iattr *attr)
163 return error; 163 return error;
164 } 164 }
165 165
166 generic_setattr(inode, attr); 166 setattr_copy(inode, attr);
167 167
168 mark_inode_dirty(inode); 168 mark_inode_dirty(inode);
169 169
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 74dfe5f73330..7dee7b3f3688 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -1544,7 +1544,7 @@ int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
1544 if (error) 1544 if (error)
1545 return error; 1545 return error;
1546 } 1546 }
1547 generic_setattr(inode, iattr); 1547 setattr_copy(inode, iattr);
1548 if (iattr->ia_valid & ATTR_MODE) 1548 if (iattr->ia_valid & ATTR_MODE)
1549 error = ext2_acl_chmod(inode); 1549 error = ext2_acl_chmod(inode);
1550 mark_inode_dirty(inode); 1550 mark_inode_dirty(inode);
diff --git a/fs/fat/file.c b/fs/fat/file.c
index 990dfae022e5..20813d2c7d61 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -446,7 +446,7 @@ int fat_setattr(struct dentry *dentry, struct iattr *attr)
446 goto out; 446 goto out;
447 } 447 }
448 448
449 generic_setattr(inode, attr); 449 setattr_copy(inode, attr);
450 mark_inode_dirty(inode); 450 mark_inode_dirty(inode);
451out: 451out:
452 return error; 452 return error;
diff --git a/fs/libfs.c b/fs/libfs.c
index dcaf972cbf1b..861a88797716 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -395,8 +395,7 @@ int simple_setattr(struct dentry *dentry, struct iattr *iattr)
395 return error; 395 return error;
396 } 396 }
397 397
398 generic_setattr(inode, iattr); 398 setattr_copy(inode, iattr);
399
400 return error; 399 return error;
401} 400}
402EXPORT_SYMBOL(simple_setattr); 401EXPORT_SYMBOL(simple_setattr);
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index d532c20fc179..8d44f0347b27 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -183,7 +183,7 @@ static int ramfs_nommu_setattr(struct dentry *dentry, struct iattr *ia)
183 } 183 }
184 } 184 }
185 185
186 generic_setattr(inode, ia); 186 setattr_copy(inode, ia);
187 out: 187 out:
188 ia->ia_valid = old_ia_valid; 188 ia->ia_valid = old_ia_valid;
189 return ret; 189 return ret;
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 0835a3b70e03..7e187fbd3d47 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -122,7 +122,7 @@ int sysfs_setattr(struct dentry *dentry, struct iattr *iattr)
122 goto out; 122 goto out;
123 123
124 /* this ignores size changes */ 124 /* this ignores size changes */
125 generic_setattr(inode, iattr); 125 setattr_copy(inode, iattr);
126 126
127out: 127out:
128 mutex_unlock(&sysfs_mutex); 128 mutex_unlock(&sysfs_mutex);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b347b2d5666f..8ebb5f01a418 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2393,7 +2393,7 @@ extern int buffer_migrate_page(struct address_space *,
2393extern int inode_change_ok(const struct inode *, struct iattr *); 2393extern int inode_change_ok(const struct inode *, struct iattr *);
2394extern int inode_newsize_ok(const struct inode *, loff_t offset); 2394extern int inode_newsize_ok(const struct inode *, loff_t offset);
2395extern int __must_check inode_setattr(struct inode *, const struct iattr *); 2395extern int __must_check inode_setattr(struct inode *, const struct iattr *);
2396extern void generic_setattr(struct inode *inode, const struct iattr *attr); 2396extern void setattr_copy(struct inode *inode, const struct iattr *attr);
2397 2397
2398extern void file_update_time(struct file *file); 2398extern void file_update_time(struct file *file);
2399 2399
diff --git a/mm/shmem.c b/mm/shmem.c
index f65f84062db5..3b58ad65d26c 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -811,7 +811,7 @@ static int shmem_notify_change(struct dentry *dentry, struct iattr *attr)
811 811
812 error = inode_change_ok(inode, attr); 812 error = inode_change_ok(inode, attr);
813 if (!error) 813 if (!error)
814 generic_setattr(inode, attr); 814 setattr_copy(inode, attr);
815#ifdef CONFIG_TMPFS_POSIX_ACL 815#ifdef CONFIG_TMPFS_POSIX_ACL
816 if (!error && (attr->ia_valid & ATTR_MODE)) 816 if (!error && (attr->ia_valid & ATTR_MODE))
817 error = generic_acl_chmod(inode); 817 error = generic_acl_chmod(inode);