diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-06-25 00:56:52 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-07-01 17:26:42 -0400 |
commit | cc0bad7552308e8905d6ea56e6b7811fa67e716d (patch) | |
tree | c02a91f13a502f444330b91b36ab12f55f352268 /fs/cifs/cifsglob.h | |
parent | d960eea974f5e500c0dcb95a934239cc1f481cfd (diff) |
cifs: add new cifs_iget function and convert unix codepath to use it
cifs: add new cifs_iget function and convert unix codepath to use it
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.
Add a new cifs_iget function that uses iget5_locked to identify inodes.
This will compare inodes based on the uniqueid value in a cifs_fattr
struct.
Rather than filling out an already-created inode, have
cifs_get_inode_info_unix instead fill out cifs_fattr and hand that off
to cifs_iget. cifs_iget can then properly look for hardlinked inodes.
On the readdir side, add a new cifs_readdir_lookup function that spawns
populated dentries. Redefine FILE_UNIX_INFO so that it's basically a
FILE_UNIX_BASIC_INFO that has a few fields wrapped around it. This
allows us to more easily use the same function for filling out the fattr
as the non-readdir codepath.
With this, we should then have proper hardlink detection and can
eventually get rid of some nasty CIFS-specific hacks for handing them.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r-- | fs/cifs/cifsglob.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index e1225e6ded2f..e6435cba8113 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -371,6 +371,7 @@ struct cifsInodeInfo { | |||
371 | bool oplockPending:1; | 371 | bool oplockPending:1; |
372 | bool delete_pending:1; /* DELETE_ON_CLOSE is set */ | 372 | bool delete_pending:1; /* DELETE_ON_CLOSE is set */ |
373 | u64 server_eof; /* current file size on server */ | 373 | u64 server_eof; /* current file size on server */ |
374 | u64 uniqueid; /* server inode number */ | ||
374 | struct inode vfs_inode; | 375 | struct inode vfs_inode; |
375 | }; | 376 | }; |
376 | 377 | ||
@@ -472,6 +473,30 @@ struct dfs_info3_param { | |||
472 | char *node_name; | 473 | char *node_name; |
473 | }; | 474 | }; |
474 | 475 | ||
476 | /* | ||
477 | * common struct for holding inode info when searching for or updating an | ||
478 | * inode with new info | ||
479 | */ | ||
480 | |||
481 | #define CIFS_FATTR_DFS_REFERRAL 0x1 | ||
482 | |||
483 | struct cifs_fattr { | ||
484 | u32 cf_flags; | ||
485 | u32 cf_cifsattrs; | ||
486 | u64 cf_uniqueid; | ||
487 | u64 cf_eof; | ||
488 | u64 cf_bytes; | ||
489 | uid_t cf_uid; | ||
490 | gid_t cf_gid; | ||
491 | umode_t cf_mode; | ||
492 | dev_t cf_rdev; | ||
493 | unsigned int cf_nlink; | ||
494 | unsigned int cf_dtype; | ||
495 | struct timespec cf_atime; | ||
496 | struct timespec cf_mtime; | ||
497 | struct timespec cf_ctime; | ||
498 | }; | ||
499 | |||
475 | static inline void free_dfs_info_param(struct dfs_info3_param *param) | 500 | static inline void free_dfs_info_param(struct dfs_info3_param *param) |
476 | { | 501 | { |
477 | if (param) { | 502 | if (param) { |