summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs/ffs_alloc.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-01-27 21:48:47 +0000
committerrwatson <rwatson@FreeBSD.org>2009-01-27 21:48:47 +0000
commitc99f201c9eed9159ea6ab00a0bac551174f7e125 (patch)
treecb79a37ed44f348b4bc89493293e632b5eb22f7b /sys/ufs/ffs/ffs_alloc.c
parent5f74942998479b79250f585067f2adf70b583c5b (diff)
downloadFreeBSD-src-c99f201c9eed9159ea6ab00a0bac551174f7e125.zip
FreeBSD-src-c99f201c9eed9159ea6ab00a0bac551174f7e125.tar.gz
Following a fair amount of real world experience with ACLs and
extended attributes since FreeBSD 5, make the following semantic changes: - Don't update the inode modification time (mtime) when extended attributes (and hence also ACLs) are added, modified, or removed. - Don't update the inode access tie (atime) when extended attributes (and hence also ACLs) are queried. This means that rsync (and related tools) won't improperly think that the data in the file has changed when only the ACL has changed. Note that ffs_reallocblks() has not been changed to not update on an IO_EXT transaction, but currently EAs don't use the cluster write routines so this shouldn't be a problem. If EAs grow support for clustering, then VOP_REALLOCBLKS() will need to grow a flag argument to carry down IO_EXT to UFS. MFC after: 1 week PR: ports/125739 Reported by: Alexander Zagrebin <alexz@visp.ru> Tested by: pluknet <pluknet@gmail.com>, Greg Byshenk <freebsd@byshenk.net> Discussed with: kib, kientzle, timur, Alexander Bokovoy <ab@samba.org>
Diffstat (limited to 'sys/ufs/ffs/ffs_alloc.c')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index a72137e..e21a484 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -130,10 +130,10 @@ static int ffs_reallocblks_ufs2(struct vop_reallocblks_args *);
* available block is located.
*/
int
-ffs_alloc(ip, lbn, bpref, size, cred, bnp)
+ffs_alloc(ip, lbn, bpref, size, flags, cred, bnp)
struct inode *ip;
ufs2_daddr_t lbn, bpref;
- int size;
+ int size, flags;
struct ucred *cred;
ufs2_daddr_t *bnp;
{
@@ -191,7 +191,10 @@ retry:
UFS_UNLOCK(ump);
}
DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta);
- ip->i_flag |= IN_CHANGE | IN_UPDATE;
+ if (flags & IO_EXT)
+ ip->i_flag |= IN_CHANGE;
+ else
+ ip->i_flag |= IN_CHANGE | IN_UPDATE;
*bnp = bno;
return (0);
}
@@ -227,12 +230,12 @@ nospace:
* invoked to get an appropriate block.
*/
int
-ffs_realloccg(ip, lbprev, bprev, bpref, osize, nsize, cred, bpp)
+ffs_realloccg(ip, lbprev, bprev, bpref, osize, nsize, flags, cred, bpp)
struct inode *ip;
ufs2_daddr_t lbprev;
ufs2_daddr_t bprev;
ufs2_daddr_t bpref;
- int osize, nsize;
+ int osize, nsize, flags;
struct ucred *cred;
struct buf **bpp;
{
@@ -317,7 +320,10 @@ retry:
UFS_UNLOCK(ump);
}
DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta);
- ip->i_flag |= IN_CHANGE | IN_UPDATE;
+ if (flags & IO_EXT)
+ ip->i_flag |= IN_CHANGE;
+ else
+ ip->i_flag |= IN_CHANGE | IN_UPDATE;
allocbuf(bp, nsize);
bp->b_flags |= B_DONE;
if ((bp->b_flags & (B_MALLOC | B_VMIO)) != B_VMIO)
@@ -392,7 +398,10 @@ retry:
UFS_UNLOCK(ump);
}
DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta);
- ip->i_flag |= IN_CHANGE | IN_UPDATE;
+ if (flags & IO_EXT)
+ ip->i_flag |= IN_CHANGE;
+ else
+ ip->i_flag |= IN_CHANGE | IN_UPDATE;
allocbuf(bp, nsize);
bp->b_flags |= B_DONE;
if ((bp->b_flags & (B_MALLOC | B_VMIO)) != B_VMIO)
OpenPOWER on IntegriCloud