We have a use case for walking the file system where just path information is
not sufficient, we use an application agedu (
http://www.chiark.greenend.org.uk/~sgtatham/agedu/ ) which apart from walking
the file can take a text file as its data source and with this we can see where
old data is and when it was last accessed in an easy to understand graphical
form. An additional use case would be a file system where we quota disc space
via groups, and finding directories with out the setguid bit set so that
permission can be enforced would be useful ( although implementing -perm would
be preferable and could be investigated independantly).
I have been thinking about how hard it would be to extend lfs find to provide
additional information. I thought I would have a look at the code a while ago
and I have thrown something together.
I would like to know if
a) This is a reasonable approach.
b) if the stat structure in param passed into cb_find_init is known always to
be valid, is there a better way of getting the size back from the MDS than
doing a stat ?
It would be used thus:
./lfs find /lustre/scratch101/blastdb/Supported/ --ls | head
147456 1328639981 1327687808 1327687808 356 0 40755
/lustre/scratch101/blastdb/Supported/
222153834 1327502260 1324495116 1324495116 356 102 100644
/lustre/scratch101/blastdb/Supported/embl_est_inv-3.nhr
248 1328573050 1326893658 1326893658 356 102 100644
/lustre/scratch101/blastdb/Supported/nr.pal
1000000120 1323250179 1324499009 1324499009 356 102 100644
/lustre/scratch101/blastdb/Supported/embl_gss_mus-2
11936568 1323250179 1324499103 1324499103 356 102 100644
/lustre/scratch101/blastdb/Supported/embl_gss_pln-1.xnt
4096 1328692476 1328544166 1328544394 356 102 40755
/lustre/scratch101/blastdb/Supported/uniprot_index
ls -la /lustre/scratch101/blastdb/Supported/embl_est_inv-3.nhr
-rw-r--r-- 1 pubseq crontab 222153834 2011-12-21 19:18
/lustre/scratch101/blastdb/Supported/embl_est_inv-3.nhr
I believe this patch set is based off lustre-1.8.7wc1
> 2043,2058c2043,2047
> < if (param->ls) {
> < if (param->have_fileinfo == 0) {
> < /*if (st->st_size == 0 ) {*/
> < /* Here I would like to pull
> < * back the size guess back from
> < * the MDS but I need a hint :) */
> < stat(path,st);
> < }
> < llapi_printf(LLAPI_MSG_NORMAL, "%d %d %d %d %d %d
> %03o
> %s",st->st_size,st->st_atime,st->st_mtime,st->st_ctime,st->st_uid,st->st_gid,st->st_mode,
> path);
> < }
> < else
> < llapi_printf(LLAPI_MSG_NORMAL, "%s", path);
> < if (param->zeroend)
> < llapi_printf(LLAPI_MSG_NORMAL, "%c", '\0');
> < else
> < llapi_printf(LLAPI_MSG_NORMAL, "\n");
> ---
> > llapi_printf(LLAPI_MSG_NORMAL, "%s", path);
> > if (param->zeroend)
> > llapi_printf(LLAPI_MSG_NORMAL, "%c", '\0');
> > else
> > llapi_printf(LLAPI_MSG_NORMAL, "\n");
diff ./lustre/utils/lfs.c
../../lustre_source1/lustre-1.8.7wc1/lustre/utils/lfs.c
133c133
< " [--maxdepth|-D N] [[!] --name|-n <pattern>] [--print0|-P]
[--ls]\n"
---
> " [--maxdepth|-D N] [[!] --name|-n <pattern>] [--print0|-P]\n"
452d451
< #define FIND_LS 4
477d475
< {"ls", no_argument, 0, FIND_LS},
595,598d592
< case FIND_LS:
< new_fashion = 1;
< param.ls = 1;
< break;
diff ./lustre/include/lustre/liblustreapi.h
../../lustre_source1/lustre-1.8.7wc1/lustre/include/lustre/liblustreapi.h
121d120
< ls:1,
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.
_______________________________________________
Lustre-discuss mailing list
[email protected]
http://lists.lustre.org/mailman/listinfo/lustre-discuss