diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-10-05 01:18:40 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-10-05 01:18:40 +0000 |
commit | 012bb3e61e5eced6c610f9e036372bf0c8def2d1 (patch) | |
tree | 87efc733f9b164e8c85c0336f92c8fb7eff6d183 /fs/attr.c | |
parent | 625a1589d3d6464b5d90b8a0918789e3afffd220 (diff) |
Merge with Linux 2.4.0-test9. Please check DECstation, I had a number
of rejects to fixup while integrating Linus patches. I also found
that this kernel will only boot SMP on Origin; the UP kernel freeze
soon after bootup with SCSI timeout messages. I commit this anyway
since I found that the last CVS versions had the same problem.
Diffstat (limited to 'fs/attr.c')
-rw-r--r-- | fs/attr.c | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -9,6 +9,8 @@ #include <linux/mm.h> #include <linux/string.h> #include <linux/smp_lock.h> +#include <linux/dnotify.h> +#include <linux/fcntl.h> /* Taken over from the old code... */ @@ -79,6 +81,28 @@ void inode_setattr(struct inode * inode, struct iattr * attr) mark_inode_dirty(inode); } +static int setattr_mask(unsigned int ia_valid) +{ + unsigned long dn_mask = 0; + + if (ia_valid & ATTR_UID) + dn_mask |= DN_ATTRIB; + if (ia_valid & ATTR_GID) + dn_mask |= DN_ATTRIB; + if (ia_valid & ATTR_SIZE) + dn_mask |= DN_MODIFY; + /* both times implies a utime(s) call */ + if ((ia_valid & (ATTR_ATIME|ATTR_MTIME)) == (ATTR_ATIME|ATTR_MTIME)) + dn_mask |= DN_ATTRIB; + else if (ia_valid & ATTR_ATIME) + dn_mask |= DN_ACCESS; + else if (ia_valid & ATTR_MTIME) + dn_mask |= DN_MODIFY; + if (ia_valid & ATTR_MODE) + dn_mask |= DN_ATTRIB; + return dn_mask; +} + int notify_change(struct dentry * dentry, struct iattr * attr) { struct inode *inode = dentry->d_inode; @@ -101,5 +125,10 @@ int notify_change(struct dentry * dentry, struct iattr * attr) inode_setattr(inode, attr); } unlock_kernel(); + if (!error) { + unsigned long dn_mask = setattr_mask(ia_valid); + if (dn_mask) + inode_dir_notify(dentry->d_parent->d_inode, dn_mask); + } return error; } |