| Changes by: cha0smaster
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23076/ntfsprogs
Modified Files:
	ntfsmount.c 
Log Message:
ntfsmount: add static inline to mark free space outdated (Thanks Szaka)
Index: ntfsmount.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmount.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -p -r1.62 -r1.63
--- ntfsmount.c	24 Nov 2005 15:06:11 -0000	1.62
+++ ntfsmount.c	25 Nov 2005 14:31:29 -0000	1.63
@@ -183,6 +183,12 @@ static long ntfs_fuse_get_nr_free_cluste
 	return nr_free;
 }
 
+static __inline__ void ntfs_fuse_mark_free_space_outdate()
+{
+	/* Mark information about free MFT record and clusters outdate. */
+	ctx->state |= (NF_FreeClustersOutdate | NF_FreeMFTOutdate);
+}
+
 /**
  * ntfs_fuse_statfs - return information about mounted NTFS volume
  * @path:	ignored (but fuse requires it)
@@ -645,7 +651,7 @@ static int ntfs_fuse_write(const char *o
 	}
 	res = total;
 exit:
-	ctx->state |= (NF_FreeClustersOutdate | NF_FreeMFTOutdate);
+	ntfs_fuse_mark_free_space_outdate();
 	if (na)
 		ntfs_attr_close(na);
 	if (ni && ntfs_inode_close(ni))
@@ -681,7 +687,7 @@ static int ntfs_fuse_truncate(const char
 		goto exit;
 	}
 	res = ntfs_attr_truncate(na, size);
-	ctx->state |= (NF_FreeClustersOutdate | NF_FreeMFTOutdate);
+	ntfs_fuse_mark_free_space_outdate();
 	ntfs_attr_close(na);
 exit:
 	if (ni && ntfs_inode_close(ni))
@@ -814,8 +820,7 @@ static int ntfs_fuse_mknod(const char *o
 	else
 		res = ntfs_fuse_create_stream(path, stream_name,
 				stream_name_len);
-	/* Mark information about free MFT record and clusters outdate. */
-	ctx->state |= (NF_FreeClustersOutdate | NF_FreeMFTOutdate);
+	ntfs_fuse_mark_free_space_outdate();
 exit:
 	free(path);
 	if (stream_name_len)
@@ -828,8 +833,7 @@ static int ntfs_fuse_symlink(const char 
 	if (strchr(from, ':') &&	/* n/a for named data streams. */
 			ctx->streams == NF_STREAMS_INTERFACE_WINDOWS)
 		return -EINVAL;
-	/* Mark information about free MFT record and clusters outdate. */
-	ctx->state |= (NF_FreeClustersOutdate | NF_FreeMFTOutdate);
+	ntfs_fuse_mark_free_space_outdate();
 	return ntfs_fuse_create(from, S_IFLNK, 0, to);
 }
 
@@ -873,8 +877,7 @@ static int ntfs_fuse_link(const char *ol
 			res = -EIO;
 		goto exit;
 	}
-	/* Mark information about free MFT record and clusters outdate. */
-	ctx->state |= (NF_FreeClustersOutdate | NF_FreeMFTOutdate);
+	ntfs_fuse_mark_free_space_outdate();
 	/* Create hard link. */
 	if (ntfs_link(ni, dir_ni, uname, uname_len))
 		res = -errno;
@@ -975,8 +978,7 @@ static int ntfs_fuse_unlink(const char *
 		res = ntfs_fuse_rm(path);
 	else
 		res = ntfs_fuse_rm_stream(path, stream_name, stream_name_len);
-	/* Mark information about free MFT record and clusters outdate. */
-	ctx->state |= (NF_FreeClustersOutdate | NF_FreeMFTOutdate);
+	ntfs_fuse_mark_free_space_outdate();
 	free(path);
 	if (stream_name_len)
 		free(stream_name);
@@ -1001,8 +1003,7 @@ static int ntfs_fuse_mkdir(const char *p
 {
 	if (strchr(path, ':') && ctx->streams == NF_STREAMS_INTERFACE_WINDOWS)
 		return -EINVAL; /* n/a for named data streams. */
-	/* Mark information about free MFT record and clusters outdate. */
-	ctx->state |= (NF_FreeClustersOutdate | NF_FreeMFTOutdate);
+	ntfs_fuse_mark_free_space_outdate();
 	return ntfs_fuse_create(path, S_IFDIR, 0, NULL);
 }
 
@@ -1010,8 +1011,7 @@ static int ntfs_fuse_rmdir(const char *p
 {
 	if (strchr(path, ':') && ctx->streams == NF_STREAMS_INTERFACE_WINDOWS)
 		return -EINVAL; /* n/a for named data streams. */
-	/* Mark information about free MFT record and clusters outdate. */
-	ctx->state |= (NF_FreeClustersOutdate | NF_FreeMFTOutdate);
+	ntfs_fuse_mark_free_space_outdate();
 	return ntfs_fuse_rm(path);
 }
 
@@ -1257,8 +1257,7 @@ static int ntfs_fuse_setxattr(const char
 		res = -EEXIST;
 		goto exit;
 	}
-	/* Mark information about free MFT record and clusters outdate. */
-	ctx->state |= (NF_FreeClustersOutdate | NF_FreeMFTOutdate);
+	ntfs_fuse_mark_free_space_outdate();
 	if (!na) {
 		if (flags == XATTR_REPLACE) {
 			res = -ENODATA;
@@ -1318,8 +1317,7 @@ static int ntfs_fuse_removexattr(const c
 		res = -ENODATA;
 		goto exit;
 	}
-	/* Mark information about free MFT record and clusters outdate. */
-	ctx->state |= (NF_FreeClustersOutdate | NF_FreeMFTOutdate);
+	ntfs_fuse_mark_free_space_outdate();
 	if (ntfs_attr_rm(na))
 		res = -errno;
 	else
 |