View | Details | Raw Unified | Return to bug 381259
Collapse All | Expand All

(-)file_not_specified_in_diff (-4 / +25 lines)
Line  Link Here
patches.apparmor/fsetattr.diff eliminated ia_file and ATTR_FILE in favor
patches.apparmor/fsetattr.diff eliminated ia_file and ATTR_FILE in favor
1
of providing a ->fsetattr call that used a file pointer. Until this
1
of providing a ->fsetattr call that used a file pointer. Until this
2
patch is accepted into mainline, this patch provides the backward
2
patch is accepted into mainline, this patch provides the backward
3
compatibility for external file system modules.
3
compatibility for external file system modules.
4
--
5
fs/attr.c          |   13 ++++++++++++-
4
fs/attr.c          |   13 ++++++++++++-
6
include/linux/fs.h |   11 +++++++++++
5
include/linux/fs.h |   11 +++++++++++
7
2 files changed, 23 insertions(+), 1 deletion(-)
6
2 files changed, 23 insertions(+), 1 deletion(-)
8
-- a/fs/attr.c
7
++ b/fs/attr.c
Lines 163-170 int fnotify_change(struct dentry *dentry Link Here
163
		if (!error) {
163
		if (!error) {
164
			if (file && file->f_op && file->f_op->fsetattr)
164
			if (file && file->f_op && file->f_op->fsetattr)
165
				error = file->f_op->fsetattr(file, attr);
165
				error = file->f_op->fsetattr(file, attr);
166
			else
166
			else {
167
				/* External file system still expect to be
168
				 * passed a file pointer via ia_file and
169
				 * have it announced via ATTR_FILE. This
170
				 * just makes it so they don't need to
171
				 * change their API just for us. External
172
				 * callers will have set these themselves. */
173
				if (file) {
174
					attr->ia_valid |= ATTR_FILE;
175
					attr->ia_file = file;
176
				}
167
				error = inode->i_op->setattr(dentry, attr);
177
				error = inode->i_op->setattr(dentry, attr);
178
			}
168
		}
179
		}
169
	} else {
180
	} else {
170
		error = inode_change_ok(inode, attr);
181
		error = inode_change_ok(inode, attr);
171
-- a/include/linux/fs.h
182
++ b/include/linux/fs.h
Lines 353-358 struct iattr { Link Here
353
	struct timespec	ia_atime;
353
	struct timespec	ia_atime;
354
	struct timespec	ia_mtime;
354
	struct timespec	ia_mtime;
355
	struct timespec	ia_ctime;
355
	struct timespec	ia_ctime;
356
357
	/*
358
	 * Not an attribute, but an auxilary info for filesystems wanting to
359
	 * implement an ftruncate() like method.  NOTE: filesystem should
360
	 * check for (ia_valid & ATTR_FILE), and not for (ia_file != NULL).
361
	 *
362
	 * NOTE: With patches.apparmor/fsetattr.diff applied, this is
363
	 * for compatibility with external file system modules only. There
364
	 * should not be any in-kernel users left.
365
	 */
366
	struct file	*ia_file;
356
};
367
};
357
368
358
/*
369
/*

Return to bug 381259