diff options
author | Christoph Hellwig <hch@lst.de> | 2010-06-04 05:30:00 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-08-09 16:47:35 -0400 |
commit | 6a1a90ad1b0edb556a7550a6ef8a8756f0304dd5 (patch) | |
tree | 234488533d89e3f8b938823c2071be19e66e1b4b /fs | |
parent | d39aae9ec447dda84d9a2850743a78a535a71c90 (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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/attr.c | 14 | ||||
-rw-r--r-- | fs/ext2/inode.c | 2 | ||||
-rw-r--r-- | fs/fat/file.c | 2 | ||||
-rw-r--r-- | fs/libfs.c | 3 | ||||
-rw-r--r-- | fs/ramfs/file-nommu.c | 2 | ||||
-rw-r--r-- | fs/sysfs/inode.c | 2 |
6 files changed, 12 insertions, 13 deletions
@@ -105,13 +105,13 @@ out_big: | |||
105 | EXPORT_SYMBOL(inode_newsize_ok); | 105 | EXPORT_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 | */ |
122 | void generic_setattr(struct inode *inode, const struct iattr *attr) | 122 | void 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 | } |
147 | EXPORT_SYMBOL(generic_setattr); | 147 | EXPORT_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 | */ |
153 | int inode_setattr(struct inode *inode, const struct iattr *attr) | 153 | int 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); |
451 | out: | 451 | out: |
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 | } |
402 | EXPORT_SYMBOL(simple_setattr); | 401 | EXPORT_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 | ||
127 | out: | 127 | out: |
128 | mutex_unlock(&sysfs_mutex); | 128 | mutex_unlock(&sysfs_mutex); |