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/cifspdu.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/cifspdu.h')
-rw-r--r-- | fs/cifs/cifspdu.h | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h index a785f69dbc9f..2d07f890a842 100644 --- a/fs/cifs/cifspdu.h +++ b/fs/cifs/cifspdu.h | |||
@@ -2328,19 +2328,7 @@ struct file_attrib_tag { | |||
2328 | typedef struct { | 2328 | typedef struct { |
2329 | __le32 NextEntryOffset; | 2329 | __le32 NextEntryOffset; |
2330 | __u32 ResumeKey; /* as with FileIndex - no need to convert */ | 2330 | __u32 ResumeKey; /* as with FileIndex - no need to convert */ |
2331 | __le64 EndOfFile; | 2331 | FILE_UNIX_BASIC_INFO basic; |
2332 | __le64 NumOfBytes; | ||
2333 | __le64 LastStatusChange; /*SNIA specs DCE time for the 3 time fields */ | ||
2334 | __le64 LastAccessTime; | ||
2335 | __le64 LastModificationTime; | ||
2336 | __le64 Uid; | ||
2337 | __le64 Gid; | ||
2338 | __le32 Type; | ||
2339 | __le64 DevMajor; | ||
2340 | __le64 DevMinor; | ||
2341 | __le64 UniqueId; | ||
2342 | __le64 Permissions; | ||
2343 | __le64 Nlinks; | ||
2344 | char FileName[1]; | 2332 | char FileName[1]; |
2345 | } __attribute__((packed)) FILE_UNIX_INFO; /* level 0x202 */ | 2333 | } __attribute__((packed)) FILE_UNIX_INFO; /* level 0x202 */ |
2346 | 2334 | ||