diff mbox

[linux-cifs-client,05/13] cifs: add new cifs_fattr struct for holding cifs inode attributes in common way

Message ID 1242073472-7100-6-git-send-email-jlayton@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton May 11, 2009, 8:24 p.m. UTC
In order to unify some codepaths, introduce a common cifs_fattr struct
for storing inode attributes. The different codepaths (unix, legacy,
normal, etc...) can fill out this struct with inode info. It can then
be passed as an arg to a common set of routines to get and update inodes.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 fs/cifs/cifsglob.h |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

Comments

Christoph Hellwig May 11, 2009, 9:01 p.m. UTC | #1
On Mon, May 11, 2009 at 04:24:24PM -0400, Jeff Layton wrote:
> In order to unify some codepaths, introduce a common cifs_fattr struct
> for storing inode attributes. The different codepaths (unix, legacy,
> normal, etc...) can fill out this struct with inode info. It can then
> be passed as an arg to a common set of routines to get and update inodes.

Looks good, but should probably be merged into the next patch so that
we introduce a user together with the new structure.
diff mbox

Patch

diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index a61ab77..6a0abc0 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -472,6 +472,29 @@  struct dfs_info3_param {
 	char *node_name;
 };
 
+
+/*
+ * common struct for holding inode info when searching for or updating an
+ * inode with new info
+ */
+
+struct cifs_fattr {
+	u32		cf_flags;
+	u32		cf_cifsattrs;
+	u64		cf_uniqueid;
+	u64		cf_eof;
+	u64		cf_bytes;
+	uid_t		cf_uid;
+	gid_t		cf_gid;
+	umode_t		cf_mode;
+	dev_t		cf_rdev;
+	unsigned int	cf_nlink;
+	unsigned int	cf_dtype;
+	struct timespec	cf_atime;
+	struct timespec	cf_mtime;
+	struct timespec	cf_ctime;
+};
+
 static inline void free_dfs_info_param(struct dfs_info3_param *param)
 {
 	if (param) {