fid.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * V9FS FID Management
  3. *
  4. * Copyright (C) 2005 by Eric Van Hensbergen <ericvh@gmail.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to:
  18. * Free Software Foundation
  19. * 51 Franklin Street, Fifth Floor
  20. * Boston, MA 02111-1301 USA
  21. *
  22. */
  23. #include <linux/list.h>
  24. #define FID_OP 0
  25. #define FID_WALK 1
  26. #define FID_CREATE 2
  27. struct v9fs_fid {
  28. struct list_head list; /* list of fids associated with a dentry */
  29. struct list_head active; /* XXX - debug */
  30. u32 fid;
  31. unsigned char fidopen; /* set when fid is opened */
  32. unsigned char fidcreate; /* set when fid was just created */
  33. unsigned char fidclunked; /* set when fid has already been clunked */
  34. struct v9fs_qid qid;
  35. u32 iounit;
  36. /* readdir stuff */
  37. int rdir_fpos;
  38. loff_t rdir_pos;
  39. struct v9fs_fcall *rdir_fcall;
  40. /* management stuff */
  41. pid_t pid; /* thread associated with this fid */
  42. uid_t uid; /* user associated with this fid */
  43. /* private data */
  44. struct file *filp; /* backpointer to File struct for open files */
  45. struct v9fs_session_info *v9ses; /* session info for this FID */
  46. };
  47. struct v9fs_fid *v9fs_fid_lookup(struct dentry *dentry);
  48. struct v9fs_fid *v9fs_fid_get_created(struct dentry *);
  49. void v9fs_fid_destroy(struct v9fs_fid *fid);
  50. struct v9fs_fid *v9fs_fid_create(struct dentry *,
  51. struct v9fs_session_info *v9ses, int fid, int create);