[linux-cifs-client] [PATCH 00/13] cifs: implement proper hardlink detection

Jeff Layton jlayton at redhat.com
Mon May 11 20:24:19 GMT 2009


This is a second pass at a patchset to implement proper hardlink
handling in CIFS. The first set was posted a little more than a month
ago and only implemented this for mounts with posix extensions. This
patchset should also implement it for non-posix mounts, as long as the
server is capable of reporting uniqueid's.

The idea here is to add a new cifs_fattr struct that acts as a container
for file attributes returned by the server. Each "dialect" has a
translation routine that converts the info returned by the server to
this container.

This approach allows us to use iget5_locked get references to inodes,
which allows us to identify hardlinks at inode instantiation time. It
also results in around a 250 line reduction in code. This is mostly due
to the fact that the patchset eliminates a lot of cut-and-paste code
duplication and some hardlink handling hackery that should no longer be
needed.

The set should be bisectable if committed in order, but I've not done
any real testing on anything but the complete set. I've also only tested
it with the most commonly used options (posix extensions and nounix).
The less commonly traveled codepaths also need to be tested (cifsacl,
sfu, etc).

I see this as 2.6.31 material.

Comments and suggestions appreciated.

Jeff Layton (13):
  cifs: have cifs_NTtimeToUnix take a little-endian arg
  cifs: make cnvrtDosUnixTm take a little-endian args and an offset
  cifs: allow get_cifs_acl to be called without an inode
  cifs: rename cifs_iget to cifs_root_iget
  cifs: add new cifs_fattr struct for holding cifs inode attributes in
    common way
  cifs: add new cifs_iget function and convert unix codepath to use it
  cifs: convert posix readdir codepath to use cifs_iget
  cifs: convert cifs_get_inode_info to use cifs_iget
  cifs: convert non-posix readdir codepath to use cifs_iget
  cifs: remove cifs_new_inode
  cifs: make serverino the default when mounting
  cifs: remove cifsInodeInfo->inUse counter
  cifs: remove "hardlink detection" from cifs_rename

 fs/cifs/cifsacl.c   |   50 ++--
 fs/cifs/cifsfs.c    |    3 +-
 fs/cifs/cifsfs.h    |   15 +-
 fs/cifs/cifsglob.h  |   29 ++-
 fs/cifs/cifsproto.h |   19 +-
 fs/cifs/cifssmb.c   |    4 +-
 fs/cifs/connect.c   |    2 +
 fs/cifs/dir.c       |   25 +-
 fs/cifs/file.c      |    2 +-
 fs/cifs/inode.c     |  811 ++++++++++++++++++++++-----------------------------
 fs/cifs/netmisc.c   |   24 +-
 fs/cifs/readdir.c   |  571 +++++++++++++------------------------
 12 files changed, 649 insertions(+), 906 deletions(-)



More information about the linux-cifs-client mailing list